Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

alphaod

macrumors Core
Original poster
Feb 9, 2008
22,199
1,260
NYC
I added this to my custom BBCode:
Code:
<a href="{param}"><img alt="" border="0" src="{param}" style="width:400px; margin: 0px 0px 0px 0px;"/></a>

The issue is that it doesn't work. Did I do something wrong?

It's suppose to display a 400px wide thumbnail.

Regards.
 
What is your tag set to and explain its purpose?

I don't see you using {option} at all, as {param} represents the editor text wrapped by the tag. Each {option} displays a dialog input box to the user.

My wild guess solution assuming that you want editor text to be replaced with a linked image 400 pixels wide and no margin, where the user supplies both the link and the image URL's:

Code:
<a href="{option}"><img alt="" border="0" src="{option}" style="width:400px; margin: 0px 0px 0px 0px;"/></a>

From the vB help page on adding bbCode:

Make sure that you include '{param}' (without the quotes) to insert the text between the opening and closing BB code tags, and '{option}' for the parameter within the BB code tag. You can only use {option} if 'Use Option' is set to yes.

For example, you would use <b>{param}</b> for tags and <a href="{option}">{param}</a> for . You will always use '{param}', but you will only use '{option}' when Use Option? is yes.



As an aside: I also wish to very informally point out that since vB uses XHTML transitional a best practice is to add an ID to the IMG tag and remove the inline styling and instead reference the ID in an appropriate style sheet with the height,width, etc. set there. I know it's transitional and not strict, but I advise so you can get in the habit of doing it, plus separating content from style is the way to go and of course all your styling is centralized. No biggie, of course.

-jim
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.