Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

way of setting title and other pageish variables from content templates #33

Open
ghost opened this issue Aug 2, 2014 · 8 comments
Open

Comments

@ghost
Copy link

ghost commented Aug 2, 2014

atm it's impossible to set a page title from an included content template since it's inside a block already.

Did you already have an idea on how to handle that?

@ghost
Copy link
Author

ghost commented Aug 2, 2014

i just added this in the container_container for now as a quick hack

{% block page_title contentLocation|split(':')[2]|split('.')[0]|humanize %}

@ghost
Copy link
Author

ghost commented Aug 2, 2014

yeah i think we're gonna need a page object as per comments on #22

@ghost
Copy link
Author

ghost commented Aug 3, 2014

here's something that implements part of what we want. I'm not sure what the block bundle dep is all about though.
https://github.com/sonata-project/SonataSeoBundle

@vworldat
Copy link
Collaborator

vworldat commented Aug 4, 2014

I once tried adding a stylesheet from inside a static page. It doesn't work and it won't unless we change the way Twig renders the page. When the static content is loaded/parsed, the HTML head has already been finished and will not react to any variables set from anywhere.

The only way I can see is the page object you mentioned. Or some mechanism to wrap the whole page and modify the rendered content afterwards.

Oh my. This is becoming a CMS. 😉

@ghost
Copy link
Author

ghost commented Aug 4, 2014

i'd wondered about finding some way to integrate sculpin into symfony and make that a cms. I would have tried that if i didn't only need a couple of pages.

@vworldat
Copy link
Collaborator

vworldat commented Aug 4, 2014

Don't see the need in that. If someone only needs static pages and nothing else, they are fine with sculpin without Symfony (much less overhead, much faster).
If you need both dynamic and static content but want it to be faster, combine StaticPageContentBundle with some kind of proxy / caching and you are fine too. No need for sculpin there IMO.

@ghost
Copy link
Author

ghost commented Aug 4, 2014

i meant sculpin for the already built organizing style and the front matter parsing.

@ghost
Copy link
Author

ghost commented Aug 4, 2014

i talked to a friend of mine who ran into this issue, he wrote some twig functions to handle it. i think that the sonata seo bundle has similiar things

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

No branches or pull requests

1 participant