We are trying to use Xpath to select the folder a user will start at when using a multi-node tree picker in umbraco 7.1.9
--> Home
-----> Your Product
----------> Child 1
----------> Child 2
-----> Other Top Level Node
If the node doctype is ProductPage and the name of it is Your Product:
/root/Home/ProductPage allows us to select the specific doctype.
However as this doctype will be changing in future, but keeping the same name we need to be able to select on the string 'Your Product'.
None of the options we have tried seem to work, even those based off other projects that are in different versions of umbraco, e.g. $site//descendant::*[@isDoc][name = 'Your Product'] which is based off a query that works in umbraco 7.5.3.
Xpath query by node name in Umbraco 7.1.9
Hi,
We are trying to use Xpath to select the folder a user will start at when using a multi-node tree picker in umbraco 7.1.9
--> Home -----> Your Product ----------> Child 1 ----------> Child 2 -----> Other Top Level Node
If the node doctype is
ProductPage
and the name of it isYour Product
:/root/Home/ProductPage
allows us to select the specific doctype.However as this doctype will be changing in future, but keeping the same name we need to be able to select on the string 'Your Product'.
None of the options we have tried seem to work, even those based off other projects that are in different versions of umbraco, e.g.
$site//descendant::*[@isDoc][name = 'Your Product']
which is based off a query that works in umbraco 7.5.3.Does anyone know how to solve this?
Hi Ella,
You say the node type is changing in the future. The best option is to change your xpath when this happens.
Because doing this on name is even less save. The name of item can be changed by editors and that will break your xpath query as well.
You can instruct your editors not to change the name, but at some point they will..Trust me
Dave
Hi,
To pick up an old thread - but because I needed similar and probably will need my own answer in the future... you need @nodeName
$root/configuration/configuration[@nodeName ="Blog Filter 1"]
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.