How can I force a macro to run when exposed via a content picker? Options
Shaun
Posted: Tuesday, November 04, 2008 10:38:49 AM

Rank: Newbie

Joined: 10/9/2008
Posts: 16
Location: Leeds
I have a content picker that I'm using on my homepage to display a selected article from within the site.

Most of the time it works fine, and I can expose all the various parameters of my article document type.

However. If my users embed a youtube video in the article (by placing a macro I've written into the rich text editor) it doesn't display on the homepage.

Instead I get what appears to be the actual umbraco code in html form.

I should note that my macro works fine if I access the article directly, it only fails when accessing the article via the content picker.

I'm totally stumped, can any kind soul point me in the right direction?
Shaun
Posted: Monday, November 17, 2008 12:25:24 PM

Rank: Newbie

Joined: 10/9/2008
Posts: 16
Location: Leeds
I'm bumping this coz I'm still stuck with it. Is this just a bug in Umbraco?
drobar
Posted: Monday, November 17, 2008 5:01:00 PM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,831
Location: MA, USA
Can you give us an example of the output you get? That might help.

Also, when you pick an article to display on the homepage, what are you using in your template or macro to display it? If an xsl:value-of, you might add the disable-output-escaping="yes" flag.

cheers,
doug.

MVP 2007-2009 - Percipient Studios
Shaun
Posted: Monday, November 24, 2008 12:53:26 PM

Rank: Newbie

Joined: 10/9/2008
Posts: 16
Location: Leeds
Hi Drobar.

I have a macro called Youtube, this is the macro that users can select and embed in the rte editor. It is as follows.

Code:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
<xsl:stylesheet
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    exclude-result-prefixes="msxml umbraco.library">

<xsl:output method="xml" omit-xml-declaration="yes" />

<!-- Input the documenttype you want here -->
<xsl:variable name="videoSti" select="/macro/videoSti"/>

<xsl:template match="/">
<!-- start writing XSLT -->

<xsl:value-of select="$videoSti" disable-output-escaping="yes"/>

</xsl:template>

</xsl:stylesheet>



It takes the embed code from the youtube site and displays it correctly on the article page.

The article is referenced on the homepage using another macro called "display featured item". The macro for that is as follows

Code:

<a href="{umbraco.library:NiceUrl($currentPage/data [@alias = 'featuredItem'])}">
        <xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/data [@alias = 'featuredItem'])/@nodeName" />
      </a>
      <br/>
      <xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/data [@alias = 'featuredItem'])/data [@alias = 'articleStrapline']" disable-output-escaping="yes" />
      <xsl:value-of select="umbraco.library:GetXmlNodeById($currentPage/data [@alias = 'featuredItem'])/data [@alias = 'bodyText']" disable-output-escaping="yes" />


The element of the article that contains my video is the bodyText element.

Any other text or images in the bodyText element displays correctly, but when I look at the source of the page my video looks like this.

Code:

<?UMBRACO_MACRO videoSti="&lt;object width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/20PQBtyfNZY&amp;hl=en&amp;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/20PQBtyfNZY&amp;hl=en&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;" macroAlias="YouTube" />


Any help you can give would be great!
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.