but now I would like to write the textstring so I both can specify caption and the coordinates and then split the data into an variable.
I'm not sure how the best pratice would be the wrap the attrubutes.. or perhaps better to write as a xml like this for each caption in the input field: <caption><title>Webshop</title><data-x>600</data-x><data-y>230</data-y><data-transition>wipeRight</data-transition></caption>
So I want to have a variable with a node-set and to access each of there values something like this:
Regarding the use of colon in attribute names: This is a "classic" XML thing — element and attribute names consist of a prefix and a local name, e.g., all the XSLT instructions start with "xsl:" - to generate attributes with a prefixed name, all you need to do is to declare the prefix somewhere before you use it, like at the top of the file.
If iView doesn't give you a Namespace URI to use, feel free to make one up:
Regarding the second part - think very hard about the Umbraco side of things, e.g.: I'd much rather tab my way through 6 fields on a document, than have to remember how to input those 6 fields into the same text field with brackets and all... AND you'd have the simpler XML built for you right away, no need to split (which you have to test thoroughly).
Thanks for your help.. yes I had used these namespace URI before with facebook, addthis etv.. but didn't know about how to declare your own prefixed names. it works as intended..
Yes, I am aware that it has to be written in a correct pattern, but the caption title and the attributes are kept in same line.. but it's a bit difficult to split the string into the right parts and there must be used a delimiter, which not occurs in e.g. the title which might contains comma.
I think you're right about it would be better to define 6 properties and get these values.. then the only thing to keep in mind, is the position of each field.. so if I use Multiple Textstring datatype to these properties, the first value should be related to the first values in the other properties.
The best choice would of course be to build a custom data type for it, but I think you should check out some of the existing "compound" data types (Embedded Content, DataType Grid etc.). They're all trying to solve this kind of problem - some does it better than others, though :-)
So now you don't really need the $captionxml variable anymore - you could just create a separate template for the slideCaption property and use that (if you like), something like this:
Actually I would like to use diffent templates in the slideshow layout too... where some slides use images and other slides might contains a video, like the top example here: http://iprodev.com/iview/index2.html
so I want to check i the property youTubeVideoId is empty, if not it should use a video template. and then apply the slideCaption to the video and image templates or should it be applied to template which match "/" ..?
But it would probably be better to use templates, so it's easy to manage different layout for each slide. In the template match="/" should apply-templates select the full xml for the slide variable?
Add HTML5 data attributes and split textstring
Hi..
I'm using a jQuery slider, http://iprodev.com/2012/07/iview/ , which use HTML5 data attributes .. e.g. to link to the image e.g. data-iview:image="photos/photo1.jpg", https://github.com/iprodev/iView/blob/master/index.html
but it gives me an error, when using semicolon in the atrribute.. how can I solve this?
Furthermore I am using the multiple textstring datatype, http://ucomponents.codeplex.com/wikipage?title=MultipleTextstring&referringTitle=Documentation , which is included in Umbraco v. 4.8.0 to add captions..
but now I would like to write the textstring so I both can specify caption and the coordinates and then split the data into an variable.
I'm not sure how the best pratice would be the wrap the attrubutes.. or perhaps better to write as a xml like this for each caption in the input field:
<caption><title>Webshop</title><data-x>600</data-x><data-y>230</data-y><data-transition>wipeRight</data-transition></caption>
So I want to have a variable with a node-set and to access each of there values something like this:
/Bjarne
Hi Bjarne,
Regarding the use of colon in attribute names: This is a "classic" XML thing — element and attribute names consist of a prefix and a local name, e.g., all the XSLT instructions start with "xsl:" - to generate attributes with a prefixed name, all you need to do is to declare the prefix somewhere before you use it, like at the top of the file.
If iView doesn't give you a Namespace URI to use, feel free to make one up:
Regarding the second part - think very hard about the Umbraco side of things, e.g.: I'd much rather tab my way through 6 fields on a document, than have to remember how to input those 6 fields into the same text field with brackets and all... AND you'd have the simpler XML built for you right away, no need to split (which you have to test thoroughly).
/Chriztian
Hi Chriztian
Thanks for your help.. yes I had used these namespace URI before with facebook, addthis etv.. but didn't know about how to declare your own prefixed names. it works as intended..
Yes, I am aware that it has to be written in a correct pattern, but the caption title and the attributes are kept in same line.. but it's a bit difficult to split the string into the right parts and there must be used a delimiter, which not occurs in e.g. the title which might contains comma.
I think you're right about it would be better to define 6 properties and get these values.. then the only thing to keep in mind, is the position of each field.. so if I use Multiple Textstring datatype to these properties, the first value should be related to the first values in the other properties.
/Bjarne
Hi Bjarne,
The best choice would of course be to build a custom data type for it, but I think you should check out some of the existing "compound" data types (Embedded Content, DataType Grid etc.). They're all trying to solve this kind of problem - some does it better than others, though :-)
/Chriztian
Hi Chriztian
I first tried with Multiple Textstring, but when mentioned Data Grid I tried it instead, which also relate title, coordinates, transitons together..
I wrote a captions variable and could then easy access the properties..
/Bjarne
Hi Bjarne,
Cool - much better (I think :-)
So now you don't really need the $captionxml variable anymore - you could just create a separate template for the slideCaption property and use that (if you like), something like this:
That's of course entirely up to you :-)
/Chriztian
Hi Chriztian
Yes, that is an idea :)
Actually I would like to use diffent templates in the slideshow layout too... where some slides use images and other slides might contains a video, like the top example here: http://iprodev.com/iview/index2.html
so I want to check i the property youTubeVideoId is empty, if not it should use a video template.
and then apply the slideCaption to the video and image templates or should it be applied to template which match "/" ..?
My xslt looks like this.
But it would probably be better to use templates, so it's easy to manage different layout for each slide.
In the template match="/" should apply-templates select the full xml for the slide variable?
/Bjarne
is working on a reply...