Show If Design Area for Has Children Condition


(Ryan Archer) #1

I am using the "Show If Design Area" with the "has children" condition to inject some custom HTML into the page.

I am developing a Design customisation based on Twitter Bootstrap. Bootstrap dictates that you insert <span class="carat></span> into the <a> element within the parent list item, e.g.

<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">About <span class="caret"></span></a>

Anyway, I am using the Show If Design Area to insert the span tag like thus:

              <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" href="<MySource_print var='asset_link' />"><MySource_print var='asset_short_name' />
            &lt;MySource_AREA id_name="children_or_peers" design_area="show_if"&gt;
                &lt;MySource_SET name="condition" value="has_children"/&gt;
                &lt;MySource_SET name="condition_types" value="page_standard" /&gt;
                &lt;MySource_SET name="condition_link_types" value="1" /&gt;
                &lt;MySource_THEN&gt;&lt;span class="caret"&gt;&lt;/span&gt;&lt;/MySource_THEN&gt;
                &lt;MySource_ELSE&gt;&lt;span&gt;&lt;/span&gt;&lt;/MySource_ELSE&gt;
            &lt;/MySource_AREA&gt;
        &lt;/a&gt;

But when I preview the page, it does not seem to be working at all. I also would like to not even use the ELSE statement or just have null there as I don't want any action to happen if the condition is not being met (like not even insert the empty span tag.

 

I am using Squiz version 4.18.4 and I've tested on IE11 and latest versions of Firefox and Google Chrome.

I have looked into the source code and cannot find any trace of it.

 

Any help would be much appreciated.


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

The has_children condition is working for us in 5.1.5.0 - while reworking old code this post caught my eye and the condition suggested itself as a solution.

 

I realise you've likely done this - but have you double-checked the link type and asset type of the children?


(Ryan Archer) #3

Yup. Most certainly have. Still no fun on this one.


(Euan Hawthorne) #4

Did you ever get this resolved? I am trying to achieve this as well.