Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Help! How do you add meta tags?
I'd like to add meta tags to my site so I can promote it more. right now no one knows about it! HEEEELP
go to www.realbraveaudio.com/vanilla
thanks for your help
0
This discussion has been closed.
Comments
<?php /* Extension Name: Meta tags Extension Url: http://lussumo.com/community/discussion/3999/ Description: Simplistic extension example to add a meta tag to all or some pages. Version: 0.1 Author: WallPhone Author Url: http://edacio.us/ */ if(in_array($Context->SelfUrl, array('index.php', 'categories.php', 'comments.php', 'search.php', 'post.php', 'account.php', 'settings.php', 'people.php'))){ $Head->AddString('<meta name="description" content="Put your description here.">'); $Head->AddString('<meta name="keywords" content="type, your, keywords, here">'); } ?>
If you want to customize the description and keywords based on the page, pull them out of that array, and put them in a new if block like so:
if ( in_array($Context->SelfUrl, array('search.php')) ) { $Head->AddString('<meta name="description" content="Put your description for the search page here.">'); $Head->AddString('<meta name="keywords" content="type, your, search, page, keywords, here">'); } if ( in_array($Context->SelfUrl, array('index.php', 'categories.php')) ) { $Head->AddString('<meta name="description" content="Put your main & categories page description here.">'); $Head->AddString('<meta name="keywords" content="type, your, main, and categories, keywords, here">'); } ?>
Name this file
default.php
and save it in a folder created in your vanilla's extensions folder, then enable it in the forum settings.If you just want the same meta tags site-wide, it might be easier to create a new theme file by editing the
themes/head.php
file.default.php
, and placed in a folder inside Vanilla'sextensions
folder)The other way to do it, (not using an extension) is by creating a theme, which is where that
head.php
file would come in to play.You should only have to do it one of these ways.
As far as promotion... I don't really know that much more about it. Many say linkbuilding/baiting is the best.
There were developed to provide information about a website (that's why they called METAtags .
They were used by search engines long time ago AFAIK. Especially Keywords and Description. But then came webmaster, who put all kinds of keywords in their metatags, so they were not useful anymore. So search engines switch to other methods. But MetatTags are still in use. For example shows google the Description text of my website, when it's in results.
They are the first step of SEO if you ask me. Followed then by friendly URL's and then of course followed by linkbuilding/baiting.
Furthermore MetaTags are also a sign of good neightborhood imho, because they also provide information about the author and the creation date of the site.
See also
I had hacked a way to include Meta Tags but your method is much more elegant.
Thanks too!
Imagine every Vanilla page where there are two form input fields at the top only visible to administrators. Discussion pages meta description pre-filled with the discussion topic. Administrators (or any role with 'can edit meta tags') can simply type what they feel is the best meta description and meta keywords in the boxes, and it propogates to the page.
That is what I would submit to the add-ons.