Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Vanilla 2.3 fully supports PHP 7. Get it now!
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Page titles

edited January 2011 in Vanilla 2.0 - 2.2
I'm trying to see what, if any options I have for displaying page titles. At this time here is how they are being displayed:

Forum Home: All Categories - Example.com Forum
Category: Category Name
Post: Post Name - Category Name

Here is how I'd like it to read:

Forum Home: Example.com Forum
Category: Example.com Forum | Category Name
Post: Example.com Forum | Category Name | Post Name

Is this possible?

Comments

  • edited January 2011
    The current order (example.com at the end) is better for your search engine ranking. Someone correct me if I'm wrong.
  • The current order (example.com at the end) is better for your search engine ranking. Someone correct me if I'm wrong.
    i'd like to know if this is indeed true.

  • aeryaery Gtricks Forum in 2.2 :) ✭✭✭
    Even I would like to do same.

    Vanilla staff, please give us flexibility for changing titles like WP

    Vanilla is sweet & support is great, to encourage volunteers, please donate.

  • edited February 7

    I used the current method in respuestas.kimovil.com:

    <?php if (!defined('APPLICATION')) {exit();}
    class KimovilThemeThemeHooks implements Gdn_IPlugin {
        public function Setup() {}
        public function Base_Render_Before($Sender) {
            // Page Head sender
            if (is_object($Sender->Head)) {
                // If we are in a discussion page (change controller for different pages)
                if ( is_a($Sender,'DiscussionController')) {
                    // Add category name to the title
                    $Sender->title( ConcatSep(' - ', valr('Data.Title', $Sender, ''), valr('Data.Category.Name', $Sender, '')) );
                    // Add discussion title and body (max 155 char) to meta description 
                    $Sender->description( substr(rtrim(valr('Data.Discussion.Name', $Sender, ''), '.').'. '.valr('Data.Discussion.Body', $Sender, ''), 0, 155) );
                }
            }
        }
    }

    You can get an idea of ​​what you can change in:
    /applications/dashboard/modules/class.headmodule.php

    Hope this help ^__^

  • You can get an idea of ​​what you can change in:
    /applications/dashboard/modules/class.headmodule.php

    The correct file to look for that is:
    /library/core/class.controller.php

Sign In or Register to comment.