I want to create one xslt which will count the numbers of character in the string & if string is have more that 50 characters then it will cut string to 50 characters & it will give ">>" as a link to full article .....
I am not sure wether i can do it using xslt or not ...but still i like to try ....
But i have to take string from user ....user will write some thing in the textbox provided in document type & then i want to truncate that string ...also i have more than 1 box where i want to do this thing .also i want to give link to that page after say 50 characters insted of "..." which i m not able to do after using that example ...how to do this ?
Well maybe it's neccesary to have to different XSLT files for this then.
But could you perhaps post some of the code you're working on now? And the textbox you're talking about...is that a multiple textbox or a rich text editor?
Ok, but do you have much content in that rich text editor, where the could be more than one link? Is what you need to "just" add >> after the link? I'm getting a bit confused so if I can understand your purpose on a deeper level I might be able to help you with the best solution.
It does not sound like the ideal solution at the moment.
i want if the text (text is written by user) exceeds 60 charactes then ">>" should automatically appear & ">>" should have a link (link is given by user) to the main article .....
i am using richtext box editor & i have much of text in it ....
when i use richtext box editor with ur given code then it shows something
<span class="xml-text">Rewarded with Editors ch>>
but i want
Rewarded with Editors ch>> (here ">>" will have the link to main article)
Link after string...
Hello all,
I want to create one xslt which will count the numbers of character in the string & if string is have more that 50 characters then it will cut string to 50 characters & it will give ">>" as a link to full article .....
I am not sure wether i can do it using xslt or not ...but still i like to try ....
Please help me ....
Hi Vaibhav
This is possible to achieve by using the Truncate extension.
There is a good example on the usage in the wiki here: http://our.umbraco.org/wiki/reference/umbracolibrary/truncatestring
Hope this helps.
/Jan
Hai thanx for help.
But i have to take string from user ....user will write some thing in the textbox provided in document type & then i want to truncate that string ...also i have more than 1 box where i want to do this thing .also i want to give link to that page after say 50 characters insted of "..." which i m not able to do after using that example ...how to do this ?
Hi Vaibhav
What are the property names of these two boxes?
What you need to do is use the property names in the truncate extension...like this.
<xsl:value-of select="umbraco.library:TruncateString($currentPage/thenameofyourproperty1,50,'>>')"/>
<xsl:value-of select="umbraco.library:TruncateString($currentPage/thenameofyourproperty2,50,'>>')"/>
Does it make sense?
/Jan
But that boxes are ar different places ......& i have only 1 xslt ....how can i do it ?
Also i want to apply link on ">>" which also will be given by user .....How can i do it ?
Also i have found 1 thing that when i m using this xslt with some propery which has Richtextbox editor then i shows text as
<span class="xml-text">Rewarded with Editors ch>>
but for textstring it works properly...
Hi Vaibhav
Well maybe it's neccesary to have to different XSLT files for this then.
But could you perhaps post some of the code you're working on now? And the textbox you're talking about...is that a multiple textbox or a rich text editor?
/Jan
It is richtextbox editor i m using ....
can u tell me how to apply link on ">>" thing in xslt (link will also come from user from textbox)
I have created this xslt right now .....
Hi Vaibhav
Ok, but do you have much content in that rich text editor, where the could be more than one link? Is what you need to "just" add >> after the link? I'm getting a bit confused so if I can understand your purpose on a deeper level I might be able to help you with the best solution.
It does not sound like the ideal solution at the moment.
/Jan
i want if the text (text is written by user) exceeds 60 charactes then ">>" should automatically appear & ">>" should have a link (link is given by user) to the main article .....
i am using richtext box editor & i have much of text in it ....
when i use richtext box editor with ur given code then it shows something
<span class="xml-text">Rewarded with Editors ch>>
but i want
Rewarded with Editors ch>> (here ">>" will have the link to main article)
hope u will understand this.
is working on a reply...