The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
escaping quotation marks in a template variable
I am redesigning one of my vB4 CMS widgets, "Recent Threads". It has variable for the preview of a thread post contents, it is called {vb:raw thread.previewtext}. I want to move it into the title attribute for the link to the thread (<a href="thread_url" title="thread_preview_text">) so that on most modern browsers the preview text will show up on hover over the link.
To work, I need to escape either double or single quotes from the text. Can I do this in a template? {vb:raw xxx} and {vb:urlencode xxx} aren't going to cut it for me. Is there an alternative that will escape my quotes? If not, any other suggestions? I suppose I could do a plug-in(?) but that template has no hook, and I have always been perplexed how to do a plug-in when there is no template hook. |
#2
|
|||
|
|||
It looks like {vb:escapejs xxx} escapes single quotes with a backslash (and that's all it does, apparently).
|
#3
|
|||
|
|||
You can use:
HTML Code:
{vb:var thread.previewtext} |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|