Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin functions affecting page properties #187

Open
helsner opened this issue Feb 19, 2021 · 4 comments
Open

Plugin functions affecting page properties #187

helsner opened this issue Feb 19, 2021 · 4 comments

Comments

@helsner
Copy link
Contributor

helsner commented Feb 19, 2021

MetaTagService::set(MetaTagService::META_DESCRIPTION, (string) $category->getDescription());

The marked point is a good feature to help out automatic setup of the blog but causes also a problem.
At this point the plugin which is a content element, directly affects the page properties, which should not be mixed IMHO.
We stumbled upon this behavior as the customer was reporting that his meta description of the page has been missing even though it definitely got saved etc. (also yoast_seo breaks, which is just a side affect)

My recommendation would be to check for the existence/value of the category and leave the tag addition out if the value is empty

@helsner
Copy link
Contributor Author

helsner commented Mar 14, 2021

I provided a patch for this specific "empty metatags" case.
What i don' t like in general is the mixing of pages and content - the plugin directly affects the properties of the pages.
Those plugins are used on specific pages so you could argue it's not that breaking, but for people adding proper titles etc. the meta-tag handling directly affects their settings by overriding them.
I would recommend a setting to disabel/enable this feature - it is nice for standalone usage and helps the editor but its affecting the advanced users

@imminger
Copy link

imminger commented Oct 21, 2021

The fact, that og_title from the table "pages" is overwritten, seems like a bug to me. However, even if pages.og_title were empty, a content element should not have any effect on the meta tags. The preview on Facebook or Twitter merely shows the title of the selected category, when using "List by Category". The page title is in most cases more meaningful and inviting (even when pages.og_title is empty).

In one installation, we placed the "List by Category" element on many pages. It took me quite a while to find the reason for those weird meta tag values. I didn't even consider a content element as the origin of the problem, because this behaviour is so unusual.

As @helsner said, this "feature" should be optional (and disabled by default).

@helsner
Copy link
Contributor Author

helsner commented Jan 19, 2022

once again i stumbled upon this issue.
Our customer has the category plugin on the home page which causes the first category title to be set as title tag.
This is totally not working out and wanted.
I will try to change this on my initial PR

@rupasix
Copy link

rupasix commented Aug 3, 2022

We have the same case - customer have post list by category on home page. Title and description is empty on that page because is overridded by plugin. We XClass listPostsByCategoryAction but this solution is far from ideal. Can we use some kind of flag in TS to turn off meta tags for lists?

PS. can someone explain why plugin creating post list overrides meta of page when editor can manage metatags from page TCA form?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants