close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Partially dynamic menus as a site-wide template

Thread began 10/14/2009 2:06 pm by rwarren4368428 | Last modified 10/15/2009 9:08 pm by Eric Mittman | 1350 views | 3 replies |

rwarren4368428

Partially dynamic menus as a site-wide template

As part of a subscription service, several different classes of visitors need navigation to various groups of pages with exclusion of blocked access rights. There are about 5 classes of visitors, each having a static set of appropriate links. We are using PHP/MySQL server technologies.

Can varied menus be substituted based upon a session variable, such as $_SESSION['UserGroup'], and applied to many pages in a shared manner? Actions (such as logging in) during sessions can change the 'UserGroup' value. A default of "Unknown" for a session UserGroup is set, and changes are applied through an authentication process.

Sign in to reply to this post

Eric Mittman

I'm having a little difficulty understanding your current scenario. When it comes to setting a session variable based on a value in a record for a user this is a feature of Security Assist. In the authenticate user server behavior on the last step you can configure session variables based on the values for that users record. So if you store the UserGroup value in the user's record then you can have this value stored in a session variable on login. You get to name this session variable yourself so you can use the one from your example.

You could then conditionally show, or hide areas of the navigation or have entirely different navigation depending on the value of this session variable.

Sign in to reply to this post

rwarren4368428

Dynamic menu sets in a template

Originally Said By: Eric Mittman
  I'm having a little difficulty understanding your current scenario. When it comes to setting a session variable based on a value in a record for a user this is a feature of Security Assist. In the authenticate user server behavior on the last step you can configure session variables based on the values for that users record. So if you store the UserGroup value in the user's record then you can have this value stored in a session variable on login. You get to name this session variable yourself so you can use the one from your example.

You could then conditionally show, or hide areas of the navigation or have entirely different navigation depending on the value of this session variable.  



The session variable is done. I'm having trouble getting entirely different navigation to show based on the value. How can this be done (in PHP) as part of a template, so that it can be applied to many pages across a website. I tried a couple of options, but they seem to show as body text rather than as menus. I know that I'm likely to just be missing some basic setting or command in the code.

Sign in to reply to this post

Eric Mittman

There are probably a few ways you can get this done but one of the easiest may be to have different menus that you conditionally use depending on the user level.

You could implement something like this by first creating the menus in Menu Writer. You would craft each unique menu here.

Then on your template page where you would have a reference to the menu file you can add in references to the other menus. When they are all on the page you can add in some if statements or a switch statement so that only one of them is used.

Every time you create another menu in the site there will be a new menu in the menu writer folder. They will be prefixed with 0, then 1 and so on. If you craft this correctly you could just use a single reference for the menu file and concatenate the user group session variable that holds one of the corresponding values for the menu you would like to display. This part is a little advanced but would give you the same result.

If you have any problems with any part of this let me know and I can give you some pointers.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...