External script dynament for current URL

65 views
Skip to first unread message

Walter

unread,
Jan 13, 2012, 7:42:57 PM1/13/12
to reddot-c...@googlegroups.com
This seems like such a simple thing, but I can't seem to figure it out.  To grab the path of the current page, I've used the following dynament successfully:

<rde-dm:attribute source="content" mode="read" attribute="rde-fields.path" />

But how do I grab the same path value if the dynament is included as an external script?  For instance:

my-page.html
================

<rde-dm:include content="/xml/my-script.xml" />

... more HTML goes here ...

=================


my-script.xml
============

<rde-dm:attribute source="content" mode="read" attribute="rde-fields.path" />

============

In this case, the dynament returns "/xml/my-script.xml".  It seems that rde-fields.path returns whatever the content item is, regardless if it's embedded in another content item.  I want it to return the path of my-page.html.

What is the proper way of doing this?

Thanks a bunch,
Walter


Tim D

unread,
Jan 16, 2012, 10:10:09 AM1/16/12
to reddot-c...@googlegroups.com
Walter,

The Appendix of the DynaMents manual is handy for things like this, there are several there that will give you different values. If you just want the page delivered to the user request:rdeXmlID

The rde-fields.* attribute source is access to Accessors on the Open API CoaContent. As such it is looking at the current content being processed (this should be akin to the request:CurrentXMLId) in an OO programming way it makes sense that the includes content couldn't know about the including contents scope. Inside a request the DS needs to get multiple content instances and this is where the information exists you want. 

Walter

unread,
Jan 18, 2012, 10:30:26 AM1/18/12
to reddot-c...@googlegroups.com
Thanks for the explanation Tim, that's exactly what I needed.
Reply all
Reply to author
Forward
0 new messages