T Grando February 2016

SEO Document Editor extends "Title" every time I edit it

For example, The SEO Document Editor displays "Welcome | pimcore demo", while the document only contains "Welcome" in "Settings" / "Name & Metadata" / "Title".

This seems to be because of

$this->headTitle()->append("pimcore demo");

in the layout file.

However, if you edit the title in the SEO Document Editor, "Welcome | pimcore demo" is put in the Title field, which after appending "pimcore demo" leads to the title "Welcome | pimcore demo | pimcore demo".

The title is extended every time I edit it via SEO Document Editor, even if I don't change anything.

Answers


kubaplas February 2016

This problem is caused by the way that Seo Editor handles detecting page's title - it's rendering the webpage and taking full title - including parts added in layout. Then this full title with Your alterations is saved as Document's title property. I'm afraid there's no easy way fixing that without breaking anything.

You can try:

  1. Insted of rendering webpage to get it's title, You could just get title property. Just remove this try block: https://github.com/pimcore/pimcore/blob/4d8c3177bd6504a930ad87da2f55c9142d3c566f/pimcore/modules/admin/controllers/DocumentController.php#L994

Unfortunately, this would break SeoEditor's capability of counting title's length.

Or if You can live with that - remove append from the layout.

Fixing this properly will need some changes in both Document controller and ExtJs code of the SeoEditor. Try creating an issue on Pimcore's github for this bug, or even better - if You manage to fix it - create a pull request.

Post Status

Asked in February 2016
Viewed 3,482 times
Voted 11
Answered 1 times

Search




Leave an answer