The Arcive of vBulletin Modifications Site. |
|
|
#1
|
|||
|
|||
|
Hi all!
I would like to create a custom bbCode tag [spoiler] that can be collapsed/expanded via JS. In order to be able to do that however, I need to assign unique IDs to each container displaying a spoiler posted by users. So I was wondering if it was possible to create a custom bbCode tag [spoiler], where the replacement code contains the variable $postid, similar to the snippet below: Code:
<div id="spC_$postid" onclick="JSgoeshere">
<div class="spBody"> (This just for formatting)
{param}
</div>
</div>
("spC_" = prefix so the div doesn't have the same ID as the postbit container)
Any hints/tips/pointers would be greatly appreciated.
|
|
#2
|
||||
|
||||
|
$post[postid] should work.
|
|
#3
|
|||
|
|||
|
Hi Dismounted,
Thanks much for the quick reply! I tried $post[postid] a minute ago but all I get on the rendered page is <div id="$post[postid]">the parameter text</div>. Is it possible that vB simply won't parse variable placed in this location? Ha! Fixed with work-around by using "this" my JS. For anyone in a similar predicament, here's an example ... feel free to grab/use/mangle the code therein!
|
![]() |
|
|
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
|
|
More Information |
|
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|