Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Sitemap generation #196

Merged
merged 1 commit into from
Feb 17, 2015
Merged

Sitemap generation #196

merged 1 commit into from
Feb 17, 2015

Conversation

ElectricMaxxx
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #132
License MIT
Doc PR symfony-cmf/symfony-cmf-docs#607

Started working on that feature. That would be the task:

  • implement generator for phpcr content
  • create decider for content which should be published
  • create controller for the output
  • general configuration and optional activating of the phpcr generator

*/
class SitemapController extends Controller
{
const TEMPLATE_HTML = 'CmfSeoBundle:Sitemap:index.html.twig';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this file seems to be missing

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we even need a html representation? what is the use case?
this is not suitable for the cms user site map which is structured and nicely curated. if anything, we would want some "show in sitemap" flag on routes - which can be managed with the route attributes if needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think We should add that, cause We have the data at this point. Would have to add some kind of sorting while creating the list (nested set idea) in the generator. the template i forgot to implement would be a generic one to override it.

*
* Depending on the type the controller is able to respond
* json, xml or html string.
* @author Maximilian Berghoff <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requires empty line

@ElectricMaxxx ElectricMaxxx force-pushed the sitemap branch 2 times, most recently from 0556dd6 to 3d56fbf Compare December 13, 2014 16:29
{
const TEMPLATE_HTML = 'CmfSeoBundle:Sitemap:index.html.twig';

const TEMPLATE_XML = 'CmfSeoBundle:Sitemap:index.xml.twig';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we move that to configuration? or at least to a parameter in the service definition xml file?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so, there are many easy ways to override a template of a third party bundle.

@wouterj
Copy link
Member

wouterj commented Feb 14, 2015

I'm sorry to join this party so late, but I'm finished now. :)

if (empty($this->providers[$priority])) {
$this->providers[$priority] = array();
}
$this->providers[$priority][] = $provider;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add: $this->sortedProviders = array();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i should empty the array every time i add a new one, really?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$this->sortedProviders would be the cache for the providers, needs to be reset each time a provider is added when doing caching

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but see below

@ElectricMaxxx
Copy link
Member Author

6 to 200 lets go ...

@@ -1,6 +1,8 @@
Changelog
=========

* **2015-14-02**: implement sitemap generation
* **2015-14-02**: [BC BREAK] Relax method visibility on "\Symfony\Cmf\Bundle\SeoBundle\SeoPresentation"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say: "[BC BREAK] Changed method visibility from private to public of SeoPresentation#getSeoMetadata()"

@wouterj
Copy link
Member

wouterj commented Feb 14, 2015

As you changed the Configuration class, you should update the XML schema definition too. (201, let's stop here)

@ElectricMaxxx
Copy link
Member Author

@wouterj you can live with #213 and #214 I will do them after this one.

@dbu
Copy link
Member

dbu commented Feb 16, 2015

imho this is ready to merge. @wouterj is the xml schema correct now?

i would not do the caching of sorted providers - there will be 1, maybe two in normal cases, and they should only be used once. the overhead of fetching all urls of the system twice must be way more than re-sorting the providers so i think we should not bother.

@ElectricMaxxx can you squash one more time please?

@ElectricMaxxx
Copy link
Member Author

I will do the xml schema stuff in #213 with the missed schemas for alternate locale and error sites. i will squash it now.

@wouterj
Copy link
Member

wouterj commented Feb 16, 2015

dbu added a commit that referenced this pull request Feb 17, 2015
@dbu dbu merged commit b2a6411 into master Feb 17, 2015
@dbu dbu deleted the sitemap branch February 17, 2015 07:30
@dbu
Copy link
Member

dbu commented Feb 17, 2015

Party

@ElectricMaxxx ElectricMaxxx mentioned this pull request Feb 17, 2015
@Peekmo
Copy link
Contributor

Peekmo commented Feb 17, 2015

Hello,

Have you got an idea of when it will be available in a release (or prerelease) ?

Thank you

@lsmith77
Copy link
Member

in general it will be released with CMF 1.3 which is likely going to happen in march/april. then again, we could already release a new SeoBundle minor release before that .. at least from a quick skim, none of the changes in master require new versions of any dependency:
1.1.0...master#diff-b5d0ee8c97c7abd7e3fa29b9a27d1780

@dbu
Copy link
Member

dbu commented Feb 17, 2015

we should first get the xsd schema update merged. but apart that why not, lets create a release then.

@dbu
Copy link
Member

dbu commented Feb 17, 2015

@Peekmo meanwhile, would you mind trying out in your project if the sitemap works as expected for you? symfony-cmf/seo-bundle: 1.2.*@dev should do the trick - if something else complains, add as 1.1.0 to the line to make composer think its version 1.1... not something to go online with, but to check if the feature works correctly.

@wouterj
Copy link
Member

wouterj commented Feb 17, 2015

This means that the tab PR is not going to make it into SeoBundle 1.2 and that we should postpone tab support to CMF 1.4?

@lsmith77
Copy link
Member

no. not necessarily. we can do another minor release of the SeoBundle once we are ready to release CMF 1.3

@dbu
Copy link
Member

dbu commented Feb 17, 2015

agreed, we can do a seo bundle 1.3 when we do the next general cmf release round and bump to sonata 2.4. minor versions don't cost us much.

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

Successfully merging this pull request may close these issues.

6 participants