The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Changing Image Alt Text Using Replacement Variables
Hey all
Just been trying to change my pesky image alt text using replacements variables. My current alt text is - alt="Click image for larger version. (I think the lightbox feature creates this.) Anyway I created a replacement variable like this - REPLACE : alt="Click image for larger version WITH : alt="$vboptions['bbtitle'] I also tried {options}, $vboptions['keywords'] and {title} It will change the alt text but then the text is just {options} etc it won't pull the unique thread title or keywords into the alt text for me. Can somebody tell me the correct code I need? G |
#2
|
|||
|
|||
Try:
Code:
alt="{vb:raw vboptions.bbtitle}" |
#3
|
||||
|
||||
No that doesn't work either...
The whole source of the images are like this - Code:
alt="Click image for larger version. Name: test 1.jpg Views: 0 Size: 34.2 KB ID: 78672"/></a> Code:
alt="click image for larger version. replace with alt="{vb:raw vboptions.bbtitle} Is there any where I can find that piece of code I need? |
#4
|
|||
|
|||
I probably should have asked, where are you doing this exactly? The curly brace replacements only work if you're putting that code in a template. Assuming you are and it didn't work, which template is it and what did you see?
|
#5
|
||||
|
||||
Hi Kevin,
I went into styles + termplates -> replacement variable manager -> add new replacement variable I put the variable into my current custom theme (not the default vb one). When I did the replace, I hovered the mouse over the image, alt text just reads {vb:raw vboptions.bbtitle} When I view the source code in FF, it looks correct but the color of the text is now all red. Before some of the text was blue, and this is what was the alt text I could read when hovering, but now the source code highlights it all as red. So before I could read the lightbox alt text, filename, views and size But now the alt (when hovering) just reads {vb:raw vboptions.bbtitle} |
#6
|
|||
|
|||
I'm sorry, I misunderstood what you were trying to do. The answer is that when you set up a replacement variable, you can't use a variable in the replacement text. (That just sounds wrong, I know, but it's true).
But you could just put your forum title in there, since I don't imagine it would change very often. |
#7
|
||||
|
||||
haha OK
Can I insert thread keywords? thread title? thread description? Anything at all related to the thread... I tried the alt plugin by BOP5 but it wouldn't work. I also checked to see if VBSEO offered this but they don't (which I found very weird). How do vBulletin users get loving from Google images? I'm finding it very hard and I have alot of images on my site... thanks for all the words of wisdom Kevin |
#8
|
|||
|
|||
I guess the way to do it is to have a plugin put together a string from whatever values you want, then register that to the template and use a curly brace thing in the template. But I know not everyone is in to that kind of programming, and I don't know if any mods exist already. Hopefully someone else will.
|
#9
|
||||
|
||||
Damn it to hell, hmmm think I'll have to make a paid request and see what happens.
Thanks alot for the input, hopefully I can make something work and share it here on the forum. |
#10
|
||||
|
||||
One of the articles in the Articles Forum is a tutorial on how to do a simple string replace using plugins. It might need some tweaking for vB4, but it might be just what you needed.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|