tag:help-archives.hannonhill.com,2010-02-09:/discussions/velocity-formats/240-current-page-urlCascade CMS: Discussion 2013-08-20T03:46:24Ztag:help-archives.hannonhill.com,2010-02-09:Comment/187022542012-09-13T13:53:17Z2012-09-13T13:53:17ZCurrent page URL<div><p>Hi Joel,</p>
<p>Just want to clarify so I can make sure I am following your
question:</p>
<p>You have an XHTML Block that has a Data Definition applied to it
(ie <a href=
"http://www.hannonhill.com/kb/XHTML-Block/index.html">Structured
Data Block</a>) and the block is added to a page. You would like to
access the calling page's path within a Format applied to a
Template Region?</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/187022542012-09-13T14:21:15Z2012-09-13T14:21:15ZCurrent page URL<div><p>That's exactly it. Ideally I'd like the full URL, but even just
the path component would be sufficient.</p></div>Joel Goguentag:help-archives.hannonhill.com,2010-02-09:Comment/187022542012-09-13T15:38:02Z2012-09-13T15:38:02ZCurrent page URL<div><p>Joel, if you apply a <a href=
"http://www.hannonhill.com/kb/Index-Block/index.html#ConceptFAQs">Current
Page Index Block</a> (see FAQ on this page) to the Template Region,
you will have access the calling page's path. For example, in your
Velocity you could obtain this value by using:</p>
<pre>
<code>## Reference the system-page node (ie calling page)
#set ( $thePage = $_XPathTool.selectSingleNode($contentRoot,"//system-page") )
## Output the path value
$thePage.getChild('path').value
## Output the link value, useful for cross-site
$thePage.getChild('link').value</code>
</pre>
<p>Please let me know if you have any questions.</p>
<p>Thanks!</p></div>Ryan Griffithtag:help-archives.hannonhill.com,2010-02-09:Comment/187022542012-09-13T16:20:21Z2012-09-13T16:20:21ZCurrent page URL<div><p>I don't see where I can apply a Data Definition to the index
block, or how I could have the script format getting access to both
the data from the structured block and from the index block. The
closest I've been able to come to getting what I need has been to
create a Folder Index block, but it contains information for all
pages in the folder of the asset it's applied to (I could probably
select only the current page with a XPath query) and I can only see
how to apply one single block to a format but I need the data from
both blocks in the Velocity format.</p>
<p>I'm afraid I'm going to need to ask for step-by-step directions.
I haven't been able to get anywhere close to what I need to
accomplish without using JavaScript to fake the effect. There's got
to be something I'm missing, but nothing is jumping out at me.</p></div>Joel Goguentag:help-archives.hannonhill.com,2010-02-09:Comment/187022542012-09-13T17:39:37Z2012-09-13T17:39:37ZCurrent page URL<div><p>Joel, my apologies if my response caused confusion. Please let
me know if the following steps help:</p>
<ul>
<li>Edit the Data Definition the Page is using</li>
<li>Add a Block Chooser field to the Data Definition, and set the
<em>Render Content Depth</em> option to <strong>4</strong> (this
option is under Advanced)</li>
<li>Edit your Page, and add the XML Block that contains the your
feed information to this new Block Chooser field</li>
<li>Modify the Page's Configuration (either at the Template, Page
or Configuration Set level) and add a <a href=
"http://www.hannonhill.com/kb/Index-Block/index.html#ConceptFAQs">Current
Page Index Block</a> (instructions are under the FAQs) to the
desired region, along with your Format</li>
</ul>
<p>By adding the Block Chooser and the Current Page Index Block,
you are essentially including the content of the XML Block within
your Page's content so you can access it within your Format.</p>
<p>Please let me know if you have any questions.</p>
<p>Thanks</p></div>Ryan Griffith