Render tag to find out whether Container is connected or not

65 views
Skip to first unread message

Chandrakanth Ramireddy

unread,
Jan 28, 2010, 7:19:53 AM1/28/10
to RedDot CMS Users
Hi,

Please suggest me how I can find out if a container element is
connected or not.

I have to skip a block of code if the container is not connected.

Thanks,
Chandrakanth

Mark Radford

unread,
Jan 28, 2010, 9:50:44 AM1/28/10
to RedDot CMS Users
You could try checking to see if
Context:CurrentIndex.Page.Elements.GetElement
(container_element).Value.Count is 0 or not. I'm not sure if that'll
actually work, but it looks about right to me.

Or failing that, what about Conditional block-marks?

Mark

On Jan 28, 12:19 pm, Chandrakanth Ramireddy <chandra.1...@gmail.com>
wrote:

TonyGayter

unread,
Jan 28, 2010, 9:54:57 AM1/28/10
to RedDot CMS Users
What do you mean, do you mean? Do you mean if anything is connected to
a container wihtin a page or if the page is connected to a container
itself?

If you just want to check to see if anything is connected you could
just surround it with a conditional block. Otherwise it will probobly
involve some rql to check the type of object the current page is
connected to.

On Jan 28, 12:19 pm, Chandrakanth Ramireddy <chandra.1...@gmail.com>
wrote:

Dave Bellous

unread,
Jan 28, 2010, 12:04:24 PM1/28/10
to reddot-c...@googlegroups.com
Chandrakanth,

This is the method I've used in the past:

<reddot:cms>
<if>
<query valuea="Context:CurrentPage.Elements.GetElement(con_MyContainer).Value[Int:0].Headline" operator="==" valueb="Escape:Null">
<htmltext><h1>There is no container</h1></htmltext>
</query>
<query type="else">
<htmltext><h2>There is a container here</h2></htmltext>
</query>
</if>
</reddot:cms>

It's a bit flakey as it requires you have a headline on a container to execute properly, but that's generally a safe assumption.

There may be a better way to accomplish this - and I'd be delighted to hear it!

thanks,

.dave

> --
> You received this message because you are subscribed to the Google Groups "RedDot CMS Users" group.
> To post to this group, send email to reddot-c...@googlegroups.com.
> To unsubscribe from this group, send email to reddot-cms-use...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/reddot-cms-users?hl=en.
>

--
daveb

RedDotExpert

unread,
Feb 19, 2010, 9:26:27 AM2/19/10
to RedDot CMS Users
<!IoRangeConditional>
<div>
<%con_body%>
</div>
<!/IoRangeConditional>
Reply all
Reply to author
Forward
0 new messages