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.
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
You will need to make a call to select all decendants of the home page with the given documentTypeAlias of the News Item.
Replace NewsItem with whatever the exact alias is for a news item is in CWS.
-Chris
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.
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
Thanks for all answers!
It's working now.
Miguel
is working on a reply...