Using menu's as nested content


(Ryan Archer) #1

I am building a website that is personalised to a particular user group - using show if statements based on the user group and swapping out nested content depending on the category/type of user that is visiting the website. They can change their level of access via a dropdown menu.

 

My question is that I want to customise the menu that the user views depending on their group access. Is is possible to have nested content and insert MySource Menu Normal Design Area into the nested content? Will it display and be properly parsed by Squiz Matrix? I have only ever nested HTML code into a design area before. 


(Douglas (@finnatic at @waikato)) #2

With the nesting question - not in my experience - the Design Area code has to go in a design parse file.

 

You can however, in a design parse file have code that checks the group you're in and shows or hides elements - have you reviewed https://manuals.matrix.squizsuite.net/designs/chapters/show-if-design-area ?


(Ryan Archer) #3

Yes, I am already using the "IF Design Area" within the site for some other personalisation. Going back on my first question, it was a little bit obscure and I realise putting the Menu Normal Design Area within the design parse file is the best option but it does not solve the personalisation issue. Squiz Matrix is intelligent enough to create a menu depending on the order of assets within the system (the asset map).

 

Now would there be a way to 'tag' assets with metadata so that only certain assets are printed into a menu depending on the user group accessing the website? Basically run a decision algorithm that says "This user is accessing the website through XX user group, Ok now print all assets into the menu that have XX metadata value assigned to them.

 

The next issue (which I really don't think can be overcome) is to order the assets in the menu specifically for each user group - basically not using the structure set up by the Asset Map, this is where I know I am in deep water based on my knowledge therein.

 

I really hope this makes sense.


(Douglas (@finnatic at @waikato)) #4

AFAIK, what gets shown in the menu depends on the permissions set - have you considered using permissions to customise the menu for different groups?


(Ryan Archer) #5

Yeah, that isn't going to work out for us as we still want to enable access to those pages - but just have different menu configurations for each user group type.

I think we'll pass on this as it already seems to be digging us a whole that we probably can't get out of.


(Bart Banda) #6

Yea sounds a bit messy to set up and maintain. If I was doing it though I'd probably look at using asset listings/search page listings to generate these menu items instead of the menu design area as you can then take advantage of dynamic root nodes and search based listings using metadata. 


(Ryan Archer) #7

Just want to get back to this thread albeit on a slightly different subject/path.

Implementing a mega menu on one of our sites and just wondering if there is a way for Squiz to print only certain page assets in a menu design area?

 

Reason is that some sections do not have many children and make the megamenu look quite bad with lots of whitespace. It would be great to structure the architecture of the website to better fit a mega menu but that is not an option due to our user group and a whole bunch of issues we'd have to deal with in regards to broken links and grumpy people.

 

Not wishing to make pages into 'Type 2' either as they will disappear from asset listing pages and other menus where they are needed - but just looking to hide certain pages (and their children) in one particular menu build.

 

Any way to make this possible? Just to clarify, not looking at the group view customisation anymore as I detailed above this comment.


(Nic Hubbard) #8

Just want to get back to this thread albeit on a slightly different subject/path.

Implementing a mega menu on one of our sites and just wondering if there is a way for Squiz to print only certain page assets in a menu design area?

 

Reason is that some sections do not have many children and make the megamenu look quite bad with lots of whitespace. It would be great to structure the architecture of the website to better fit a mega menu but that is not an option due to our user group and a whole bunch of issues we'd have to deal with in regards to broken links and grumpy people.

 

Not wishing to make pages into 'Type 2' either as they will disappear from asset listing pages and other menus where they are needed - but just looking to hide certain pages (and their children) in one particular menu build.

 

Any way to make this possible? Just to clarify, not looking at the group view customisation anymore as I detailed above this comment.

 

This sounds like a job for CSS.


(Bart Banda) #9

Use Metadata to indicate which assets to hide in the menu and then use CSS as Nic said to hide them. 


(Ryan Archer) #10

Ok, so if I got this straight. Tag the pages with a metadata schema for a hide/show boolean basically.

Then put the menu in a container div with a specific ID value.

 

Then use some javascript to detect the metadata value of the menu item (asset) then run some conditional logic to show/hide element via css at runtime if the condition is met? - Using the container div as a target so it is exclusive.

 

Does this sound right? 


(Nic Hubbard) #11

Ok, so if I got this straight. Tag the pages with a metadata schema for a hide/show boolean basically.

Then put the menu in a container div with a specific ID value.

 

Then use some javascript to detect the metadata value of the menu item (asset) then run some conditional logic to show/hide element via css at runtime if the condition is met? - Using the container div as a target so it is exclusive.

 

Does this sound right? 

 

No need for javascript, you would just use mysource tags to print the metadata within the menus. And the conditional logic would just be in the css. If you gave the items the class of "hidden" then you would just do:

#menu .hidden {
    display:none;
}

(Ryan Archer) #12

I think I got it, so simple. Use the metadata value of "hidden" or "show" - print it into the class of the menu item. Then the CSS takes care of the rest by hiding it depending on it's css class.


(Nic Hubbard) #13

I think I got it, so simple. Use the metadata value of "hidden" or "show" - print it into the class of the menu item. Then the CSS takes care of the rest by hiding it depending on it's css class.

 

Yeah, I wouldn't even ever print "show". Just use hide. 


(Ryan Archer) #14

yeah you got a point, make it a tickbox metadata application then.


(Ryan Archer) #15

Took me a while to figure it out. This post was very helpful http://forums.squizsuite.net/index.php?showtopic=9668&hl=%2Bmysource+%2Bprint+%2Bmetadata#entry45598

In the end I used this within the design file to print an ID value for the element: 

<MySource_PRINT var="asset_metadata_hideMe_key" />

Didn't work as a class because of something previously reserved. The thing that stuck me for a bit was not putting the _key value on the end. Was wondering why it was not printing the value into the design file!