The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Link to "this page"?
Probably a very simple, silly question. I made a a toggle to switch styles at the top of my forum (depending which style you're in, it's just a pair of conditional links to the URl of the home page with ?styleid=x after it).
It works fine, but takes people to the home page when they click on it. What would I need to use for the URL to keep the user on the same page, and simply switch the style? I.e., what's the template code which outputs the URL of the page currently being viewed? |
#2
|
||||
|
||||
Try just putting the style changer command in the link:
HTML Code:
<a href="?styleid=x">Style X</a> |
#3
|
|||
|
|||
You mean just miss out the part of the URL before the question mark? Currently I have:
Code:
<a href="http://www.site.com?styleid=x">Switch Style</a> Just tried your version. It takes me back to the home page just like my version does, unfortunately. |
#4
|
||||
|
||||
Ah, yes, I wasn't thinking. Actually, there is a way, but you may have to use more if conditions, because ? can only be used once in the URL. Once you instantiate it, you then have to add additional functions with &.
So if a user is on this page (forumdisplay.php?3-D-amp-D-and-Pathfinder), the code would need to look like this: HTML Code:
<a href="{vb:raw relpath}&styleid=X">Style X</a> HTML Code:
<a href="{vb:raw relpath}?styleid=X">Style X</a> |
Благодарность от: | ||
tbworld |
#5
|
|||
|
|||
Eeek, no, you're right - that would be unfeasibly bulky. There' a lot of different pages!
Looks like a return to the home page is going to be necessary then. That's a shame; still, it's not the end of the world! Thanks for the help! |
#6
|
||||
|
||||
What is the original code you were trying to use?
|
#7
|
|||
|
|||
It's not really code; just a link - the one I posted above:
Code:
<a href="http://www.site.com?styleid=x">Switch Style</a> |
#8
|
||||
|
||||
What about the conditionals?
|
#9
|
|||
|
|||
Oh, that just gives a different link depending on the viewing style:
Code:
<vb:if condition="$bbuserinfo['styleid']==14"><a href="?styleid=19">Switch Style</a> <vb:else /> <a href="?styleid=14">Switch Style</a> </vb:if> |
#10
|
||||
|
||||
Ok that's what I thought, I'll do some testing when I get home from work.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|