MySource_AREA within another MySource_AREA


(Hopkinsd1) #1

Hello,

 

Within my design parse file I want to have a "Show if design area" to check a metadata value and print navigation depending upon the metadata value. 

 

I am using the following "Show if design area" to check the value of my metadata.  This works correctly and I get the comment "Add navigation here" when I expect it to appear.

I then have the following code to print out some navigation.

Again the above code works when I put it in my design parse file, but when I put it within the "Show if design area" <MySource_THEN> tags instead of the comment, all I get is the <ul>.

 

It looks as if you cant nest a MySource_AREA within another?  Is this correct? If so how should I go about achieving this?

 

Thanks


(Nic Hubbard) #2

You can. What you need to do is use a print tag within the other mysource_area. Here is an example that I use:

 

<mysource_area id_name="simpleEditJavascript" design_area="nest_content" print="no">
    <mysource_set name="type_codes" value="page" />
</mysource_area>

<MySource_AREA id_name=“simple_edit_hide_nested” design_area=“show_if”> 
<MySource_SET name=“condition” value=“simple_edit_mode” />
  <MySource_THEN>
           <mysource_print id_name=“simpleEditJavascript” />
</MySource_THEN> 
<MySource_ELSE>

So, in this example, I am using a show_if, and only printing the nested javascript area if the user is in simple edit mode. 

 

Take note of the print="no" option for the mysource_area that you are wanting to nest within another.


(Hopkinsd1) #3

Hi Nic,

 

That works great thanks.

 

David