Is there a way to find a property value by its alias, which is stored in a variable (with the new xml schema)?
I don't want to find it like this: $currentPage/aliasName.
I want somwthing similar to the old schema method: $currentPage/data[@alias='aliasName']... and then I'll use the following code (which is correct only for the old schema):
Actually, I knew about the option, but I don't want to use only the old schema, becaause I use the new schema structure in many of my xslt files (and it's very confortable..). I just want to have an option to access a property value when I get its alias as a string...
Hehe, sorry, but I think I'm a little slow this morning, but still don't get it totally I think.
The id that you are talking about. Is this the id on the node, the id on the data type(the ultimate picker) or maybe the id of the selected value in the ultimate picker?
When I create a new datatype of ultimate picker, I am requested to set the id of the node to render. For example: I create a datatype named 'types_ddl', I set the rendered node id to be 1234. now I have a dropdown list which is populated with the children of node 1234. I add this dropdown as a property of a document type. Let's name the porperty 'select_type'.
What I wnat to achieve is the ability to grab the value of 'select_type' its rendered node id(in this case -1234), and not by its name('select_type').
Finding a property value by its alias(in xslt)
Hi,
Is there a way to find a property value by its alias, which is stored in a variable (with the new xml schema)?
I don't want to find it like this: $currentPage/aliasName.
I want somwthing similar to the old schema method: $currentPage/data[@alias='aliasName']... and then I'll use the following code (which is correct only for the old schema):
<xsl:variable name=aliasName select='aliasName' />
$currentPage/data[@alias=$aliasName]
Hi Ben,
One option could be to switch to the old XML schema, even if you use a newer version of Umbraco.
I do not know if you ever knew was possible.
But hope this link may help you further.
http://our.umbraco.org/wiki/reference/xslt/45-xml-schema/switching-between-old-and-new-schema
/Dennis
Hi Ben
With the new schema, the following should work:
/Kim A
Thanks for your reply.
Actually, I knew about the option, but I don't want to use only the old schema, becaause I use the new schema structure in many of my xslt files (and it's very confortable..). I just want to have an option to access a property value when I get its alias as a string...
Ben, did you try the solution I provided?
That should work for the new schema...
/Kim A
Oh, I posted my last comment in a response to Dennis, I didn't see your suggestion.
Seems like it's the solution i'm looking for - I'll check it and I'll let you know. THANKS!
Works fine. Thank you again
Coo, great Ben. I'm glad everything worked out for you :)
/Kim A
By the way, can I access nodes by other properties in a similar way?
for example, by the datatype id
Hmm...I'm not sure I totally understand what you want to do. Can you give us an example?
As far as I'm concerned you can't grab a property from a node by a data type id, if this is what you are trying to achieve.
/Kim A
I try to grab a property(ultimate picker ddl) from a node by the rendered node id
Hehe, sorry, but I think I'm a little slow this morning, but still don't get it totally I think.
The id that you are talking about. Is this the id on the node, the id on the data type(the ultimate picker) or maybe the id of the selected value in the ultimate picker?
Sorry for not understanding it all Ben.
/Kim A
OK, I'll explaine.
When I create a new datatype of ultimate picker, I am requested to set the id of the node to render. For example: I create a datatype named 'types_ddl', I set the rendered node id to be 1234. now I have a dropdown list which is populated with the children of node 1234. I add this dropdown as a property of a document type. Let's name the porperty 'select_type'.
What I wnat to achieve is the ability to grab the value of 'select_type' its rendered node id(in this case -1234), and not by its name('select_type').
Ohh, now I think I know what you want. I haven't heard of anyone doing that stuff - finding a property on a node by using the node ID.
But you can grab the selected values from the UltimatePicker and do stuff with the selected node if you preffer that.
Otherwise I think we need to have some of the other wise guys in here to help you out - Sorry...
/Kim A
is working on a reply...