How to include CMS page content in a page
-
Hi,
I've created a CMS page and I would like to add its content (not just the url) in a section of page.
For example, the category page have a left column with filters... my idea is to remove filters and place in the left column the content of my CMS page.
How can I do it? -
For that, I suggest you create one route, controller, and view in the code and just add your category column code and cms code.
Or if you want this behavior in all CMS pages then I suggest you edit the layout of the CMS page.
-
ok, thank you, but in the second case (editing layout of the CMS page), how could I then include its content in my (for example) layered-navigation.blade.php?
-
It's just simple dynamic content coming from the variables. You just need to design according to your own and put that variable wherever you want.
Reference:
For velocity,
https://github.com/bagisto/bagisto/blob/0429fa1d4891e1cc9ab88312e73f697d98ab6bcb/packages/Webkul/Velocity/src/Resources/views/shop/cms/page.blade.php#L23 -
Hi,
I'm sorry, but may be my request was not clear. I have:- layered-navigation.blade.php
- myCMSpage defined in the admin panel
Now I'd want that the layered-navigation.blade.php shows the content of myCMSpage.
So, I don't need to edit ../cms/page.blade.php, but I need to edit layered-navigation.blade.php, may be replacing:
<layered-navigation></layered-navigation>
with such a code that invokes the content of myCMSpage.Thank you sincerily again for your help
-
In that case, you need to customize your own component.