Patriot
Patriot

Reputation: 312

Magnolia templates not published from Author to Public

I installed two instances of magnolia and converted one of them to public to receive publishing from the first instance.

I followed the hello-magnolia tutorial (from this link on the official site), created the template on the author instances and the page was created and previewd successfully. However, when it is published it appears on the public instance as unknown-template and generates an error. I copied the hello-magnolia module from the modules directory on the author instance to the public instance and the problem was solved.

When I followed the same tutorial but on a downloaded bundle, I did it not copy the template manually and it was published successfully.

Why do I have to copy the templates manually from author to public now and how I can have the same behaviour like the downloaded bundle?

Upvotes: 0

Views: 377

Answers (1)

Jan
Jan

Reputation: 4369

Since you don't link the tutorial you are referring to, one can only guess.
Quoting from one I've found "Magnolia continuously scans the file system folder defined by the magnolia.resources.dir property." Most likely reason for both author and public instance seeing templates instantly in case of tutorial is that both instances have the above mentioned property set to point to same directory.

In case of separate instances in your latter installation, this is most likely not the case. To change it (assuming both instances are running on same VM or share a network drive) you need to point them both to the same directory. The property magnolia.resource.dir can be set in magnolia.properties file located in the webapp representing each instance under WEB-INF/config/default/magnolia.properties.

That said, it is not necessarily best practice to point both instances to point to same version of files. If you do so, you might be limiting yourself in some scenarios. Say you are preparing some campaign or new version of the web and want to have new templates already available in author for editors while on public you want to maintain current view ... if both point to same folder you can't do so. OTOH maintenance is simpler and there's no errors caused by forgetting to update templates in each of the instances ... just saying so you know how the choices you make affect what you might be able to do in the future.

Upvotes: 0

Related Questions