Foros de discusión

Layout Template?

Stefan Elwesthål, modificado hace 16 años.

Layout Template?

New Member Mensajes: 12 Fecha de incorporación: 20/11/07 Mensajes recientes
I was planning to play around with creating a new Layout template for my newly created (and oh so joyful) theme.

But, what is the correct way to achieve this? I searched and found http://wiki.liferay.com/index.php/Layout_Template that description but not the sample .war file that's mentioned in there.

If I download the portal source i can find a couple of tpl's in there but no instructions on how I actually deploy my modified versions in a correct way.

Are there any "by the book" instructions to read?

Regards
thumbnail
Roman Hoyenko, modificado hace 16 años.

RE: Layout Template?

Liferay Master Mensajes: 878 Fecha de incorporación: 8/10/07 Mensajes recientes
That is quite easy to do.

Create *.tpl file in ROOT.war\layouttpl\custom\ and corresponding .png file.

The tpl file is a velocity file, you can
It is usually a table or a set of divs .

The typical structure is

		
			$processor.processColumn("column-1")
		

This creates an area where the portlets could be added. You can create as many of the areas like that as you want.

Another thing to take care about is the WEB-INF/liferay-layout-templates.xml (as well as WEB-INF/liferay-layout-templates-ext.xml).
Add something like:

		<layout-template id="1_column" name="1 Column">
			<template-path>/layouttpl/custom/1_column.tpl</template-path>
			<wap-template-path>/layouttpl/custom/1_column.wap.tpl</wap-template-path>
			<thumbnail-path>/layouttpl/custom/1_column.png</thumbnail-path>
		</layout-template>


You can also specify wap layout there. You would need to restart liferay for changes to take effect. I did't do changes in ext. environment, I just added files to deployed liferay, but I am sure you could do that in ext.

I added some data to this wiki article:
http://wiki.liferay.com/index.php/Layout_Template
thumbnail
ARCHI MADHU, modificado hace 16 años.

RE: Layout Template?

Regular Member Mensajes: 237 Fecha de incorporación: 25/03/08 Mensajes recientes
you can make your own .tpl which is very simple u have to only define rows n colums of ur table accroding to ur layout requirement in ..\tomcat\webapps\ROOT\layouttpl\custom and also create a .png file as per ur layout and


In ..\tomcat1\webapps\ROOT\WEB-INF\liferay-layout-templates (XML) file u need to add a tag inside custom tag like


<layout-template id="NewLayout" name="NewLayoutName">
<template-path>/layouttpl/custom/NewLayout.tpl</template-path>
<wap-template-path>/layouttpl/custom/NewLaout.wap.tpl</wap-template-path>
<thumbnail-path>/layouttpl/custom/NewLayout.png</thumbnail-path>
<roles>
<role-name>User</role-name>
</roles>
</layout-template>

U need to restart the tomcat n u can see your new layout by clicking change layout............emoticon
Hari Krishnan R, modificado hace 15 años.

RE: Layout Template?

Junior Member Mensajes: 60 Fecha de incorporación: 16/12/08 Mensajes recientes
Hi Madhu,

I am new persion in liferay Me too want to design one new template…
At liferay-layout-templates(XML) how can I define a rows and columns, can I give one simple example.. plz

Thanks in advance…
thumbnail
Archi Madhu, modificado hace 15 años.

RE: Layout Template?

Regular Member Mensajes: 237 Fecha de incorporación: 25/03/08 Mensajes recientes
Hi,

It is very simple just check some files situated tomcat\webapps\ROOT\layouttpl\custom

There you will see .tpl files see them you will get clear idea of it, very simple as HTML tables.
Hari Krishnan R, modificado hace 15 años.

RE: Layout Template?

Junior Member Mensajes: 60 Fecha de incorporación: 16/12/08 Mensajes recientes
Hi madhu,

Thanks for your quick reply and very good guidance; I had another one doubt,
I need to create a simple application form, I can’t cal an action once submitting the form...
Can u explain me , plz……


help me madhu plz....
thumbnail
Archi Madhu, modificado hace 15 años.

RE: Layout Template?

Regular Member Mensajes: 237 Fecha de incorporación: 25/03/08 Mensajes recientes
Hi

Have you made a new portlet and calling action of that form?
I am sorry could not get you exactly
Hari Krishnan R, modificado hace 15 años.

RE: Layout Template?

Junior Member Mensajes: 60 Fecha de incorporación: 16/12/08 Mensajes recientes
Thanks for your reply Madhu,

My new templates are working well, thanks for your guidance…

I need to place the application form in the guest page of liferay, I want to write actions in that form. How can I implement the actions using existing portlets (e.g. journal, journal content, journal article)? Or is there any other way to implement actions? Or is a new portlet necessary?


Thanks in advance…