Not sure what you mean by plugin.
What I've done is write a separate ASP page with a few functions in it.
I then call the function from within the Template where I can gather the
unigue values required by the function.
I've included examples below.
Just seems like I should be able to grab the outermost page guid.
I checked for Session Variables and didn't find any. You know of some?
Better way to do this?
*In the Template*
<!IoRangeRedDotMode><%=strLinkingScheduleBanner("<%info_LiveChatSessionKey%>",
"<%info_LiveChatLoginGUID%>", "<%info_LiveChatPageGUID%>")%><
!/IoRangeRedDotMode>
*In the External ASP File*
<%
Function xmlPage(XMLString)
set objData = server.CreateObject("RDCMSASP.RdPageData") ' *
objData.XMLServerClassname="RDCMSServer.XmlServer" ' *
xmlPage = objData.ServerExecuteXML(XMLString, sErrors)
End Function
Function DecodeDate(OldDate)
Dim objIO
Set objIO = CreateObject("RDCMSAsp.RDPageData")
DecodeDate = objIO.decodedate(OldDate)
End Function
Function getParentPageGUID(strSessionKey, strLoginGUID, strPageGUID)
XMLString = ""
XMLString = XMLString & "<IODATA loginguid='" & strLoginGUID & "'
sessionkey='" & strSessionKey & "' format='0'>"
XMLString = XMLString & " <PAGE action='load' guid='" & strPageGUID &
"' />"
XMLString = XMLString & "</IODATA>"
xmlFile = xmlPage(XMLString)
Response.Write("<!-- " & strPageGUID & " -->") & vbCrLf
Response.Write("<!-- " & xmlFile & " -->")
Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
xmlDoc.loadXML(xmlFile)
Set RDxmlNodeList = xmlDoc.getElementsByTagName("PAGE")
getParentPageGUID = RDxmlNodeList(0).getAttribute("parentguid")
End Function
Function strLinkingSchedule(strSessionKey, strLoginGUID, strLinkPageGUID,
strParentPageGUID)
If strSessionKey = "" Or strLoginGUID = "" Or strLinkPageGUID = "" Then
strLinkingSchedule = "[<img src='http://reddot/cms/Icons/TimeState.gif'
align='absmiddle' style='display:inline' /> Linking information not
available]"
Else
XMLString = ""
XMLString = XMLString & "<IODATA sessionkey='" & strSessionKey & "'
loginguid='" & strLoginGUID & "'>"
XMLString = XMLString & " <PAGE guid='" & strLinkPageGUID & "'>"
XMLString = XMLString & " <LINKSFROM action='load' />"
XMLString = XMLString & " </PAGE>"
XMLString = XMLString & "</IODATA>"
xmlFile = xmlPage(XMLString)
Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
xmlDoc.loadXML(xmlFile)
Set RDxmlNodeList = xmlDoc.getElementsByTagName("LINK")
If RDxmlNodeList.length > 0 Then
For x = 0 to (RDxmlNodeList.length - 1)
strCurrentPageGUID = RDxmlNodeList(x).getAttribute("pageguid")
If (StrComp(strCurrentPageGUID, strParentPageGUID, 1) = 0) Then
With RDxmlNodeList(x)
RdBeginDate = .getAttribute("datebegin")
RdEndDate = .getAttribute("dateend")
RdDateState = .getAttribute("datestate")
End With
End If
Next
strLinkingSchedule = strLabel(RdDateState, RdBeginDate, RdEndDate)
End If
'Response.Write("<!-- PageGUID: " & strLinkPageGUID & " -->") & vbCrLf
'Response.Write("<!-- ParentPageGUID: " & strParentPageGUID & " -->")
& vbCrLf
'Response.Write("<!-- " & xmlFile & " -->")
End If
End Function
Function strLinkingScheduleBanner(strSessionKey, strLoginGUID,
strPageGUID)
If strSessionKey = "" Or strLoginGUID = "" Or strPageGUID = "" Then
strLinkingScheduleBanner = "[<img src='
http://reddot/cms/Icons/TimeState.gif' align='absmiddle'
style='display:inline' /> Linking information not available]"
Else
XMLString = ""
XMLString = XMLString & "<IODATA sessionkey='" & strSessionKey & "'
loginguid='" & strLoginGUID & "'>"
XMLString = XMLString & " <PAGE guid='" & strPageGUID & "'>"
XMLString = XMLString & " <LINKSFROM action='load' />"
XMLString = XMLString & " </PAGE>"
XMLString = XMLString & "</IODATA>"
xmlFile = xmlPage(XMLString)
Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
xmlDoc.loadXML(xmlFile)
Set RDxmlNodeList = xmlDoc.getElementsByTagName("LINK")
strParentPageGUID = getParentPageGUID(strSessionKey, strLoginGUID,
strPageGUID)
If RDxmlNodeList.length > 0 Then
For x = 0 to (RDxmlNodeList.length - 1)
strCurrentPageGUID = RDxmlNodeList(x).getAttribute("pageguid")
If (StrComp(strCurrentPageGUID, strParentPageGUID, 1) = 0) Then
With RDxmlNodeList(x)
RdBeginDate = .getAttribute("datebegin")
RdEndDate = .getAttribute("dateend")
RdDateState = .getAttribute("datestate")
End With
End If
Next
strLinkingScheduleBanner = strLabel(RdDateState, RdBeginDate,
RdEndDate)
End If
Response.Write("<!-- PageGUID: " & strPageGUID & " -->") & vbCrLf
Response.Write("<!-- ParentPageGUID: " & strParentPageGUID & " -->") &
vbCrLf
'Response.Write("<!-- " & xmlFile & " -->")
End If
End Function
Function strLabel(RdDateState, RdBeginDate, RdEndDate)
Dim strIconMsg : strIconMsg = ""
Select Case RdDateState
Case "1"
strIconMsg = "Unlimited appearance schedule"
Case "2"
strIconMsg = "Link is not yet active"
Case "3"'
strIconMsg = "Link is active"
Case ""
strIconMsg = "An error has occurred"
Case Else
strIconMsg = "Story has expired"
End Select
If RdBeginDate = "0" Then
If RdEndDate = "0" Then
strLabel = " [<img alt='" & strIconMsg & "' src='
http://reddot/cms/Icons/TimeState" & RdDateState & ".gif' align='absmiddle'
style=""display:inline"" /> <span style=""font-size:
7pt;"">Permanent</span>]"
Elseif RdEndDate <> "0" Then
strLabel = " [<img alt='" & strIconMsg & "' src='
http://reddot/cms/Icons/TimeState" & RdDateState & ".gif' align='absmiddle'
style=""display:inline"" /> <span style=""font-size: 7pt;"">No start date -
" & DecodeDate(RdEndDate) & "</span>]"
End If
Else
If RdEndDate <> "0" Then
If RdEndDate = "" Then
strLabel = " [<img alt='" & strIconMsg & "' src='
http://reddot/cms/Icons/TimeState" & RdDateState & ".gif' align='absmiddle'
style=""display:inline"" /> <span style=""font-size: 7pt;"">An error has
occurred</span>]"
Else
strLabel = " [<img alt='" & strIconMsg & "' src='
http://reddot/cms/Icons/TimeState" & RdDateState & ".gif' align='absmiddle'
style=""display:inline"" /> <span style=""font-size: 7pt;"">" &
DecodeDate(RdBeginDate) & " - " & DecodeDate(RdEndDate) & "</span>]"
End If
Else
strLabel = " [<img alt='" & strIconMsg & "' src='
http://reddot/cms/Icons/TimeState" & RdDateState & ".gif' align='absmiddle'
style=""display:inline"" /> <span style=""font-size: 7pt;"">" &
DecodeDate(RdBeginDate) & " - No end date</span>]"
End If
End If
End Function
%>
On Thu, Jul 1, 2010 at 2:52 PM, Wayne Bouwmeester <
[email protected]> wrote:
> Not sure where the render tag doc'n comes from - should be available
> from OpenText.
>
> Where is your ASP code? In a template or in a separate file in the
> Plugins directory?
>
> If your code is in a template, just paste the code in.
> If it's in a file that you are calling with a url, add it as a url
> parameter abcd.asp?parentPageGUID="<%!!
> Context:CurrentMasterPage.Id> !!%>
>
> If you're calling the plugin from the actions menu or someting, you're
> kinda hooped.
> You might be able to parse it out of one of the session variables, but
> I didn't see one that had the current outer page guid.
>
> I'd suggest creating a form, adding parentpageguid as a hidden field
> along with anything else you need, setting the action of the form to
> the asp file in the plugins directory, and giving the user a submit
> button.
> set the target to _blank and you should be good. You can get fancy
> with javascript later if you want to control window size and options.
>
>
> On Jul 1, 3:17 pm, Bill Rishsew <[email protected]> wrote:
> > Render tags? Is there documentation for them?
> >
> > How do I insert CurrentParentPageGuid = "<%!!
> Context:CurrentMasterPage.Id
> > !!%>" inside of ASP code? I've tried a variety of ways to no avail.
> >
> > And Thanks.
> > On Thu, Jul 1, 2010 at 1:54 PM, Wayne Bouwmeester <
> >
> >
> >
> > [email protected]> wrote:
> > > You should be able to get it via render tags, and render it as part of
> > > your code.
> > > Paste this into your code (assuming the code is within the banner
> > > class)
> > > Otherwise, you'll need to put it in the URL you use to call your
> > > plugin as a query parameter.
> > > CurrentParentPageGuid = "<%!! Context:CurrentMasterPage.Id !!%>"
> >
> > > On Jul 1, 2:31 pm, Bill Rishsew <[email protected]> wrote:
> > > > I used
> >
> > > > <IODATA loginguid="[!guid_login!]" sessionkey="[!key!]">
> > > > <PAGE action="load" guid="[!guid_page!]"/>
> > > > </IODATA>
> >
> > > > And pulled the *parentguid* (GUID of the element with which the page
> is
> > > > connected.)
> >
> > > > The problem here is that it is pulling the parentguid for the "main
> link"
> > > in
> > > > the list of links!
> >
> > > > There has to be a way to get the parent link of the current page!!
> Right?
> >
> > > > I've been all through the RQL documentation and just don't see it.
> >
> > > > On Thu, Jul 1, 2010 at 10:26 AM, Bill Rishsew <
> [email protected]
> > > >wrote:
> >
> > > > > Craig,
> > > > > Thanks for the input. I think I should better explain myself. I
> can
> > > do
> > > > > so now because of all of the attempts I've made at this. I'm a home
> > > schooled
> > > > > student in RedDot and I'm the teacher too. The more I dig, the more
> I
> > > > > understand. So I don't think I've been explaining my situation as
> well
> > > as a
> > > > > more experienced person could.
> >
> > > > > I have a tempale I call Banners. Banners contains very basic
> > > elements,
> > > > > e.g. an image element and an anchor element, etc.
> > > > > Most of my Banners are used throughout the site. Normal
> behaviour I
> > > > > think.
> > > > > When I perform the query via RQL I receive an xml file that
> contains
> > > the
> > > > > page information for every page the banner is linked from. Most
> cases
> > > result
> > > > > in a very large xml file. Again, expected.
> > > > > When I comb through the xml file, I want to extract the page
> > > > > information relevent to the page I have open.
> > > > > In one case I have a page named Newsroom Page open with a Live
> Chat
> > > > > banner linked. The Newsroom Page guid is 4585...C479 and the banner
> has
> > > a
> > > > > guid of 1AA5...2654. (This particular banner is linked to well over
> 100
> > > > > pages).
> > > > > When I visually parse the xml file I see the <LINK.. /> that
> > > contains a
> > > > > reference to the Newsroom Page. This is the one I want for this
> page.
> > > > > So, what I need to do is to have already identified the Newsroom
> > > Page
> > > > > guid (this is what I have called the Parent Page GUID) before I
> loop
> > > through
> > > > > the xml file.
> > > > > I see that the RedDot onclick for the banner contains a
> reference to
> > > the
> > > > > Parent Page GUID, pageGUID=458...C479
> >
> > > > > I hope this helps.
> >
> > > > > On Thu, Jul 1, 2010 at 5:01 AM, Craig Castledine <
> > > > > [email protected]> wrote:
> >
> > > > >> So you want the GUID of the page that contains the element? You
> can
> > > use
> > > > >> the "pageguid" attribute returned from your query:
> >
> > > > >> Change
> > > > >> getParentPageGUID = RDxmlNodeList(0).getAttribute("guid")
> > > > >> to
> > > > >> getParentPageGUID = RDxmlNodeList(0).getAttribute("pageguid")
> >
> > > > >> Hope that helps.
> >
> > > > >> Craig.
> >
> > > > >> On 1 July 2010 00:08, Bill Rishsew <[email protected]>
> wrote:
> >
> > > > >>> With closer examination the function to get the Parent Page
> GUID
> > > isn't
> > > > >>> return the Parent Page GUID.
> > > > >>> The value being returned is the same. I need it to return the
> GUID of
> > > the
> > > > >>> Page it is contained in.
> > > > >>> Thoughts.
> >
> > > > >>> Function getParentPageGUID(strSessionKey, strLoginGUID,
> > > strPageGUID)
> > > > >>> XMLString = ""
> > > > >>> XMLString = XMLString & "<IODATA loginguid='" & strLoginGUID
> & "'
> > > > >>> sessionkey='" & strSessionKey & "' format='0'>"
> > > > >>> XMLString = XMLString & " <ELT action='load' guid='" &
> > > strPageGUID &
> > > > >>> "' />"
> >
> > > > >>> XMLString = XMLString & "</IODATA>"
> > > > >>> xmlFile = xmlPage(XMLString)
> > > > >>> Set xmlDoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
> > > > >>> xmlDoc.loadXML(xmlFile)
> > > > >>> Set RDxmlNodeList = xmlDoc.getElementsByTagName("ELT")
> > > > >>> Response.Write("<!-- " & xmlFile & " -->") & vbCrLf
> > > > >>> getParentPageGUID = RDxmlNodeList(0).getAttribute("guid")
> > > > >>> End Function
> > > > >>> On Wed, Jun 30, 2010 at 10:16 AM, Bill Rishsew <
> > > > >>> [email protected]> wrote:
> >
> > > > >>>> The way I set it up is how you outlined below. Just slows the
> page
> > > load
> > > > >>>> a bit is all. Hoped to compact it a bit. Maybe I'll sit and
> stare a
> > > bit.
> > > > >>>> Considering the number of clicks it is saving the content
> editors,
> > > it's
> > > > >>>> worth it. Now they can see when the all of the links expire on
> that
> > > page in
> > > > >>>> a glance.
> > > > >>>> On Wed, Jun 30, 2010 at 9:43 AM, Wayne Bouwmeester <
> > > > >>>> [email protected]> wrote:
> >
> > > > >>>>> You mean all the parent page guids for all the links?
> > > > >>>>> I don't think so - too complicated since you'd need to specify
> > > which
> > > > >>>>> link, and RQL isn't that complex.
> >
> > > > >>>>> At best you might be able to add multiple ELT nodes in one
> call,
> > > and
> > > > >>>>> run it at the end of all your PAGE calls. Try it and see what
> you
> > > get.
> > > > >>>>> I didn't see anything in the documentation, but I know you can
> save
> > > > >>>>> multiple elements in a single call back to RD, so it might
> work.
> >
> > > > >>>>> On Jun 30, 10:34 am, Bill Rishsew <[email protected]>
> wrote:
> > > > >>>>> > Got it, thanks. Works well.
> > > > >>>>> > Is there a way to get the information in a single XML.
> >
> > > > >>>>> > I'm using
> >
> > > > >>>>> > <IODATA sessionkey=[!key!] loginguid=[!guid_login!]'>
> > > > >>>>> > <PAGE guid=[!guid_element!]'>
> > > > >>>>> > <LINKSFROM action='load' />
> > > > >>>>> > </PAGE>
> > > > >>>>> > </IODATA>
> >
> > > > >>>>> > and
> >
> > > > >>>>> > <IODATA loginguid="[!guid_login!]" sessionkey="[!key!]"
> > > format="0">
> > > > >>>>> > <ELT action="load" guid="[!guid_element!]" />
> > > > >>>>> > </IODATA>
> >
> > > > >>>>> --
> > > > >>>>> You received this message because you are subscribed to the
> Google
> > > > >>>>> Groups "RedDot CMS Users" group.
> > > > >>>>> To post to this group, send email to
> > > [email protected]
> > > > >>>>> .
> > > > >>>>> To unsubscribe from this group, send email to
> > > > >>>>> [email protected]<reddot-cms-users%[email protected]>
> <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> >
> > > <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> >
> >
> > > > >>>>> .
> > > > >>>>> For more options, visit this group at
> > > > >>>>>http://groups.google.com/group/reddot-cms-users?hl=en.
> >
> > > > >>>> --
> > > > >>>> Work Hard! Play Harder!!
> >
> > > > >>> --
> > > > >>> Work Hard! Play Harder!!
> >
> > > > >>> --
> > > > >>> You received this message because you are subscribed to the
> Google
> > > Groups
> > > > >>> "RedDot CMS Users" group.
> > > > >>> To post to this group, send email to
> > > [email protected].
> > > > >>> To unsubscribe from this group, send email to
> > > > >>> [email protected]<reddot-cms-users%[email protected]>
> <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> >
> > > <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> >
> >
> > > > >>> .
> > > > >>> For more options, visit this group at
> > > > >>>http://groups.google.com/group/reddot-cms-users?hl=en.
> >
> > > > >> --
> > > > >> You received this message because you are subscribed to the Google
> > > Groups
> > > > >> "RedDot CMS Users" group.
> > > > >> To post to this group, send email to
> > > [email protected].
> > > > >> To unsubscribe from this group, send email to
> > > > >> [email protected]<reddot-cms-users%[email protected]>
> <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> >
> > > <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> >
> >
> > > > >> .
> > > > >> For more options, visit this group at
> > > > >>http://groups.google.com/group/reddot-cms-users?hl=en.
> >
> > > > > --
> > > > > Work Hard! Play Harder!!
> >
> > > > --
> > > > Work Hard! Play Harder!!
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "RedDot CMS Users" group.
> > > To post to this group, send email to [email protected]
> .
> > > To unsubscribe from this group, send email to
> > > [email protected]<reddot-cms-users%[email protected]>
> <reddot-cms-users%[email protected]<reddot-cms-users%[email protected]>
> >
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/reddot-cms-users?hl=en.
> >
> > --
> > Work Hard! Play Harder!!
>
> --
> You received this message because you are subscribed to the Google Groups
> "RedDot CMS Users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<reddot-cms-users%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/reddot-cms-users?hl=en.
>
>
--
Work Hard! Play Harder!!
--
You received this message because you are subscribed to the Google Groups
"RedDot CMS Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/reddot-cms-users?hl=en.