Hi Chems
Try
Content paragraphNode = Resource.getLocalContentNode(request); // or
whatever you like to take the paragraph
paragraphNode.getNodeData("paragraph").setValue("newDesiredParagraphTypeName");
paragraphNode.save();
Content page = Resource.getActivePage(request); // or whatever you like
to take the page
page.getMetaData().setTemplate("newDesiredTemplateName");
page.save();
that's all I think ...
Have fun ;)
Stojan
Chems Touati wrote:
Ok, so user error on this one. =P
It took me a while to figure out that paragraph data in Magnolia is
always associated with the paragraph Template that it was created
with. SO, if your content authors use a sampleTextImage paragraph
style to create a page while you are working on your own custom
Templates, the only way to change the paragraph Template that is used
in the page is to Export the tree to XML and do a find and replace to
change <sv:value>samples to the name of your custom paragraph template.
So, my new question: Is this really the best way to do it? Hardly
elegant, and if you are dealing with any heavy binary in your site
tree (i.e. PDFs, movies, hi-res graphics) a find and replace can take
a long time, or even crash BBEdit (any ideas on better tools to do
huge find/replace actions with?? Could this be done using the Jash
tools?).
Is the XML export/import the only way to change the paragraph
templates a site is using? Changing the templates a large magnolia
site is using then becomes very time consuming.
Are others using any different methods to change the paragraph
templates a site is using? Even to change the Page Templates a whole
site is using, you have to do it on a page by page basis. I would
really like to change the styles/templates a whole site uses without
having to do it on a page-by-page AND a paragraph-by-paragraph basis.
There has got to be a better way to get this to happen.
Thanks for your ideas.
Respect,
//cheMs
--
Chems Touati
Macintosh Specialist
Student Computing Labs, Marriott Library
University of Utah
801.585.9811
[EMAIL PROTECTED]
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------