Using
GetCategories() I am able to iterate through all my categories and display
their names and description.However, I
can't seem to get the parent or id of any category.If I use value-of to display either to the
screen, it doesn't display anything and if I try to use an if test on id it
doesn't match what I'm certain the value should be.Apparently id was added to the XSLT in v2.3
Also, the
documentation could do with an update.There is no mention of GetCategoriesFromCSV() in the Word doc.Also, I could really use a
FindCategoryByName() function, which was apparently added in v2.2 but it
doesn't appear to be there.
Apologies, it was not your fault, the documentation was incorrect and showed ID, Parent, Selectable and Enabled as elements of Category rather than attributes.
Your selector using ./id would work if ID was an element but since it's actually an attribute you needed to change this to @id.
Unable to get parent and id values
Categorisation 2.3.1.0
Umbraco 4.7.2
Using XSLT
I'm sure I'm missing something simple hereā¦
Using GetCategories() I am able to iterate through all my categories and display their names and description. However, I can't seem to get the parent or id of any category. If I use value-of to display either to the screen, it doesn't display anything and if I try to use an if test on id it doesn't match what I'm certain the value should be. Apparently id was added to the XSLT in v2.3
Also, the documentation could do with an update. There is no mention of GetCategoriesFromCSV() in the Word doc. Also, I could really use a FindCategoryByName() function, which was apparently added in v2.2 but it doesn't appear to be there.
Think I've answered my own question, prob down to my inexperience with xsl.
While
works,
doesn't, and needs to be
Hi Geoff,
Apologies, it was not your fault, the documentation was incorrect and showed ID, Parent, Selectable and Enabled as elements of Category rather than attributes.
Your selector using ./id would work if ID was an element but since it's actually an attribute you needed to change this to @id.
I've made changes to the documentation here; https://umbracocategories.codeplex.com/documentation
As for the FindCategoryByName() method, there is one here; Auros.Categorisation.Categories.FindCategoryByName()
Glad you managed to solve your problem!
Cheers,
James
is working on a reply...