Copied to clipboard

Flag this post as spam?

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


  • Max Mumford 266 posts 293 karma points
    Sep 03, 2010 @ 14:28
    Max Mumford
    0

    NodeTypeAlias not finding any posts despite seemingly correct settings..

    The below code is supposed to write down info about each blog post in the "blog" folder (current folder). There are about a hundred entries but nothing is showing up.

    If I change the code by removing the part in bold below it works (of course writing entries for directories as well).

    <xsl:for-each select="$currentPage/descendant-or-self::*[@isDoc] [@nodeTypeAlias = 'umbracoBlogPost' and string(umbracoNaviHide) != '1']">
        <xsl:sort select="@createDate" order="descending"/>
            <xsl:if test="position() &lt;= $numberOfItems">
            <xsl:call-template name="listpost">
                <xsl:with-param name="node" select="."/>
            </xsl:call-template>
            </xsl:if>
        </xsl:for-each>

    The posts in the folder are using a template called "umbracoBlog post". We have a doctype named "Blog Post" with Alias "UmbracoBlogPost" and allowed template is "umbracoBlog post".

    Is this all set up correctly?

    Thanks! Max.

  • Max Mumford 266 posts 293 karma points
    Sep 03, 2010 @ 14:30
    Max Mumford
    0

    btw, new query after edit looks like this:

    <xsl:for-each select="$currentPage/descendant-or-self::*[@isDoc] [string(umbracoNaviHide) != '1']">

  • Max Mumford 266 posts 293 karma points
    Sep 03, 2010 @ 14:32
    Max Mumford
    0

    (also the alias is "umbracoBlogPost" - first letter lower case unlike what I wrote in my first post - typo)

  • Bas Schouten 135 posts 233 karma points
    Sep 03, 2010 @ 14:35
    Bas Schouten
    0

    Hi Max,

    Can you try this?

    <xsl:for-each select="$currentPage/* [name() = string('umbracoBlogPost') and string(umbracoNaviHide) != '1']">

    Bas

  • Max Mumford 266 posts 293 karma points
    Sep 03, 2010 @ 14:43
    Max Mumford
    0

    No luck, still shows nothing :(

  • Max Mumford 266 posts 293 karma points
    Sep 03, 2010 @ 15:23
    Max Mumford
    0

    Thanks for the help though, anybody else have any ideas?

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Sep 03, 2010 @ 15:47
    Chriztian Steinmeier
    0

    Hi Max,

    These are the XPaths you need for the different versions (don't really know if you're on 4.0 or 4.5):

    For version 4.5:

    <xsl:for-each select="$currentPage/descendant-or-self::umbracoBlogPost[not(umbracoNaviHide = 1)]">

    For version 4.0:

    <xsl:for-each select="$currentPage/descendant-or-self::*[@nodeTypeAlias = 'umbracoBlogPost'][not(data[@alias = 'umbracoNaviHide'] = 1)]">

     

    /Chriztian

  • Max Mumford 266 posts 293 karma points
    Sep 03, 2010 @ 16:02
    Max Mumford
    0

    We'r in the process of upgrading from 4.0.4.2 to 4.5 so the new xslt schema has caused a few problems but your solution for 4.5 worked perfectly :) Thanks very much.

Please Sign in or register to post replies

Write your reply to:

Draft