Check if a container has a reference

31 views
Skip to first unread message

Nick Galotti

unread,
Jul 6, 2011, 11:58:02 AM7/6/11
to RedDot CMS Users
I was wondering if anyone knew a way to check if a container is
referencing another container which may or may not be connected to a
page.

Nick Galotti

unread,
Jul 7, 2011, 4:32:06 PM7/7/11
to RedDot CMS Users
For those curious here is the function I ended up writing:


Function IsReferenced(sPageGUID, sLinkName)
sLinkGUID = GetLinkGUID(sPageGUID, sLinkName)
xmlData = "<IODATA sessionkey=""" & SessionKey & """><TREESEGMENT
action=""gototreereference"" guid=""" & sLinkGUID & """ type=""link"" /
></IODATA>"
xmlData = objIO.ServerExecuteXML(xmlData, sError)
objXMLDOM.LoadXML(xmlData)
If (xmlData = "<IODATA>" & vbCrLf & "</IODATA>") Then
IsNotReferenced = false
Else
IsNotReferenced = true
End If
End Function

Markus Giesen

unread,
Jul 7, 2011, 9:56:54 PM7/7/11
to RedDot CMS Users
Nice one! Thanks Nick!

Jian Huang

unread,
Jul 8, 2011, 9:09:25 AM7/8/11
to RedDot CMS Users
Hi Nick,

Thanks for RQL.

Since it is using <TREESEGMENT>, not sure if users with SmartEdit
access only can run it.

Here is an alternative RQL

<ELT action="load" guid="sLINKGUID" />

In the return RQL, within ELT, check attribute islink.

10 means it is referencing something.

For more information, please see 562.htm within the RQL doku/manual.

Best of luck of whatever you are trying to make.

-Jian

Nick Galotti

unread,
Jul 8, 2011, 3:42:56 PM7/8/11
to reddot-c...@googlegroups.com
Thanks for the information. We just ran some preliminary tests and it looks like a SmartEdit user is able to run it successfully. I'll still change it to this other tag when I get a chance.

Arek Gruszowski ( www.enthink.com )

unread,
Jul 8, 2011, 10:44:45 PM7/8/11
to RedDot CMS Users
Have you tried a SmartEdit user that does not have SmartTree access? I
think that one might fail since any Tree Segment RQL calls are usually
associated with SmartTree users only.
Reply all
Reply to author
Forward
0 new messages