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.
Options

Meta Description tag for All Discussions page?

edited August 2005 in Vanilla 1.0 Help
Is it possible within the extensions framework to add a new tag in HEAD section of the HTML and to do so only on the main All Discussions page? If it is then I should be able to whip what I want together, which is to define a meta Description for the main page that Google will pick up instead of: Loading... Not signed in (Sign In). Hip in Houston - If you're hip and in Houston then you belong here! Discussions · Categories · Search. Welcome, Guest ...

Comments

  • Options
    MarkMark Vanilla Staff
    edited August 2005
    hehehe - yes, you can add a string to your header pretty easily. An extension like this would do the trick:
    <?php
    /*
    Extension Name: My Custom Meta Info
    Extension Url: http://www.yourdomain.com/
    Description: Adds my custom meta information to the header of my forum
    Version: 1.0
    Author: Your Name
    Author Url: N/A
    */
    
    if (@$Head) {
       $Head->Addstring("<meta name=\"description\" content=\"Stuff about my forum\" />");
    }
    ?>
  • Options
    Sweet! Thanks for that, now I may just have to dig deeper and see how to make the description editable from the settings. :) Although unless I'm missing something that will add it to every page including individual discussions, where you would only really want it on All Discussions so is there a way to differentiate that?
  • Options
    MarkMark Vanilla Staff
    unless I'm missing something that will add it to every page including individual discussions

    That is correct, you can specify which pages you want it on by doing something like this:
    <?php
    /*
    Extension Name: My Custom Meta Info
    Extension Url: http://www.yourdomain.com/
    Description: Adds my custom meta information to the header of my forum
    Version: 1.0
    Author: Your Name
    Author Url: N/A
    */
    
    if (in_array($Context->SelfUrl, array("index.php","signin.php","apply.php","passwordreset.php","passwordrequest.php","account.php","search.php"))) {
       if (@$Head) {
          $Head->Addstring("<meta name=\"description\" content=\"Stuff about my forum\" />");
       }
    }
    ?>
  • Options
    Everyday I love Vanilla a little more. :)
This discussion has been closed.