Template is one of the meta data fields of the page.
So provided you get a reference to the page you created via
hm.createPage( "path" ), you could do page.getMetaData().setTemplate(
"templateName" ).
--David
Danny Gibbs wrote:
Hi,
I am using magnolia 3.0 rc3. I am trying to create a page in the jsp
code by the following:
HierarchyManager hm =
MgnlContext.getHierarchyManager(ContentRepository.WEBSITE);
hm.createPage("/pageName",
"newPage").createNodeData("title").setValue("Page Title");
This is creating the page, but I need to know how to set the template,
because when I try to view the newly created page it does not have a
template associated with it, so it results in an 404 error. But then
when I manually set the template in magnolia, the page is viewable.
Is there a way to set the template in the JSP code, or is there a
way for all these newly created pages to default to a template?
Thanks for your help,
Danny
--
David Smith
Network Operations Supervisor
Department of Entomology
Cornell University
2132 Comstock Hall
Ithaca, NY 14853
Phone: (607) 255-9571
Fax: (607) 255-0940
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------