Fórum

How to read Velocity Template file in Liferay ?

thumbnail
Gaurang Sheladia, modificado 13 Anos atrás.

How to read Velocity Template file in Liferay ?

Regular Member Postagens: 159 Data de Entrada: 15/02/09 Postagens Recentes
Hi All,

Does anyone knows that how to read velocity template file from liferay plugin portlet?

Acutally i want to read one .vm file from my portlet.


Any suggestion would really appreciated.


Thanks in advance.

Thanks,
Gaurang
thumbnail
Gaurang Sheladia, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?[SOLVED]

Regular Member Postagens: 159 Data de Entrada: 15/02/09 Postagens Recentes
Hi All,

Finally i have done it with Liferay API.

Regards,
Gaurang
thumbnail
Simon Gołębiewski, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?[SOLVED]

Regular Member Postagens: 246 Data de Entrada: 08/06/09 Postagens Recentes
Can you post how?
thumbnail
Gaurang Sheladia, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?[SOLVED]

Regular Member Postagens: 159 Data de Entrada: 15/02/09 Postagens Recentes
Hi Simon,

Yes i am definitely posting the solution.

I have done this with Liferay API as

InputStream is = MycustomPortlet.class.getClassLoader().getResourceAsStream("resource/MyInfo.vm");


Let me know if you need any more info.

Hope it will help.

Best,
Gaurang Sheladia
Gaurang G, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?

New Member Postagens: 16 Data de Entrada: 28/04/10 Postagens Recentes
Hi Gaurang,

A newbie question,
It is possible to check what all functions are available on custom velocity variables (variable that I define in the structure).?

eg. I created a structure with a Link (named "link") of type "Link to Page" and used
link.getUrl() to get the URL of the linked page. So I was wondering how to check of the other variables that are available with other types (eg. other then getUrl() as in this case).
thumbnail
Gaurang Sheladia, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?

Regular Member Postagens: 159 Data de Entrada: 15/02/09 Postagens Recentes
Hi Gaurang,

Are you talking about the Journal Structure Velocity variable that we are using for Article ?

Please clarify. I Will respond you ASAP.

Thanks,
Gaurang
Gaurang G, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?

New Member Postagens: 16 Data de Entrada: 28/04/10 Postagens Recentes
Gaurang Sheladia:
Hi Gaurang,

Are you talking about the Journal Structure Velocity variable that we are using for Article ?

Please clarify. I Will respond you ASAP.

Thanks,
Gaurang


Hi Gaurang,

Indeed, I was referring to the same. I was looking for what all functions are available on the variables we can create. getUrl() is one such function on type "Link to Page".
thumbnail
vijay pandey, modificado 13 Anos atrás.

how we include jsp/html file in template file(.tpl)

Junior Member Postagens: 44 Data de Entrada: 01/09/10 Postagens Recentes


hi
Can we include any jsp/html file in .tpl file when we going to making template development ..
If yes the how we can include ..

Please help
Thanks in advance
thumbnail
ankit yakkundi, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?

Regular Member Postagens: 221 Data de Entrada: 05/03/10 Postagens Recentes
Hi Gaurang..
I have some issues with Templates in Liferay ,hoping that you can solve my doubts.

1) How to create JSP templates? There are no samples and documentation available for JSP-based templates in forums/technical documentation.

2) How to incorporate css/htmls received from a web designer into a velocity template; Assuming completely different look and feel. Do you have any examples?

These are the two issues i am facing, can i get ant sample code or documentation for the same and for learning velocity Template??


Thanks in advance..
Any idea or suggestions are welcome..emoticon
thumbnail
Gaurav Jain, modificado 13 Anos atrás.

RE: How to read Velocity Template file in Liferay ?

Regular Member Postagens: 145 Data de Entrada: 31/01/11 Postagens Recentes
ankit yakkundi:


1) How to create JSP templates? There are no samples and documentation available for JSP-based templates in forums/technical documentation.


Even I am curious to know emoticon

ankit yakkundi:

2) How to incorporate css/htmls received from a web designer into a velocity template; Assuming completely different look and feel. Do you have any examples?



You can create vm templates just like html page (incorporating vm power).

For example:
<style>
your css goes here...
</style>

<div class="any_class">
#if ($link.getData() != "")
<a href="$link.getData()">
#end
<img alt="" src="$image.getData()" />
#if ($link.getData() != "")
</a>
#end
</div>


Or you can you can just use html tags with proper class and id attributes in vm files and add your css in theme.
thumbnail
vijay pandey, modificado 10 Anos atrás.

RE: How to read Velocity Template file in Liferay ?

Junior Member Postagens: 44 Data de Entrada: 01/09/10 Postagens Recentes
Thnaks but instead of using JSP template ,you can use .vm templates in liferay that is easily modifiable .