Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Streety 358 posts 568 karma points
    Jan 26, 2011 @ 12:03
    Streety
    0

    Get News Articles within a Content Panel

    Hello,

    Is there anyway I can get the latest 2 news Items in a News Content Panel.

    I have tried to modify the ArticleList XSLT script but it doesn't return anything.

    Any ideas?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Jan 26, 2011 @ 12:16
    Jan Skovgaard
    0

    Hi Streety

    Can you perhaps show us the XSLT, which you have tried to modify?

    /Jan

  • Streety 358 posts 568 karma points
    Jan 26, 2011 @ 12:42
    Streety
    0

    I don't know what I am doing wrong here. I just don't get anything back.

     

    Even a simple:

    <ul>
    <xsl:for-each select="$currentPage/node">
    <li><xsl:value-of select="current()/@nodeName"/></li>
    </xsl:for-each>
    </ul>

    returns nothing.

     

  • Streety 358 posts 568 karma points
    Jan 26, 2011 @ 12:46
    Streety
    0

    It seems that I am doing something fundamentally wrong or a setting in the web.config or something.

    Not sure if its the starter kit config. Whilst the starter kit is great to get going and as a learning tool I am struggling to modify basic XSLT which I have done in other Umbraco Websites.

     

    I am getting this behavour with the ArticleList and Navigation xslt scripts.

    Very odd.

  • Stuart Burrows 61 posts 110 karma points
    Jan 26, 2011 @ 12:51
    Stuart Burrows
    1

    Might be way off here but are you using the correct xml schema?

    Does this work:

    <ul>
    <xsl:for-each select="$currentPage/*">
    <li><xsl:value-of select="@nodeName"/></li>
    </xsl:for-each>
    </ul>
  • Streety 358 posts 568 karma points
    Jan 26, 2011 @ 12:56
    Streety
    0

    Yes that worked

  • Stuart Burrows 61 posts 110 karma points
    Jan 26, 2011 @ 12:59
    Stuart Burrows
    1

    Excellent!

    Here is a resource that should help you from this point:

    http://our.umbraco.org/wiki/reference/xslt/45-xml-schema

    Here you can find tools to convert to the new 4.5 schema, read up about it, or set up your site to use the old 4.0 schema instead.

    Regards,

    Stuart

  • Streety 358 posts 568 karma points
    Jan 26, 2011 @ 13:01
    Streety
    0

    I don't get this.

    Its a vanilla  4.5.2 installation (net3.5)

     

    Wouldn't it come with the correct schema?

  • Streety 358 posts 568 karma points
    Jan 26, 2011 @ 13:22
    Streety
    0

    I see the error in my old statements.

    Thank you Stuart

  • Stuart Burrows 61 posts 110 karma points
    Jan 26, 2011 @ 13:52
    Stuart Burrows
    0

    Glad you got it sorted Streety!

    My understanding is that all versions of Umbraco from 4.5 up use the new schema by default

    Regards,
    Stuart

Please Sign in or register to post replies

Write your reply to:

Draft