Copied to clipboard

Flag this post as spam?

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


  • ssalmon 8 posts 27 karma points
    Feb 04, 2009 @ 20:22
    ssalmon
    0

    Umbraco 4 Blog Tags

    Hello

    There is no doubt a really simple answer to the following. I have extracted some techniques from the Umbraco 4 blog using the tags concept into my own blog posts. But I seem to be stuck on using the following for-each:

    [code]$currentPage/node [@nodeTypeAlias = 'Blog' and contains(Exslt.ExsltStrings:lowercase(@alias='tags'), Exslt.ExsltStrings:lowercase($filter))][/code]

    My blog is structed like the following:

    BLOGLIST
    BLOG
    BLOG
    BLOG
    etc

    I have the tags property within my own blog posts. Now why does the above for-each bring back the filtered posts. i.e

    blog.aspx?filterby=xyz

    I would appreciate your help on this folks.

    Ta

    Steven

  • Timsn 121 posts 231 karma points
    Feb 07, 2009 @ 16:30
    Timsn
    0

    Quite the same problem here.
    Can't get the tags to work. I also looked at the blog package for umbraco 4 and tried the code but the for-each loop crashes in my own page.

    [code]
    [/code]

    Maybe someone could explain what this line does
    [code]tagsLib:getTagsFromNode(@id)/tags/tag[/code]
    I don't understand it because my node structure looks something like this:

    [code]

    ]]>


    [/code]

    Just a guess: is tagsLib:getTagsFromNode() umbraco standard? This is the function that doesn't seems to work. The blog package isn't installed anymore.

    Thanks!

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 07, 2009 @ 19:30
    Dirk De Grave
    0

    Hi,

    v4 supports tagging out-of-the-box and values are stored in database and in the published xml (the latter is no longer used...). All xslt extensions from the tagsLib though read from database and build up a 'XPathNodeIterator', making it quite simple to loop through the node set using the available xslt statements.

    No need to install blog package to get tagging working. It works as any other datatype and can be used on any node, regardless of its type (v4 only)

    Code in your post should work. Any error message would be helpful in this case!

    Looking forward to more info.

    Regards,
    /Dirk




  • Timsn 121 posts 231 karma points
    Feb 10, 2009 @ 15:06
    Timsn
    0

    Hmm, the only error message I see is "Error parsing XSLT file: \xslt\ListPosts.xslt".

    The posts were listed and everything else works great until I add this line:
    [code][/code]
    then the xslt crashes.
    My document type contains the "tags" field it needs:
    Name: Tags
    Alias: tags
    Type: Tags

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 10, 2009 @ 15:56
    Dirk De Grave
    0

    Hi Rodriguez,

    How's the complete xslt? It's too less info to judge upon!

    Regards,
    /Dirk

  • Timsn 121 posts 231 karma points
    Feb 10, 2009 @ 16:36
    Timsn
    0

    It's pretty much like the one from the blog package, here it is:

    [code]
    ]>

    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    xmlns:tagsLib="urn:tagsLib"
    xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
    exclude-result-prefixes="msxml umbraco.library tagsLib Exslt.ExsltStrings">
































    [/code]

  • Timsn 121 posts 231 karma points
    Feb 11, 2009 @ 13:59
    Timsn
    0

    I setup a new umbraco installation and tried the xslt again.
    With saving the xslt file a error occurs:

    [quote]System.Xml.Xsl.XslTransformException: Cannot find the script or external object that implements prefix 'urn:tagsLib'.
    at System.Xml.Xsl.Runtime.XmlQueryContext.InvokeXsltLateBoundFunction(String name, String namespaceUri, IList`1[] args)
    at (XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Root(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at Execute(XmlQueryRuntime {urn:schemas-microsoft-com:xslt-debug}runtime)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlSequenceWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(Object defaultDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter writer, Boolean closeWriter)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, XmlWriter results)
    at System.Xml.Xsl.XmlILCommand.Execute(IXPathNavigable contextDocument, XmlResolver dataSources, XsltArgumentList argumentList, TextWriter results)
    at System.Xml.Xsl.XslCompiledTransform.Transform(IXPathNavigable input, XsltArgumentList arguments, TextWriter results)
    at umbraco.presentation.webservices.codeEditorSave.SaveXslt(String fileName, String oldName, String fileContents, Boolean ignoreDebugging)[/quote]

    maybe the tagslib library isn't correctly registered or something.

    here's my test xslt

    [code]
    ]>
    <>
    version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxml="urn:schemas-microsoft-com:xslt"
    xmlns:umbraco.library="urn:umbraco.library"
    xmlns:tagsLib="urn:tagsLib"
    xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings"
    exclude-result-prefixes="msxml umbraco.library tagsLib Exslt.ExsltStrings">








    [/code]


    EDIT:

    After installing the blog package, the short test xslt from above could be saved without any errors and it works!
    My question is now, how can I use the tagslib without installing the blogpackage? I thought it can be used without it.

    EDIT 2:
    Problem solved.
    To use the tagsLib code in your xslt you need to add it's xslt extension into the xsltExtenstions.config file.

  • Garry Bain 149 posts 124 karma points
    Feb 18, 2009 @ 14:57
    Garry Bain
    0

    "To use the tagsLib code in your xslt you need to add it's xslt extension into the xsltExtenstions.config file."

    Hi,

    how would you do this? I'm currently getting a similar error message trying to avoid messages like : Error parsing XSLT file: \xslt\BlogListPosts.xslt

    These are showing straight "out of the box" with the blog4umbraco package - I think this may solve it.

    Regards, Garry.

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 18, 2009 @ 15:18
    Dirk De Grave
    0

    HI,

    I've once posted a short how-to at registering tagsLib as xslt extenions. I'll check if I can find it here...

    Regards,
    /Dirk

  • Dirk De Grave 4541 posts 6021 karma points MVP 3x admin c-trib
    Feb 18, 2009 @ 15:20
    Dirk De Grave
    0

    Found it: http://forum.umbraco.org/yafpostst6847Tags-and-v4.aspx

    Regards,
    /Dirk

  • Garry Bain 149 posts 124 karma points
    Feb 18, 2009 @ 15:39
    Garry Bain
    0

    Cheers Dirk, I just had to simply add the



    To my extentions in config/xsltExtentions.config and it worked, thanks very much, Garry.

  • inksterd 2 posts 20 karma points
    May 14, 2009 @ 07:22
    inksterd
    0

    You might also need this entry, as well, to make the comments work ...



    ... I did.

Please Sign in or register to post replies

Write your reply to:

Draft