symfony-cmf / seo-bundle

A SEO Solution for duplicate contents, page titles, etc.
https://cmf.symfony.com
47 stars 27 forks source link

[Sitemap] add depth information to the UrlInformation #280

Closed ElectricMaxxx closed 8 years ago

ElectricMaxxx commented 8 years ago

As a visitor of a html sitemap i want to see the sitmap with indents of the position of the content's routes in the path to get a better overview.

NOTE: We should do that by passing, the route node's depth property, we hopefully are able to acces.

AC:

dbu commented 8 years ago

sounds like a good idea to me. maybe we should "normalize" the depth so that the route root is at 0. that would mean take the depth of the root and substract that from the depth we pass to the templating.

even the xml template could include that attribute, as long as that does not violate some schema.

On 07.04.2016 08:52, Maximilian Berghoff wrote:

As a visitor of a html sitemap i want to see the sitmap with indents of the position of the content's routes in the path to get a better overview.

NOTE: We should do that by passing, the route node's depth property, we hopefully are able to acces.

AC:

  • depth property is available in the templates
  • * html and json template are using that

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/symfony-cmf/SeoBundle/issues/280

Liip AG // Agile Web Development // T +41 43 500 39 80 CH-8005 Zurich // PGP 0xA581808B // www.liip.ch

ElectricMaxxx commented 8 years ago

The items in the <urlsets></urlsets> have no semantics. It is just a plain list for google, except somebody is using its own xml-template for custom usage. For that case i would add the information in general to the parameters passed to the template. I am thinking what is faster: Either simply counting by imploding by / or grabing the node and try to get its depth information.

Btw: is there a way to order by node path, when fetching the documents? So we will have the result a little bit aligned without sorting by the parents.

ElectricMaxxx commented 8 years ago

Maybe we can put that one on a 1.2.1? I would like to implement the sitemap on our website https://github.com/symfony-cmf/symfony-cmf-website/pull/94 (later sandbox too) and would need that feature.

dbu commented 8 years ago

The items in the || have no semantics. It is just a plain list for google, except somebody is using its own xml-template for custom usage. For that case i would add the information in general to the parameters passed to the template.

okay, fair enough.

I am thinking what is faster: Either simply counting by imploding by |/| or grabing the node and try to get its depth information.

if we operate on the documents, i think we can ask the document manager for the node to that document, or the unit of work. i would go that way rather than string operations - that feels just fishy.

Btw: is there a way to order by node path, when fetching the documents? So we will have the result a little bit aligned without sorting by the parents.

afaik no, unfortunately. if you walk the tree, order is guaranteed. when querying you need orderBy and afaik path is not an option there. you would need to check the jcr spec if there is something.

1.2.1

passing the depth to the template is no problem. changing the default html template to actually use the depth is probably a BC break we should keep for 2.0. but in json i would not worry about adding it. i guess for html sitemaps, you likely have your own templates anyways.

if people disagree about putting this into a patch release, we can also do a 1.3.0 as soon as this feature is ready - we are one version number behind the rest of the cmf packages anyways :-)

ElectricMaxxx commented 8 years ago

closed ue to #282