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
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.
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!
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
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.
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
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!
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
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
Hi Rodriguez,
How's the complete xslt? It's too less info to judge upon!
Regards,
/Dirk
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]
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.
"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.
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
Found it: http://forum.umbraco.org/yafpostst6847Tags-and-v4.aspx
Regards,
/Dirk
Cheers Dirk, I just had to simply add the
To my extentions in config/xsltExtentions.config and it worked, thanks very much, Garry.
You might also need this entry, as well, to make the comments work ...
... I did.
is working on a reply...