SEO Convention for passing title, keywords, description to theme from modules

Description

Currently, in the default theme we have this code
It accounts for the site tagline, or the currentpage, but there isn't a convention for setting it from the module.
I think this is vital, and Andrew Davis confirmed he needs this to launch his first app.

This will be vital with Mapigator too.
Lets establish a convention for setting the title, keyword, description and maybe even additional meta tags, so the theme can handle it simply.

Maybe have a theme method to get the title, and it will look in the request(orwhatever we store them in) for those settings, else pull from the page, else the site.

This will allow the following:

Gliffy Diagrams

Activity

Show:

Gavin Pickin December 14, 2016 at 10:15 PM

https://github.com/Ortus-Solutions/ContentBox/pull/274

Built upon the last changes you made to the SEO functions

Gavin Pickin August 3, 2016 at 3:14 PM

Yes, something like this sounds good.
I wasn't sure how you wanted to store the data, I guess thats an implementation decision, but yes, I think this would be a great helper.

Maybe even make a theme helper, getTitle() and it would look for the right way to set the title, so you dont need that bulky if statement in every theme.

maybe add getMetaTitle(), getMetaKeywords() getMetaDesciption() getMetaAdditional()
That way the way its created is encapsulated.

Luis Majano August 3, 2016 at 2:56 PM

Ok I get it now. It is when you leverage the theme for custom modules. Sorry did not grasped it. This is valid then. How about a prc variable or a cbhelper method : setPageTitle(), setPageKeyworfs(), setPageDescroptuon(), setPageMeta( struct )

Gavin Pickin August 3, 2016 at 2:04 PM

I didn't have the latest code, which included your new HTML title field.

When modules use the PrepageUI helper display itself in the theme, it has no way to tap into the meta / title etc.
I guess we could create a module layout in themes.

No matter how we do it, we need some convention.

Luis Majano August 3, 2016 at 1:49 AM

The only problem I have with this, is that this metadata is not stored in the page, but overriden by modules. Not sure if that is an intended behavior.

Shouldn't the page metadata be stored with the page.

Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Fix versions

Affects versions

Components

Priority

Sentry

Created August 2, 2016 at 7:25 PM
Updated December 20, 2016 at 1:51 PM
Resolved December 20, 2016 at 1:51 PM