Copied to clipboard

Flag this post as spam?

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


  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 30, 2011 @ 11:27
    Fuji Kusaka
    0

    Unpublish Nodes

    Is there a way of displaying a message when all nodes are unpublished in a folder??

    //fuji

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 30, 2011 @ 11:42
    Dirk De Grave
    0

    I'm not sure why you'd want this as umbraco greys out all unpublished nodes anyway... so, where should that message go? Bit more info on what you're trying to do may be helpful here.

     

    Cheers,

    /Dirk

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 30, 2011 @ 12:19
    Fuji Kusaka
    0

    Hi Dirk,

    I have this Client who wants us to display a message or even  display an image if ever all the nodes are unpublished or if the folder is empty. We can do this in CSS but i was wondering how this can be achieve with XSLT.

     

    Thanks

    //Fuji

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 30, 2011 @ 12:23
    Dirk De Grave
    0

    Even more confused? you're talking about unpublished nodes and xslt in one sentence? It's just not clear to me what you're trying to do? Have an example or pic which could say more than 1000 words could ever do?

     

    Cheers,

    /Dirk

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 30, 2011 @ 12:52
    Fuji Kusaka
    0

    hmmmm....i have News Folder under which i can react news items and using XSLT to display the items. Now what i was wondering is, is there a way of displaying a message when all the nodes under the News Folder are unpublished or empty.

     

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Jun 30, 2011 @ 13:13
    Dirk De Grave
    1

    if you're using xslt, you're actually working with published content, so you can't know whether all nodes are unpublished, that info is just not available unless you start querying the site using the document api (which is not recommended). However, you can check whether a news folder has 0 zero nodes using the count() function.

    Cheers,

    /Dirk

  • Fuji Kusaka 2203 posts 4220 karma points
    Jun 30, 2011 @ 13:18
    Fuji Kusaka
    0

    Thanks Dirk,

     

    So the best way for me to achieve this is by using Css instead....the count will not be good if the nodes are unpublished.....i will only get the right figure if the news folder is empty.

     

    //fuji

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Jun 30, 2011 @ 13:45
    Tom Fulton
    0

    Hey Fuji - can't you just do a count() in your XSLT and test for it being 0?  Unpublished nodes will never be in the XML cache as Dirk said

    <xsl:if test="count($currentPage/NewsFolder/NewsItem) = 0">
    There are no news items
    </xsl:if>

Please Sign in or register to post replies

Write your reply to:

Draft