Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
PPlanet Posted December 26, 2017 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>
Faqole Posted December 26, 2017 Posted December 26, 2017 Wrap them up inside an if conditional to show up to members only.
TheJackal84 Posted December 26, 2017 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}}
PPlanet Posted December 26, 2017 Author Posted December 26, 2017 Great, thank you very much. That does it.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.