Copied to clipboard

Flag this post as spam?

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


  • Mike Joseph 9 posts 29 karma points
    Sep 26, 2011 @ 17:37
    Mike Joseph
    0

    Tweaking Business Starter Kit - Trouble having Top News Stories display on all pages

    Hi all -

    I'm a bit new to Umbraco, but I think it's one of the better CMS systems I've worked with in a long time, especially in regards to extendability. I installed Umbraco using the "Business Site" starter kit, which shipped with Umbraco and obviously need to tweak things to meet my client/design needs. One of the things I've been trying to do is to make the Top News items show up on every page instead of just the home page. So I simply tried moving the following line of code from umbBusinessHomePage.master to umbMaster.master:

    <umbraco:macro id="Macro3" numberofitems="4" excerptlength="90" alias="umbBusinessFrontpageNews" runat="server"></umbraco:macro>

    However, the Latest News stories only seem to show up on the Home Page, which is using the template "Business Homepage", but on all other pages, using other templates, it's not showing up... So I'm guessing I need to wire up the umbBusinessFrontpageNews macro to work with either the base masterpage template or with all other templates in my site, but I'm having trouble figuring out how to do this. Can anyone point me in the right direction?

    Many thanks!

    Mike

  • Justin Spradlin 139 posts 347 karma points
    Sep 26, 2011 @ 18:58
    Justin Spradlin
    0

    I can't remember exactly, but I think that you will have to modify the xslt for the macro. I belive that select statement to get the news articles is doing something like currentPage::AncestorOrSelf. So instead you could update the XPath to get \\umbNewArticle\* to get a list of all news articles regardless of current node path. 

    I am not in front of a site with that template, but I remember having to do something similar when I updated my site using that starter kit. 

    Let me know if you need more information, and I will try to find more details this evening. 

    Cheers,

    Justin

  • Mike Joseph 9 posts 29 karma points
    Sep 26, 2011 @ 19:01
    Mike Joseph
    0

    Thanks, Justin. You are exactly right. I changed a line in xslt/umbBusinessFrontPageNews.xslt

    From this:

    <xsl:for-each select="$currentPage/umbNewsArea/umbNewsArticle [@isDoc and string(umbracoNaviHide) != '1']">

    To this:

    <xsl:for-each select="$currentPage/ancestor-or-self::* [@level = 1]//* [name() = 'umbNewsArticle']">

    Thanks again!! The community support has been great!

  • Justin Spradlin 139 posts 347 karma points
    Sep 26, 2011 @ 19:05
    Justin Spradlin
    0

    That's great. I am new to umbraco too, (only picked it up in the last few months) and the community has been great. There are some great package editors and they are really friendly and quick to help. 

     

    Good luck with your site!

Please Sign in or register to post replies

Write your reply to:

Draft