This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

forums7529
forums7529

Hi,

I'm using Static Pages, but the isActive property value is not being set.

Could someone please explain where item.isActive property value gets set, before being read within the following Partial file ?

https://github.com/rainlab/relax-theme/blob/master/partials/nav.htm

Many thanks

forums7529
forums7529

Anyone ? Please ?

Must be a very common requirement.

daftspunky
daftspunky

The isActive property can be set via the internals, the API or explicitly. Please read the documentation on how to set explicitly:

In some cases you might want to mark a specific menu item as active explicitly. You can do that in the page's onInit() function with assigning the activeMenuItem page variable a value matching the menu item code you want to make active. Menu item codes are managed in the Edit Menu Item popup.

function onInit()
{
    $this['activeMenuItem'] = 'blog';
}
forums7529
forums7529

Thanks Sam,

So the Relax theme doesn't include menu highlighting 'out of the box' ?

https://github.com/rainlab/relax-theme/blob/master/content/static-pages/chairs.htm

I read that part of the documentation that you quoted and tried the code snippet, but it didn't work.

I'll give it another try.

Many thanks.

forums7529
forums7529

I've copied the code, but it just doesn't work at all.

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.