gantry / gantry5

:rocket: Next Generation Template / Theme Framework
http://gantry.org
1.03k stars 206 forks source link

Canoncial URLs - SEO - Multidomain #2291

Closed thexmanxyz closed 3 years ago

thexmanxyz commented 6 years ago

Hey there,

sorry for opening another issue but I think this might be useful (if not already implemented), but I didn't find any signs that it is. However, I have to start this with a question, is there a better way to retrieve the current relative path from Gantry other than:

{{ gantry.request.server['REQUEST_URI'] }}

because this is the only thing I found in the Gantry code base. Now to the actual feature / issue. I want to collect some input concerning implementing a feature which allows to define canoncial URLs for Gantry either via an Atom or if there is a demand within Gantry itself (via a pull request). If the second case applies, I have to request some input here because this might not be that trivial in all relevant cases.

Nevertheless, I will state here the basic case (my case) respectively the common case. For example I have a website which is reachable via two urls (stupid example - I know):

One of those should be the canonical one. This is a special case which can be extended to a more common case with a subdomain:

which might apply to more people. So basically my idea is to allow people within Gantry to map a set of domains to the main canoncial domain. Because this is a typical case for SEO optimization. I know that this is just a basic example which probably can be further extended to support more complex cases. But this as a start to provide people with the most basic feature set. I also have here multi language sites in mind which would be even more useful.

Suggestions and input welcome :)

PS.: I saw that the demo site has this implemented somehow, probably not over the framework itself, just an additional note ;).

Ad.: Relates to #2303 if implemented via Atom.

mahagr commented 6 years ago

IMHO this should not be part of Gantry (template framework) but the underlying CMS. Many CMSes already set canonical URL in the document head, which includes the canonical path to the current page.

You will likely find many plugins for your favourite CMS that already implements this feature. Closing as being out of the scope of this project.

thexmanxyz commented 6 years ago

@mahagr You are right that this is out of scope of the Gantry project itself. However even thought it would be nice to have access on the <head> Tag from Atoms and Particles. For the extensibility of the framework it would be great to have the toolset so that developers like me can integrated features which would be easy available for all three platforms. The free plugins for joomla are also not really feature monsters, so I would for myself at least have the ability to write a Canoncial URL Atom.

Is there anything which speaks against the integration of a injection point within the <head> Tag?

mahagr commented 6 years ago

I can quickly look into it.

thexmanxyz commented 6 years ago

@mahagr That sounds great, thanks :)