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

Add twig extension to update seo page #263

Merged

Conversation

benglass
Copy link
Member

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? ??? (117 deprecation warnings but tests pass)
Fixed tickets #146
License MIT
Doc PR symfony-cmf/symfony-cmf-docs#705
  • Pull requests for docs
  • Determine if extension dependency on seo presentation should be moved into a SeoHelper
  • Tests?

public function getFunctions()
{
return array(
new \Twig_SimpleFunction('cmf_seo_update_seo_page',
Copy link
Member

Choose a reason for hiding this comment

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

why do we call this "update seo page"? i saw the php method is called that way, but the naming seems confused.

  • is it not rather a set?
  • and why seo page?

what about setSeoInformationFromContent($content)? and naming the twig method accordingly? we would need to keep the old php method for BC of course.

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 agree one the name, it seems to be a case where the fact that sonata seo bundle is being used is being exposed perhaps unnecessarily. I think update rather than set may be more correct, however, because some of the data is merged rather than overriden? I'm not 100% sure on this. I think you are saying this but if we are going to change the name here we should probably also change the SeoPresentationInterface method as well and deprecate the old one.

Copy link
Member Author

Choose a reason for hiding this comment

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

Perhaps updateSeoMetadataFromContent($content) ?

Copy link
Member Author

Choose a reason for hiding this comment

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

@dbu not sure how you are want to proceed with this. I'm happy to rename the public method in the PHP class and twig extension and add a deprecated comment, dunno if anyone else wants to weigh in on what the new name should be. I'd lean towards Metadata vs. information for consistency but I can see the case for set or update.

Copy link
Member

Choose a reason for hiding this comment

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

sorry for not being responsive, i was away. i created #264 as its an interface change.

for the twig function, could we call it cmf_seo_update_from_document? the name you currently have looks weird with the repeated seo. and i rather have a good name here than exact naming consistency with something we agree is not well named.

@ElectricMaxxx wdyt?

Copy link
Member

Choose a reason for hiding this comment

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

ups, you are correct. cmf_seo_update_from_model then? (i guess i know why we ended up with "page" before, but i think page is weird. its probably because in sonata they where thinking about pages from SonataPageBundle)

Copy link
Member

Choose a reason for hiding this comment

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

so this would be cmf_seo_update_from. a bit weird. maybe cmf_seo_update_metadata?

Copy link
Member Author

Choose a reason for hiding this comment

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

Should we just use the same name for PresentationInterface and this, your recommended updateMetadata

SeoPresentation::updateMetadata($content)
cmf_seo_update_metadata($content)

Copy link
Member

Choose a reason for hiding this comment

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

yes, thats it. lets go with that. can you update this PR? the work on 2.0 has not yet started, so #264 does not have to happen soon.

Copy link
Member Author

Choose a reason for hiding this comment

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

Renamed to cmf_seo_update_metadata and docs PR updated

@dbu
Copy link
Member

dbu commented Sep 30, 2015

this looks good, thanks! can you please add a note to the CHANGELOG.md file and squash the commits? if you want to add a test, go for it but i can merge without it.

@dbu
Copy link
Member

dbu commented Sep 30, 2015

the deprecation warnings are because of dependencies like sonata.

Add tagged service definition for twig extension
Add note to changelog
@benglass benglass force-pushed the add_twig_extension_update_seo_page branch from ffe6d46 to c1c3467 Compare September 30, 2015 16:58
@benglass
Copy link
Member Author

@dbu Commits squash, changelog updated. I don't think I'm likely to get tests together for this any time soon and it doesnt really seem like its doing very much (just proxying to another method).

@lsmith77 lsmith77 added review and removed wip/poc labels Oct 1, 2015
dbu added a commit that referenced this pull request Oct 1, 2015
@dbu dbu merged commit 8c48d29 into symfony-cmf:master Oct 1, 2015
@lsmith77 lsmith77 removed the review label Oct 1, 2015
@dbu
Copy link
Member

dbu commented Oct 1, 2015

thanks ben!

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.

3 participants