Navigation Query Issue

13 views
Skip to first unread message

Dave R

unread,
Jul 27, 2010, 10:32:42 AM7/27/10
to RedDot CMS Users
Hey, I'm having a minor query issue in regards to the navigation
manager and I was wondering if any of you could help me with it.

What I've got is a situation where I want to display all following
children except when the child is hidden. I actually have that part
working just fine, but when there is only one child page and it is a
hidden one, the code still contains a <ul> to hold the child pages.
This causes no problems for non-IE browsers, but IE renders the <ul>
with a minimum height of about 10px. I can't resolve the problem using
IE specific CSS because it would effect combinations of child pages
both shown and hidden.

Anyway, I need help constructing a query that says the following:

If Page has Children, check to see how many children. If the page only
has one child, check "switch_HideNav". If equals hide, do nothing,
otherwise...

I'm not the strongest when it comes to this type of thing so any help
would be appreciate.

For the record, here's the current code that I'm using:

<reddot:cms>
<if>
<query
valuea="Context:CurrentPage.Elements.GetElement(switch_HideNav).GetHtml()"
operator="==" valueb="show">
<if>
<query valuea="Context:CurrentIndex.Id" operator="=="
valueb="Context:LastIndex.Id">
<htmltext>
<li class="lnavselected last">
<div><a href="<%!! Context:CurrentIndex.GetUrl() !!%>"><
%!! Context:CurrentIndex.Headline !!%></a></div>
</htmltext>
<if><query valuea="Context:CurrentIndex.HasChildren()"
operator="==" valueb="Bool:True">
<htmltext>
<ul class="tier3">
<navigation:nextlevel>
</ul>
</htmltext>
</query></if>
<htmltext>
</li>
</htmltext>
</query>
<query type="else">
<htmltext>
<li class="lnavselected">
<div><a href="<%!! Context:CurrentIndex.GetUrl() !!%>"><
%!! Context:CurrentIndex.Headline !!%></a></div>
</htmltext>
<if><query valuea="Context:CurrentIndex.HasChildren()"
operator="==" valueb="Bool:True">
<htmltext>
<ul class="tier3">
<navigation:nextlevel>
</ul>
</htmltext>
</query></if>
<htmltext>
</li>
</htmltext>
</query>
</if>
</query>
<query type="else">
<htmltext></htmltext>
</query>
</if>
</reddot:cms>

Line 10 is where I need to place the query.

TonyGayter

unread,
Jul 27, 2010, 10:54:22 AM7/27/10
to RedDot CMS Users
You might need to use the tidy option, that should get rid of empty
tags.

Dave R

unread,
Jul 28, 2010, 10:53:40 AM7/28/10
to RedDot CMS Users
I thought tidy forced html validation. If not... I may turn that on.

Dave R

unread,
Jul 30, 2010, 9:15:23 AM7/30/10
to RedDot CMS Users
OK... Tidy did do the trick. The PROBLEM I now have is other file
formats that I have tied to the same project variant don't publish out
properly. Things like RSS feeds. How do I set up a default project
variant for things like that so I don't have to run it through Tidy?

TonyGayter

unread,
Jul 30, 2010, 9:31:16 AM7/30/10
to RedDot CMS Users
You might need to seperate the project varients, We usually have at
least two, ASPX and XML
> > > > Line 10 is where I need to place the query.- Hide quoted text -
>
> - Show quoted text -

Mark Radford

unread,
Jul 30, 2010, 11:02:57 AM7/30/10
to RedDot CMS Users
You can choose on a template-by-template basis whether or not to use
tidy.

If you go to Administer Content Classes > Folder > Content Class >
Templates and choose "Assign Project Variants" from the Action Menu,
you can choose whether or not to use Tidy on that particular page.

So if you had a template for your RSS page, you could turn off tidy
for that template.

Bear in mind, this only works for templates that publish out as a
whole file. Something that goes inside a container will be tidied
based on the over-all page template's tidy settings.


Hopefully that makes sense :)

Mark

Dave R

unread,
Jul 30, 2010, 12:00:50 PM7/30/10
to RedDot CMS Users
Mark, that makes perfect sense and should be do-able. I'll look into
this next week. I'm glad there seems to be a dead simple solution for
this.

Thanks everyone.
Reply all
Reply to author
Forward
0 new messages