Am actually using the Multiple TextString in V4.9.1 and having some difficulty to display each TextString. The Multiple TextString is being used in the media section attached to a MediaType to enable user to add Slogan to there banner slideshow.
Here is my code
if(slide.HasValue("slideshowHeading") && slide.Where("slogan")){ @:{image : "@slide.umbracoFile", title :"<h1>@foreach(var t in slide.slideshowHeading){@t <br/>} </h1>"},
}
Here is the output from 2 textString
{image : "/media/4187/01-dimg.jpg", title :"<h1>d<br/>'<br/>t<br/>e<br/>s<br/>t<br/> </h1>"},
The desired output would be
{image : "/media/4187/01-dimg.jpg", title :"<h1>d'<br/>test<br/> </h1>"},
Honestly, I'd be expecting an DynamicXml object to come back from the default Multiple Textstring. Since it's not doing that, (for whatever reason), I'd suggest trying to split the string into an array.
@foreach(var t in slide.slideshowHeading.Split(' ')){@t <br/>}
If the " " (space) doesn't work, then try a "\n" (newline) ... sorry, it's all guesswork by me (I still do it all in XSLT).
Splitting Multiple TextString
Hi,
Am actually using the Multiple TextString in V4.9.1 and having some difficulty to display each TextString. The Multiple TextString is being used in the media section attached to a MediaType to enable user to add Slogan to there banner slideshow.
Here is my code
Here is the output from 2 textString
{image : "/media/4187/01-dimg.jpg", title :"<h1>d<br/>'<br/>t<br/>e<br/>s<br/>t<br/> </h1>"},
The desired output would be
Any idea what am doing wrong here ?
Hi Fuji, what is outputted when you just do:
?
I'm curious if it's "DynamicXml" or something else?
Thanks, Lee.
Hi Lee,
Well i get this
Btw the way am in the media section here, where i need a <br/> tag between each added Textstring for the headers
Hmmm... which Multiple Textstring are you using? the native one (that comes with Umbraco default) or the uComponents version?
Only I'd expect the value to be a DynamicXml ... otherwise for the uComponents version it should have a model binder that uses a "List<string>".
Using the one from Umbraco Default in v4.9.1.
Any Idea what i should do ?
Honestly, I'd be expecting an DynamicXml object to come back from the default Multiple Textstring. Since it's not doing that, (for whatever reason), I'd suggest trying to split the string into an array.
If the " " (space) doesn't work, then try a "\n" (newline) ... sorry, it's all guesswork by me (I still do it all in XSLT).
Cheers, Lee.
This did the trick
So everytime the user enters the * symbol in the textString it assumes it will go on the next line.
Thanks for your time Lee
//fuji
No worries Fuji, glad that you found a solution. (Still curious what the underlying issue is/was.)
Cheers, Lee.
is working on a reply...