c33s / StaticPageContentBundle

provide static pages in symfony
5 stars 1 forks source link

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

Open ghost opened 10 years ago

ghost commented 10 years ago

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 commented 10 years ago

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

{% block page_title contentLocation|split(':')[2]|split('.')[0]|humanize %}
ghost commented 10 years ago

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

ghost commented 10 years ago

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 commented 10 years ago

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. :wink:

ghost commented 10 years ago

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 commented 10 years ago

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 commented 10 years ago

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

ghost commented 10 years ago

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