Copied to clipboard

Flag this post as spam?

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


  • Mikael Syska 24 posts 91 karma points
    Oct 18, 2009 @ 01:28
    Mikael Syska
    0

    Specify default page to be loaded.

    Hi,

    I'm new to umbraco ... so this might be a easy thing.

    I have some content like this:

    • Content
    • * MySite
    • ** News
    • *** First news
    • *** Second news
    • ** Contact

    The stars in the structure above note the level ...

    The news page uses a macro to print the news ... it works great. But when I use the same Template for the "MySite", ofcause it dont work, since it now parses the "News/Contact" as the 2 nodes, instead of "First news/Second news" as the 2 nodes.

    So ... other than specify absuloute path in the XLTS file to get the news items, what can I do ?

    I want the MySite/News page to be 100% the same ... so other work arounds are also welcome ...

  • skiltz 501 posts 701 karma points
    Oct 18, 2009 @ 01:43
    skiltz
    0

    Crate a new XSLT file and take a look at the "List Sub Pages from a Changleable Source" template in the dropdownlist.  This wil allow you to specify the nodeid to which to load the "news" from.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Oct 18, 2009 @ 02:07
    Kim Andersen
    0

    So actually you want to list all news items on your site, on "MySite" and "News", right?

     

    If that is what you want, you can with XSLT, show all items with a certain template. I guess that all of your news-nodes have a special template?

    If this is what you want you can use this XSLT:

     

    <xsl:for-each select="$currentPage//node[@template='the_templateID']">
    ---do something---
    </xsl:for-each>

    Remember to change the_templateID with the actual ID number. Well, I hope this gives you an idea of how it could be solved. And if you don't know anything about XSLT, speak up, and we will find a solution for this as well :)

  • Mikael Syska 24 posts 91 karma points
    Oct 18, 2009 @ 04:01
    Mikael Syska
    0

    Hi,

    2 possible solutions ...

    Its darn late here now so I guess I will return tomorrow when I have tried both suggestions.

    Kim: Yes, I want the 2 pages to act like the same page.
    Atm I'm doing all markup in the XSLT files ... which can't be the best option. I read somewhere you could specify a template to use with the node in the XSLT file ... or do I remember wrong.

    I have the following Document types:

    • News area - where the news list are shown. this could probebly be removed, I'm still learning. But its the document type for the "News"
    • News item - A news item
    • News comment

    Each got a template ... except "News comment" since it would be odd to display a single comment on a page.

    So ... the template_id in the number written in the browsers "status bar" ?

    I'm very very newbie at XSLT, but most of the stuff until now I have been able to google :-) but if you got any good resources, please do share them with me :-)

    btw. Denmark rox. ( Mostly a comment to Kim Andersen )

    Skiltz:
    Yours are the most easy to implement so for starter I will try yours ... still learning here ... so great with more opinions on every thing.

    Thanks both.

  • Kim Andersen 1447 posts 2196 karma points MVP
    Oct 18, 2009 @ 14:47
    Kim Andersen
    1

    Hi Mikael

     

    You'll find the tempalte id when you hover over the template in the Settings-section. when you hover over a template in the list of all your templates, you can see the id in the bottom of your browser, where it says: javascript:openTemplate(1047);

    In the above example, 1047 is the tempalte id :)

     

    But you could try out Skiltz's solutions first, and if that works, everything is good :)

  • Mikael Syska 24 posts 91 karma points
    Oct 18, 2009 @ 19:41
    Mikael Syska
    0

    Used the template answer for it. Seemed like the best option.

    I would have marked both as an option, but its not possible to. I can't mark an answer as helpful, cause I dont have enough karma yet.

    mvh

Please Sign in or register to post replies

Write your reply to:

Draft