Adi De Masi wrote:

> I moved some Template-Definition to another module. But I can't change the 
> template of the content-nodes i already set up.
> 
> It would just require to change the module-prefix of the templates.
> 
> In the JCQ-Query-App I can see the property of the template:
> /Home/Section/About/content/0/mgnl:template=standard-templating-kit:components/content/stkMyTemplate
> 
> Nevertheless in the JCQ-Browser this property "[b]mgnl:template[/b]" is not 
> visible and therefore can't be changed.
> 
> Is there a solution to change this template?

You can always do this using the Groovy console (or Openmind's Groovy Shell 
module if you install that one). Something like this (not tested, sorry):

----
import info.magnolia.jcr.util.MetaDataUtil
import info.magnolia.jcr.util.SessionUtil
import info.magnolia.repository.RepositoryConstants
import javax.jcr.Node

Node node = SessionUtil.getNode(RepositoryConstants.WEBSITE, 
'/Home/Section/About/content/0')
MetaData metaData = MetaDataUtil.getMetaData(node)
metaData.setTemplate('YOUR_NEW_TEMPLATE')
node.getSession().save()
----

You could also do this via a Command implementation in Java for instance, but 
for small one-off operations like these I like to use Groovy.

If you have multiple nodes you need to modify you could do this in a loop (use 
QueryUtil is you want to gather your nodes via a JCR query).

Nils.

----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------

Reply via email to