sali0023

Atom Feed

Vote 0 Votes

Hi! I'm not sure if this is the place to ask, this might be more of an XSLT question than a movable type question but if anyone happens to know I'd be eternally grateful.

I am using the atom feed from my movable type blog to put my blog posts on my website. There are two things going wrong the first (less pressing because I have come up with a makeshift solution)

The entire blog is being pulled onto the webpage, the body and the extended it is being pulled by 'atom:content' (code below). I only want the body to be pulled. But the real problem is that the title link/arrow link at bottom are not linking back to the blog, they just refresh the webpage like they are going nowhere or to the page they are one. These links are being pulled from 'atom:storylink' (code below). Do you have any idea what I'm doing wrong? Thank you.

<xsl:template match="/atom:feed">

<xsl:for-each select="atom:entry">
<xsl:if test="position() < 4">

<h3><a><xsl:attribute name="href"><xsl:value-of select = "atom:storylink" /></xsl:attribute><xsl:value-of select="atom:title"/></a></h3>
<p><strong>Posted:</strong><xsl:text> </xsl:text> <xsl:value-of select="atom:published"/><br />
<xsl:value-of select="atom:content" disable-output-escaping="yes" />

<span class="raquo"><a><xsl:attribute name="href"><xsl:value-of select = "atom:storylink" /></xsl:attribute><xsl:text disable-output-escaping="yes"><![CDATA[»]]></xsl:text></a></span></p>


</xsl:if>
</xsl:for-each>
</xsl:template>

Reported on Movable Type 4.3

3 Replies

| Add a Reply
  • Hi Sali,

    You could edit your atom feed, or eventually create a clone of it for being used for this XSL template, and keep the default atom feed for other stuff (i.e. feedburner or other scopes).

    The edit that you could make for taking away the extended part of the post, is to remove:

    <$mt:EntryMore encode_xml="1"$>

    As for the story link, I am not very clear what would you expect from "atom:storylink".

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Daily Movable Type Consultant

    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/

  • Thank you, that was just what I needed for the xml file to make sense to me.

    I can't image anyone else would have this problem as the problem is clearly me not understanding xml very well BUT if someone finds the titles of your feed from your movable type blog are not linking back to the blog you could add the code below to the xml and link to <atom:storylink> in your xslt:

    <storylink type="text/html" xml:lang="<$mt:BlogLanguage ietf="1"$>" xml:base="<$mt:BlogURL encode_xml="1"$>">
            <$mt:EntryPermalink encode_xml="1"$>
        </storylink>
    
  • That makes sense, Sali!

    You're welcome!

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012