sonata-project / SonataPageBundle

This bundle provides a Site and Page management through container and block services
https://docs.sonata-project.org/projects/SonataPageBundle
MIT License
218 stars 209 forks source link

Add sonata_page twig extension #1748

Closed mesiarm closed 6 months ago

mesiarm commented 9 months ago

Feature Request

Like recently added sonata_page_path please add sonata_page twig extension, which returns page object. Usable to get page name and other properties in twig.

eerison commented 9 months ago

Could you open feature issues that you want to implement, please.

mesiarm commented 8 months ago

Could you open feature issues that you want to implement, please.

Do you mean pull request?

eerison commented 8 months ago

Could you open feature issues that you want to implement, please.

Do you mean pull request?

Screenshot 2024-02-20 at 13 54 22
VincentLanglet commented 6 months ago

Like recently added sonata_page_path please add sonata_page twig extension, which returns page object. Usable to get page name and other properties in twig.

sonata_page_path is returning the path when you pass the page object.

If you want the page object, you'll need the identifier (and doing a request to your db) or the admin (and accessing with getSubject). There is no need for a twig extension for this. If the feature request is about something else, it requires more explanations