PPlanet Posted December 26, 2017 Share Posted December 26, 2017 I've modified my mobileNavBar template to add a couple of menu items. Does anyone know how can I hide these two extra items from guests? (The pencil and refresh ones, so the two last ones in the code below) {{$defaultStream = \IPS\core\Stream::defaultStream();}} <li {{if !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'discover' ) ) }}class='ipsHide'{{endif}}> <a data-action="defaultStream" class='ipsType_light' href='{{if $defaultStream}}{$defaultStream->url()}{{else}}{url="app=core&module=discover&controller=streams" seoTemplate="discover_all"}{{endif}}'><i class='icon-newspaper'></i></a> </li> <li {{if !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'discover' ) ) }}class='ipsHide'{{endif}}> <a class='ipsType_light' href='{url="discover/6/" seoTemplate="Latest Reviews"}'><i class='fa fa-pencil-square-o'></i></a> </li> <li {{if !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'discover' ) ) }}class='ipsHide'{{endif}}> <a class='ipsType_light' href='{url="discover" seoTemplate="all_activity"}'><i class='fa fa-refresh'></i></a> </li> Link to comment Share on other sites More sharing options...
Faqole Posted December 26, 2017 Share Posted December 26, 2017 Wrap them up inside an if conditional to show up to members only. Link to comment Share on other sites More sharing options...
TheJackal84 Posted December 26, 2017 Share Posted December 26, 2017 5 hours ago, PPlanet said: I've modified my mobileNavBar template to add a couple of menu items. Does anyone know how can I hide these two extra items from guests? (The pencil and refresh ones, so the two last ones in the code below) Like this {{$defaultStream = \IPS\core\Stream::defaultStream();}} <li {{if !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'discover' ) ) }}class='ipsHide'{{endif}}> <a data-action="defaultStream" class='ipsType_light' href='{{if $defaultStream}}{$defaultStream->url()}{{else}}{url="app=core&module=discover&controller=streams" seoTemplate="discover_all"}{{endif}}'><i class='icon-newspaper'></i></a> </li> {{if \IPS\Member::loggedIn()->member_id}} <li {{if !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'discover' ) ) }}class='ipsHide'{{endif}}> <a class='ipsType_light' href='{url="discover/6/" seoTemplate="Latest Reviews"}'><i class='fa fa-pencil-square-o'></i></a> </li> <li {{if !\IPS\Member::loggedIn()->canAccessModule( \IPS\Application\Module::get( 'core', 'discover' ) ) }}class='ipsHide'{{endif}}> <a class='ipsType_light' href='{url="discover" seoTemplate="all_activity"}'><i class='fa fa-refresh'></i></a> </li> {{endif}} Link to comment Share on other sites More sharing options...
PPlanet Posted December 26, 2017 Author Share Posted December 26, 2017 Great, thank you very much. That does it. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.