Copied to clipboard

Flag this post as spam?

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


  • TaoistTotty 246 posts 314 karma points
    Mar 25, 2010 @ 20:37
    TaoistTotty
    0

    Blog entry list selected highlighted

    I am using Umbraco 4.0.3 and am trying to get the list of blog posts to show which one is currently being shown (e.g. by a colour change).

     

    Is there an easy way of doing this?

     

    Thanks in advance.

  • Petr Snobelt 923 posts 1534 karma points
    Mar 25, 2010 @ 21:35
    Petr Snobelt
    0

    In xslt compare post id with $currentPage/@id and then set for example different class to link or whatever.

    P.

     

  • Jan Skovgaard 11258 posts 23500 karma points MVP 7x admin c-trib
    Mar 25, 2010 @ 22:43
    Jan Skovgaard
    0

    Hi TaoistTrotty

    If I have understood correctly I think you should be able to set a class on the post currently being shown like Petr is suggesting. In fact I think you can even use this snippet from the "navigation prototype" XSLT in Umbraco.


                <xsl:if test="$currentPage/ancestor-or-self::node/@id = current()/@id">
                    <!-- we're under the item - you can do your own styling here -->
                    <xsl:attribute name="class"><xsl:text>active</xsl:text></xsl:attribute>
                </xsl:if>

    This sets the a class named "active" to the currently viewed post.

    /Jan

  • TaoistTotty 246 posts 314 karma points
    Mar 26, 2010 @ 14:14
    TaoistTotty
    0

    Petr, this worked thanks.

    It does not work on the first Blog page (probably due to this pulling in page(s) from the individual blog pages.

    Is there a way around this?

    Many thanks.

    Michael

  • TaoistTotty 246 posts 314 karma points
    Mar 26, 2010 @ 14:52
    TaoistTotty
    0

    Jan, Thank you for your suggestion.

    This also works.

    Regards

    TT

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies