MenuManager

A plugin to enable management of menus within October CMS

Back to MenuManager Support

drtzack
drtzack

It could be nice if we can add menu item for non logged and logged users.

benfreke
benfreke

It would :)

Have a look at this discussion though, as that explains how to do it if you absolutely need it.

http://octobercms.com/plugin/benfreke-menumanager/show-menu-based-on-user-status

For the record, if I ever get a chance to update this to v2, this will be part of it. But that won't be before December at least.

drtzack
drtzack

I see. I already did it by changing your code.

Defined a function in your Menu Model

/**
 * Checks the auth
 *
 * @return string
 */
public function isAuth()
{
    $p = (array) json_decode($this->parameters);
    if(!isset($p['auth'] )) return true;
    return $p["auth"] == \Auth::check();        
}

And checked it in my partial.

Defined in parameters {"auth": true} (logged) or {"auth": false} (non logged) if I don't define auth it will be visible for everyone.

Last updated

1-3 of 3