Print menu design area in show if design area

(Emily) #1

Matrix Version: 5.5.0

I am wanting to allow backend editors (who don’t necessarily use/create/apply Design settings to assets) to be able to choose whether or not to show the main navigation menu – which uses a Menu Normal Design Area. Hence, I am trying to do this with a Show If condition based off metadata. I have done this previously with success for nested content areas and (I think) breadcrumbs, based on using the PRINT tag.

However, it doesn’t seem to want to PRINT the menu normal content. If I substitute it with plain text (e.g. “Testing”), it shows. But as soon as I put the PRINT tag back instead, it doesn’t print the menu. If I have both the text and the print tag, it just shows the text.

Is this one of those limitations of what the PRINT tag will print?
If so, is there another idea for editor-easy switching, other than another design customisation?
(Otherwise I will just have to create a customisation).

This is my code:

<MySource_AREA id_name="show_main_nav" design_area="show_if">
  <MySource_SET name="condition" value="logical" />
  <MySource_THEN><MySource_PRINT id_name="menu" /></MySource_THEN>

Menu Normal’s id_name=“menu” . (How original of me!)
I know my logical condition is setup fine in the main Customisation, because the text will show when I put it into the “Then” area.

Thanks :slight_smile:

(Emily) #2

Solution found… Note to self: Always make sure to put the one to print=“no” before the show_if area, in the code. :roll_eyes:

(TT) #3

:laughing: that will definitely help!