Foros de discusión
How to provide images using velocity template ?
Gurumurthy Godlaveeti, modificado hace 11 años.
How to provide images using velocity template ?
Regular Member Mensajes: 208 Fecha de incorporación: 12/08/11 Mensajes recientes
Hello There ,
I used velocity basic variables to get content or to link with other page also . but i am unable to get image using the below template code .
My Structure code is
And Template code is
I got below error , is any thing is wrong ?
I used velocity basic variables to get content or to link with other page also . but i am unable to get image using the below template code .
My Structure code is
<root>
<dynamic-element name="CSS" type="text_box" index-type="" repeatable="false"></dynamic-element>
<dynamic-element name="javascript" type="text_box" index-type="" repeatable="false"></dynamic-element>
<dynamic-element name="pages" type="link_to_layout" index-type="" repeatable="true">
<dynamic-element name="images" type="image" index-type="" repeatable="false"></dynamic-element>
</dynamic-element>
</root>
And Template code is
<style type="text/css">
$CSS.getData()
</style>
<script type="text/javascript">
$javascript.getData()
</script>
<figure>
<div class="rslides_container">
<ul class="rslides" id="slider1">
#foreach($currentPage in $pages.getSiblings())
<li>
<a href="#$currentPage.getUrl()">
<img src="$currentPage.getChildren().getUrl()" alt="">
</a>
</li>
#end
</ul>
</div>
</figure>
I got below error , is any thing is wrong ?
Current URL /web/securus/$currentPage.getChildren().getUrl() generates exception: null
Satheesh Ravi, modificado hace 11 años.
RE: How to provide images using velocity template ?
Junior Member Mensajes: 35 Fecha de incorporación: 25/11/11 Mensajes recientes
Hi,
Image gallery is the better way of adding image. You can use the following
<dynamic-element name='test' type='image_gallery' index-type='' repeatable='false'></dynamic-element>
$test.data would give the image path which can be used as image source.
Image gallery is the better way of adding image. You can use the following
<dynamic-element name='test' type='image_gallery' index-type='' repeatable='false'></dynamic-element>
$test.data would give the image path which can be used as image source.
mehdi sunasara, modificado hace 10 años.
RE: How to provide images using velocity template ?
Junior Member Mensajes: 26 Fecha de incorporación: 12/09/12 Mensajes recientes
Still doesnt work for me
James Falkner, modificado hace 10 años.
RE: How to provide images using velocity template ?
Liferay Legend Mensajes: 1399 Fecha de incorporación: 17/09/10 Mensajes recientesGurumurthy Godlaveeti:
Hello There ,
I used velocity basic variables to get content or to link with other page also . but i am unable to get image using the below template code .
My Structure code is<root> <dynamic-element name="CSS" type="text_box" index-type="" repeatable="false"></dynamic-element> <dynamic-element name="javascript" type="text_box" index-type="" repeatable="false"></dynamic-element> <dynamic-element name="pages" type="link_to_layout" index-type="" repeatable="true"> <dynamic-element name="images" type="image" index-type="" repeatable="false"></dynamic-element> </dynamic-element> </root>
And Template code is<style type="text/css"> $CSS.getData() </style> <script type="text/javascript"> $javascript.getData() </script> <figure> <div class="rslides_container"> <ul class="rslides" id="slider1"> #foreach($currentPage in $pages.getSiblings()) <li> <a href="#$currentPage.getUrl()"> <img src="$currentPage.getChildren().getUrl()" alt=""> </a> </li> #end </ul> </div> </figure>
I got below error , is any thing is wrong ?Current URL /web/securus/$currentPage.getChildren().getUrl() generates exception: null
Instead of
<img src="$currentPage.getChildren().getUrl()" alt="" />
try
<img src="$currentPage.images.data" alt="" />
Notice the more compact way of accessing children and their fields.
mehdi sunasara, modificado hace 10 años.
RE: How to provide images using velocity template ?
Junior Member Mensajes: 26 Fecha de incorporación: 12/09/12 Mensajes recientes
Thnx it is working
mohammad azaruddin, modificado hace 10 años.