While the top menu needs to work on all the pages regardless of where you are in the node-tree, I need to create a parameter or variable selecting the TopLevel node (in this case RootOfWeb).
Usually I would do this with the following expression (or something simmiliar):
if I try to return the value of "$root" , nothing happens....
I've also tried replacing current() with $currentPage , but that doesn't help me either ....
also, I do not understand why a simple command like:
doesn't return anything ... I can only get the $currentPage id by adding $currentPage to the select-statement (ie. ="$currentPage/@id" )... and if I add current() instead, nothing happens either ... no return-value ... no error ... just no ouput ... how come?
Let's say I have a sitemap-structure looking alot like the one below.
The menu I'm creating only gives me the childnodes of RootOfWebsite, not the descendants.
I need to set an attribute class="active" on the "Home" link if it self or one of it's children = current(). I'm not sure if you can follow me here ...
the menu would look like this:
[ HOME ] [ Something2 ] [ Something3 ] [ Something4 ] etc.
The "Home" needs to be underlined/active if it self or one of it's childnodes = current() ...
does that make any sense ??
Right now I'm only capable of checking if $currentPage/@id = current()/@id in my for-each loop.
how to retrieve specific node by nodeName?
Hi there..
I'm new to Umbraco, but I've worked with XSLT and another similair CMS.
I need to develop a top menu (I'm currently using the latest release of Umbraco 4).
so far I have a sitemap-structure like this.
[code]
+Content
+RootOfWebsite (redirects to Home)
+Home
+page1
+page2
+page3
+Something2
+page1
+page2
+page3
+Something3
+Something4
+Something5
[/code]
While the top menu needs to work on all the pages regardless of where you are in the node-tree, I need to create a parameter or variable selecting the TopLevel node (in this case RootOfWeb).
Usually I would do this with the following expression (or something simmiliar):
if I try to return the value of "$root" , nothing happens....
I've also tried replacing current() with $currentPage , but that doesn't help me either ....
also, I do not understand why a simple command like:
doesn't return anything ... I can only get the $currentPage id by adding $currentPage to the select-statement (ie. ="$currentPage/@id" )... and if I add current() instead, nothing happens either ... no return-value ... no error ... just no ouput ... how come?
replacing $currentPage with current() actually gave me some output..
but using current() should give me the axact same output ...
How come it doesn't work that way ?!?
Hi,
current() will only work in for-each loops I assume, whereas $currentPage is referring to the complete xml structure for the document being requested.
Other option is to set the top level node id through a parameter in the macro (of type content picker) that references the xslt
and add below statement near the currentPage param
[code][/code]
and use it in
[code]
I assume that would work :)
But it doesn't make sense to me, that current() only works within a for-each loop.
Is there anyway I can retrieve a collection of nodes specified by their "document-type" or template ??
[code]
[/code]
would this return the children of the root-node matching the given template/doctype??
Regards,
Martin.
Hi,
Of course, it's just plain old xpath, just need to know how to build the xpath :p
Here goes for what you're asking...
Regards,
/Dirk
Thanks alot :)
I've encountered a new "problem" ..
Let's say I have a sitemap-structure looking alot like the one below.
The menu I'm creating only gives me the childnodes of RootOfWebsite, not the descendants.
I need to set an attribute class="active" on the "Home" link if it self or one of it's children = current(). I'm not sure if you can follow me here ...
the menu would look like this:
[ HOME ] [ Something2 ] [ Something3 ] [ Something4 ] etc.
The "Home" needs to be underlined/active if it self or one of it's childnodes = current() ...
does that make any sense ??
Right now I'm only capable of checking if $currentPage/@id = current()/@id in my for-each loop.
[code]
+Content
+RootOfWebsite (redirects to Home)
+Home
+page1
+page2
+page3
+Something2
+page1
+page2
+page3
+Something3
+Something4
+Something5
[/code]
[code]
[/code]
correction to the above XML ..
I guess the test should be:
is working on a reply...