Felipe Posted March 8, 2014 Report Share Posted March 8, 2014 I wonder if anybody in here would help me, please, solve the following... I'm coding my web site template to have two menus, in accordance to the requested ".tpl" file. Actually, in case the user is requesting the frontpage_main.tpl, it should use one block of html tags, and in case it is any other .tpl file, it should be another block of html tags. So my question is: is there any phpVMS native class + method I can put in the if() statement to check which .tpl file the user is requesting? Id it does not, how could I solve it by simply using php? Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted March 8, 2014 Moderators Report Share Posted March 8, 2014 Open the appropriate file (in the default version of phpvms it is named core_navigation.tpl) and just use this: <?php if(!Auth::LoggedIn()) { ?> //The meeus you want to show if a user is not logged in <?php } else { ?> //The menus you want to show if he is logged in <?php } ?> Quote Link to comment Share on other sites More sharing options...
Felipe Posted March 8, 2014 Author Report Share Posted March 8, 2014 Hello, servetas! This was my first try, but, actually, I realized the are some "" that should be shown to both logged in and not. I guesse the best solution would be working on the layout.tpl, since this part... <ul class="nav"> <?php Template::Show('core_navigation.tpl'); ?> </ul> ... fits for what I want. I just have to have an if() statement in here to check if the request is for the frontpage_main.tpl or any other .tpl. Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted March 8, 2014 Moderators Report Share Posted March 8, 2014 Ok. you may use the if statement i send you wherever you want. <?php if(!Auth::LoggedIn()) { ?> //The .tpl file you want to show if a user is not logged in <?php } else { ?> //The .tpl file you want to show if he is logged in <?php } ?> Quote Link to comment Share on other sites More sharing options...
Felipe Posted March 8, 2014 Author Report Share Posted March 8, 2014 servetas, in fact, my "problem" is not if the user is logged in or not. Actually, it doesn't really matter. The point in here is whheter the request is the frontpage_main.tpl or any other one. Quote Link to comment Share on other sites More sharing options...
Moderators servetas Posted March 8, 2014 Moderators Report Share Posted March 8, 2014 Very good. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.