Back to SEO Extension Support

Cpt.Meatball
Cpt.Meatball

As title states, how do I do it?

I've developed my own plugin, but I need to set the page title dynamically. I've read somewhere else on the forum that I need to access the component via:

public function onEnd() {
    $this->layout->components['SeoCmsPage']->seo_title = $dynamic->title;
}

But that doesn't seem to work.

Last updated

SinisaPerovic
SinisaPerovic

I'm using this and it works for me

    function onStart()
{

     switch ($this['activeLocale']) 
    {
        case 'hr':
            $title = 'Sve Aktivnosti';
            break;

        default:
            $title = $this->page->title;
    }
    $this->layout->components['SeoCmsPage']->seo_title = $title;
}

Last updated

daftspunky
daftspunky

Pretty sure $this->SeoCmsPage->seo_title will do the same thing

Sevenface
Sevenface

How do you add this to ur website? Via script ? Or in a extra component?

Last updated

hambern
hambern

This does not work for me. The name of the page is still showing after:

function onStart() {
    $topic = $this->components['forumTopic']->getTopic();
    if (!empty($topic)) {
        $this->page->title = $topic->subject;
        $this->page->description = $topic->start_member->username;
        $this->SeoCmsPage->seo_title = $this->page->title;
        $this->SeoCmsPage->seo_description = $this->page->description;
    }
}

1-5 of 5