Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Template changes not showing with Sulu

Tags:

php

symfony

sulu

When I bootstrap a new project using the latest version and documentation, and then add some properties to the homepage.xml or render some text in the homepage.html.twig nothing changes.

In homepage.xml I added this

<property name="header" type="media_selection">
     <meta>
         <title lang="en">Header</title>
     </meta>
</property>

directly below the article property, and when I go to the admin page, the header doesn't show up.

Same thing with small changes to the twig file. When I dump the content var there, nothing shows up.

Any ideas on what the problem might be?

like image 357
Jaimy Avatar asked Jan 30 '23 22:01

Jaimy


1 Answers

I am not familiar with Sulu, but I am guessing that this is a Symfony related issue and you are seeing a cached version. Try clearing the cache (see How to Use the Console):

Symfony Console

For the production environment:

php bin/console cache:clear --no-warmup --env=prod

For the development environment:

php bin/console cache:clear --no-warmup --env=dev

Sulu Console

According to the comment by Daniel Rotter, the console for Sulu is slightly different, try:

php bin/adminconsole cache:clear --no-warmup --env=dev
php bin/websiteconsole cache:clear --no-warmup --env=dev

This is untested since I have no Sulu installation ready to try it. Confirmed by Daniel Rotteer (see comments),

like image 154
Icarus Avatar answered Feb 02 '23 10:02

Icarus