Jaimy
Jaimy

Reputation: 517

Template changes not showing with 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?

Upvotes: 5

Views: 3355

Answers (2)

Icarus
Icarus

Reputation: 1864

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),

Upvotes: 8

Jaimy
Jaimy

Reputation: 517

So I found the solution. I ran the command rm -rf var/cache from the project directory and then the Twig changes were rendered on the page. So Icarus's answer was right, but for some reason the commands he said, didn't work for both my problems.

Upvotes: 2

Related Questions