Log in

View Full Version : friendlyurl in headerinclude


BirdOPrey5
08-22-2010, 12:58 PM
I'm trying to get the friendly url (current url) of a page, it looks like it should be in:
{vb:raw vboptions.friendlyurl}

But whenever I use this in headerinclude template it resolves to '1' and not a full URL like I'd expect... anyone know how I'd get the URL of the current page?

--------------- Added 1282486854 at 1282486854 ---------------

I got this:

<http://www.example.com/forums/{vb:link thread, {vb:raw thread}, {vb:raw pageinfo_post}}

But the problem is it always has "showthread" in the result even if I'm not in showthread but in a profile or forumdisplay.... this isn't that big a deal but I guess I'd need to but a conditional to prevent this from displaying if not in showthread- which I can do but was hoping for a more elegant solution that would work anywhere...

Lynne
08-22-2010, 02:08 PM
{vb:link thread... is going to give you a thread link... a showthread page.
vboptions.friendlyurl will return the option you picked in vboptions > friendly urls > url type

(There is an article on the friendly urls in the vb4 articles forum)

BirdOPrey5
08-22-2010, 03:07 PM
Thanks Lynne, I'll take a look at the article but...

I have Friendly URL's set to "basic friendly" in vBulletin options but wherever I use {vb:raw vboptions.friendlyurl} in the headerinclude template it always resolves to "1" - any ideas why that is?

Edit- when I change from "basic friendly" to "advanced friendly" it changes from '1' to '2'...

Lynne
08-22-2010, 11:37 PM
The value for Basic Friendly is 1. For Standard URLs, it's 0. For Advanced Friendly URLs, it's 2, and for Mod Rewrite Friendly URLs, it's (Just look in the source code to see the values.)

BirdOPrey5
08-23-2010, 12:35 AM
I see... I thought vboptions.friendlyurl would give me the actual URL as opposed to what type of url was being used... BTW I looked for the article but didn't see any with "url" or "friendly" in the titles at all- do you know if it was called something else by chance? I guess I could search posts if need be.

Lynne
08-23-2010, 02:28 AM
vboptions are Options. They are your settings that you set in vboptions.

vBulletin 4 Template Syntax: Links (https://vborg.vbsupport.ru/showthread.php?t=221572)

BirdOPrey5
08-23-2010, 02:38 AM
many thanks. :)