I have a document type called venue which has a property called venueFeatures and that is of a custom data type that I created also called Venue Features (id=1133). It holds a list of prevalues such as
Text Value
VIP Upgrade 101
WI-FI Access 102
etc
what I am trying to do in my code is.... If the checkbox value for wifi access is selected then I want to show the list item and apply the styles but if it is not checked i want it to reamin hiddden.
I have tried the following but had no luck and was wondering if you can help please?
If I remember correct, the GetPreValues() extension just gives you the aliases ids and their corresponding text values (e.g., <preValue alias="102">Wi-Fi Access</preValue><preValue id="102">Wi-Fi Access</preValue>) - so you can't know if it's checked there.
If the venueFeatures property is configured to store the ids (aliases) you'll need to use the Split() extension to check that - but you might as well hardcode the Wifi ID, something like this (and if you need to "sync" the WiFi text shown, you can use the GetPreValues() extension to get the text for the wifi item):
Oh, and if this doesn't work at all, I apologize in advance, as it's completely made up from memory (fingers crossed :) - it should show you the basics of how to use these extensions, though...
EDIT:Changed to use id instead of alias as first assumed.
Just checked the wiki... couldn't for the life of me figure out why they'd used alias attributes for those — turns out they didn't; they're id attributes, so the updated code should be:
So the venueFeatures are not showing anywhere - which means that either the property isn't called that (check the casing), you're testing on a page that hasn't got any features selected or you're testing a page that hasn't got the property at all...
Select a specific check box item and display it
Hello all,
Yet again another xslt hurdle!
I have a document type called venue which has a property called venueFeatures and that is of a custom data type that I created also called Venue Features (id=1133). It holds a list of prevalues such as
Text Value
VIP Upgrade 101
WI-FI Access 102
etc
what I am trying to do in my code is.... If the checkbox value for wifi access is selected then I want to show the list item and apply the styles but if it is not checked i want it to reamin hiddden.
I have tried the following but had no luck and was wondering if you can help please?
I have done and it displays all the items in the datatype so i know im targeting the right thing.
Been search around but no luck so Any help would be awesome please.
Paul
Hi Paul,
If I remember correct, the
GetPreValues()
extension just gives you thealiasesids and their corresponding text values (e.g.,<preValue alias="102">Wi-Fi Access</preValue><preValue id="102">Wi-Fi Access</preValue>
) - so you can't know if it's checked there.If the venueFeatures property is configured to store the ids
(aliases)you'll need to use the Split() extension to check that - but you might as well hardcode the Wifi ID, something like this (and if you need to "sync" the WiFi text shown, you can use theGetPreValues()
extension to get the text for the wifi item):Oh, and if this doesn't work at all, I apologize in advance, as it's completely made up from memory (fingers crossed :) - it should show you the basics of how to use these extensions, though...
EDIT: Changed to use id instead of alias as first assumed.
/Chriztian
Hi Christian,
Thanks for your input mate. Ive been trying to do it with the help you provided but no luck just yet.
I will let you know ;)
Thanks
Paul
Aha!
Just checked the wiki... couldn't for the life of me figure out why they'd used alias attributes for those — turns out they didn't; they're id attributes, so the updated code should be:
That should at least fix some of it...
/Chriztian
Ok tried it with @id instead but doesnt seem to be working either!
hmmmm maybe its something ive done. but i also tried copying and pasting your code too.
Ill keep tyring ;)
Thanks mate
Paul
OK,
First thing:
Copy the output of venueFeatures and the call to
GetPreValues()
to a textarea to do some sanity-checking:Then we'll figure out what's going on...
/Chriztian
Hi
Here are the results from the test!
also the results from testing the variable values
Using the @id fetches back the correct values for $wiFiText and $wifiAlias
Cheers mate
Paul
Okay - great,
So the venueFeatures are not showing anywhere - which means that either the property isn't called that (check the casing), you're testing on a page that hasn't got any features selected or you're testing a page that hasn't got the property at all...
/Chriztian
Hi Chriztian,
I know have some values showing i think my logic is wrong somewhere.
I will have a look into it and be in touch.
Thnaks for your help again
Paul
is working on a reply...