Copied to clipboard

Flag this post as spam?

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


  • Miguel Henriques 5 posts 25 karma points
    Oct 01, 2009 @ 01:06
    Miguel Henriques
    0

    Getting the same news from two diffent pages

    Hi,

    I'm trying to do my first web site in umbraco. I have installed the Creative Website Starter and I am using the news and events xslt/macro. I had no problem creating a news page to hold all news but now I would like to have the last three also at the home page. Because each news is a node of the news page, they are not acessible from the homepage!

    As far as I understand from the code, the line <xsl:for-each select="$currentPage/node"> used at the xslt is getting all the nodes of the current (news) page. If I use this macro at the homepage, it will bring me all the nodes of it, not the nodes of the news page.

    I guess this should be easy!

    Thanks for any help,

    Miguel

  • Chris Dunn 75 posts 127 karma points
    Oct 01, 2009 @ 01:24
    Chris Dunn
    0

     

    You will need to make a call to select all decendants of the home page with the given documentTypeAlias of the News Item.

    <xsl:for-each select="$currentPage/descendant::node [@nodeTypeAlias = 'NewsItem'">

    Replace NewsItem with whatever the exact alias is for a news item is in CWS.

    -Chris

     

  • bob baty-barr 1180 posts 1294 karma points MVP
    Oct 01, 2009 @ 02:38
    bob baty-barr
    0

    you can access the content from ANYWHERE in your site if you access it in this way...

    <xsl:for-each select="umbraco.library:GetXmlAll()//node[@nodeTypeAlias = 'yourNewsItemAlias' ]">

    do some stuff

    </xsl:for-each>

    i use this syntax quite often to list items of certain types - hope it helps.

  • Finn 86 posts 50 karma points
    Oct 01, 2009 @ 22:13
    Finn
    0

    Hi Miguel

    You can find a lot of the information you need from this old post: http://forum.umbraco.org/yaf_postst7908_Making-a-newslist.aspx

    Hope it helps you further.

    /Finn

  • Miguel Henriques 5 posts 25 karma points
    Oct 01, 2009 @ 23:32
    Miguel Henriques
    0

    Thanks for all answers!

    It's working now.

    Miguel

Please Sign in or register to post replies

Write your reply to:

Draft