tag:help-archives.hannonhill.com,2010-02-09:/discussions/how-do-i/209-add-the-facebook-like-button-iframe-on-cascade-pagesCascade CMS: Discussion 2018-10-18T20:36:05Ztag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-10-21T22:11:19Z2010-10-21T22:11:19ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>I have eventually made this work by using a current page index as a block, and writing the iframe code in the block's format to capture the current page URL.</p></div>Allietag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-10-28T21:56:01Z2010-10-28T21:56:01ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>Hey, I thought I figured this out, but the code does not quite do the job yet.</p>
<p>I want to generate code like this:<br />
<code><iframe src="http://mysite.com/path/to/the/file.html"></iframe></code></p>
<p>I use the following xslt:<br />
<code><xsl:element name="iframe"><xsl:attribute name="src"><xsl:value-of select="path"/></xsl:attribute></xsl:element></code></p>
<p>What I get is:<br />
<code><iframe src="/cascade/basefolder/path/to/the/file"></iframe></code></p>
<p>I can get the desired URL using this:<br />
<code><a href="{path}"> good URL </a></code> -->
<code><a href="http://mysite.com/path/to/the/file.html"> good URL </a></code></p>
<p>What am I doing wrong here? Thanks!</p></div>Allietag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-10-29T14:42:09Z2010-10-29T14:42:09ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>The following code should produce what you are wanting. Something to note is that path will be rewritten correctly on publish with the correct .html extension. The substring bit ensures when the link is rewritten relatively the whole path is output when live, rather than just index.html.<br />
</p>
<pre><code><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="system-index-block">
<xsl:apply-templates select="//calling-page/system-page"/>
</xsl:template>
<xsl:template match="system-page">
<xsl:variable name="nameLength" select="string-length(name)"/>
<xsl:variable name="pathLength" select="string-length(path)-$nameLength"/>
<iframe src="[system-view:external]http://mysite.com[/system-view:external]{substring(path, 1, $pathLength)}[system-asset]{path}[/system-asset]"></iframe>
</xsl:template>
</xsl:stylesheet></code></pre></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-10-29T18:44:42Z2010-10-29T18:44:42ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>Thanks much for this, Penny.<br />
Capturing the file extension remains to be a challenge. Is there a way to address that using Cascade methods? If not, a non-Cascade way? Any thoughts would be appreciated!</p></div>Allietag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-10-29T19:34:25Z2010-10-29T19:34:25ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>Using the [system-asset] tags, the .html should be added at publish time when that tag is recognized. Have you tried publishing this page? If so, what version of Cascade are you working within?</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-11-01T00:49:38Z2010-11-01T00:49:38ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>Thanks, Penny. It works for .html and .shtml - I assume it works for other file extension as well, such as .php. One more question:[system-asset]{path}[/system-asset] captures file name + file extension at publish time - I would expect [system-asset]{name}[/system-asset] generate such result. Thanks again. <br />
</p></div>Allietag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-11-01T14:05:18Z2010-11-01T14:05:18ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>You will want to use path because the system-asset tags will need a valid path to rewrite and add the extension. So [system-asset]name[/system-asset] will not produce a valid path if your page is stored in a sub-folder.</p>
<p>This will work for any extension that you choose to use. It just concatenates the path with whatever extension you have set on your Configurations.</p>
<p>Please let me know if you need further clarification.</p></div>Pennytag:help-archives.hannonhill.com,2010-02-09:Comment/34058642010-11-01T21:41:17Z2010-11-01T21:41:17ZAdd the Facebook Like button (iframe) on Cascade Pages<div><p>Thanks again, Penny!</p></div>Allie