Jump to content
  • 0

Help with custom function


Question

Hi all, I am new to Blesta and firstly just want to say that it's awesome software and thanks to everyone who posts solutions on the forums, they've already helped me numerous times while customising my installation.

I would really appreciate some expert assistance with creating a custom function that will allow me to show a different navigation menu to users who reach my site and are not logged in. For example, this might happen when clicking on a package link from my main site and starting the order process. At this point, I would like them to see a menu that replicates my main sites menu.

So basically I would like a function that performs the following - if user is logged in = true, display navmenu1, else display navmenu2.

Is this possible, if so, what code would I need, and where would i need to put it. Where would I need to create the new menu? I'm thinking that I might need to make it an entire new header which is fine.

Keep in mind that I am no coder and my coding knowledge is baby level, so as much details as possible would nice :)

Thanks so much to anyone that takes the time to answer this.

 

Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 0

The navigation menu can be found on /app/views/client/bootstrap/structure.pdt, in this file is available the $logged_in variable, which allows you to know if a user has logged in or not.

<?php
if ($this->Html->ifSet($logged_in)) {
?>
    <!-- The user is logged in: navmenu1 -->
<?php
} else {
?>
    <!-- The user is not logged in: navmenu2 -->
<?php
}
?>

 

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...