The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
How to change the meta description? vboptions[description]?
Folks I have a custom template which I use to output custom pages outside normal forum functionality.
I want to change the keywords and description metas which in the headinclude look like HTML Code:
<meta name="description" content="$vboptions[description]" />
PHP Code:
PHP Code:
HTML Code:
$stylevar[htmldoctype] <html xmlns="http://www.w3.org/1999/xhtml" dir="$stylevar[textdirection]" lang="$stylevar[languagecode]" id="vbulletin_html"> <head> <base href="http://www.avforums.com/forums/" /> $headinclude <title>$pagetitle - $vboptions[bbtitle]</title> <link href="http://www.avforums.com/styles/balloontip.css" type="text/css" rel="stylesheet"> <script type="text/javascript" src="http://www.avforums.com/highslide/highslide-with-html.js"></script> <script type="text/javascript" src="http://www.avforums.com/highslide/highslide.config.js" charset="utf-8"></script> <link rel="stylesheet" type="text/css" href="http://www.avforums.com/highslide/highslide.css" /> </head> <body> $header <if condition="$headerbanner">$headerbanner</if> $navbar $HTML <if condition="$footerbanner"><br />$footerbanner</if> $footer </body> </html> $vbulletin->options['description'] = "AVForums reviews"; and $vboptions['description'] = "AVForums reviews"; and neither work. Any ideas please? |
#2
|
||||
|
||||
Anyone?
|
#3
|
|||
|
|||
Maybe you could make a plugin on hook parse_templates like this:
Code:
if (THIS_SCRIPT == 'reviews') { $vbulletin->options['description'] = "AVForums reviews"; } Or maybe in your code you could do a preg_replace() on $headinclude after global.php is included, and replace the meta tags. |
#4
|
||||
|
||||
Thanks. It's not until I'm a bit into the script that I know what description I want to have. It's kind of a problem and I think I might have to create a custom version of global.php just for these special pages.
|
#5
|
|||
|
|||
OK, how about this: in the headinclude template put
Code:
<if condition="THIS_SCRIPT != 'reviews'"> ... </if> around the meta tags, and in your template put a new variable where you want the description meta tags to be (or maybe copy the entire meta tag block from headinclude to your template and replace the variables as needed), then you have until the template eval to set that variable. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|