Sure, and I have at least one other toy to be posted (a diagnostic
taglib). Both will go up after I can get past my current deadline.
--David
Boris Kraft wrote:
Cool, thanks.
Stuff like this should really go into the wiki - can you add it there?
http://www.magnolia.info/wiki/
Thanks
Boris
On 20.03.2006, at 14:52, David Smith wrote:
I did this by creating a custom template with code to that searches
out all the required paragraphs and change them. By template here,
I mean page template, not pargraph template. Just create a page
based on the template and open it once, delete afterwards.
Quick and dirty code snippet, modify as necessary:
<jsp:directive.page import="info.magnolia.cms.core.Content"/>
<jsp:directive.page import="info.magnolia.cms.core.ItemType"/>
<jsp:directive.page import="info.magnolia.cms.core.NodeData"/>
<jsp:directive.page import="info.magnolia.cms.core.search.Query"/>
<jsp:directive.page
import="info.magnolia.cms.core.search.QueryResult"/>
<jsp:directive.page
import="info.magnolia.cms.security.SessionAccessControl"/>
<jsp:directive.page import="java.util.Collection"/>
<jsp:scriptlet><![CDATA[
try {
String nodeSearch = "//[EMAIL PROTECTED]'oldParagraphName']" ;
Query migrateQuery = SessionAccessControl.getQueryManager (
request ).createQuery( nodeSearch, "xpath") ;
QueryResult result = migrateQuery.execute();
Collection paraSet = result.getContent (
ItemType.CONTENTNODE.getSystemName() ) ;
while( paraSet.hasNext() ) {
Content pargraph = (Content)paraSet.next() ;
paragraph.getNodeData( "paragraph" ).setValue (
"newParagraphName" ) ;
paragraph.save() ;
}
} catch ( Exception e ) {
// Write a failure message of some sort.
}
]]></jsp:scriptlet>
--David
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]
On Mar 2, 2006, at 1:48 PM, Branden Root wrote:
What error message do you get in the error logs?
Branden Root
Senior Developer
Portent Interactive
On Mar 2, 2006, at 12:37 PM, Chems Touati wrote:
Hello,
Just a shot in the dark here..... but I've spent way too long
troubleshooting some of my custom templates. They seem to
include a reference to the Sample paragraphs, but I cannot
figure out were. When the samples folder is in /templates/ jsp/
all pages render fine. But if the sample templates directory
is missing..... no paragraph Templates are rendered.
Any tips, pointers, ideas to help get me moving again??
I've added configs in AdminCentral for my Templates in the
following places:
/modules/templating/dialogs/
/modules/templating/Paragraphs/
/modules/templating/Templates/
And all the JSPs have been manually copied to both instances.
Running Magnolia 2.1.5 on OSX Client 10.4
Thanks for your time.
regards,
//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
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------