I have this in a template. I would like the timeout value to be user defined so I have create a property - delay - in the document which uses this template
I think I would install the XSLToJson package and then use it to create a XSLT macro, which can return the value to you in a json object.
1) Install the package and understand how it works 2) Create a XSLT macro, which you insert into a alternative template called something like "sliderSettings". 3) Either make an ajax call to the "sliderSettings" template like http://www.mydomain.com/sliderSettings.aspx or simply just make a script reference to the page 4) Fetch the value from the JSON object
How to use Document property in javascript
Hi
I have this in a template. I would like the timeout value to be user defined so I have create a property - delay - in the document which uses this template
I have tried with
but that just spoils my slideshow. How can I do it?
/Paul S
Hi Paul
This is just from the top of my head...
I think I would install the XSLToJson package and then use it to create a XSLT macro, which can return the value to you in a json object.
1) Install the package and understand how it works
2) Create a XSLT macro, which you insert into a alternative template called something like "sliderSettings".
3) Either make an ajax call to the "sliderSettings" template like http://www.mydomain.com/sliderSettings.aspx or simply just make a script reference to the page
4) Fetch the value from the JSON object
I supose you could perhaps also use Razor to return the JSON for you. Perhaps you can get some inspiration from this blogpost by Sebastiaan Janssen: http://cultiv.nl/blog/2011/7/25/razor-vs-base-to-output-json-in-umbraco/
And finally you could maybe also just use /base to get the JSON - Seb has written about that too: http://cultiv.nl/blog/2010/10/12/using-base-to-create-and-consume-a-json-string/
Hope this helps.
/Jan
is working on a reply...