Foren
provide link on images
mehdi sunasara, geändert vor 11 Jahren.
provide link on images
Junior Member Beiträge: 26 Beitrittsdatum: 12.09.12 Neueste Beiträge
Hello i am new to liferay velocity.
I have following structure code
And have Velocity Code as follows
It is not working.Please help me out
I have following structure code
<root>
<dynamic-element name="pages" type="link_to_layout" index-type="" repeatable="true">
<dynamic-element name="images" type="image_gallery" index-type="" repeatable="false"></dynamic-element>
</dynamic-element>
</root>
And have Velocity Code as follows
<ul>
#foreach($currentPage in $pages.getSiblings())
<li>
<a href="#$currentPage.getUrl()">
<img src="$currentPage.getChildren().getData()" alt="">
</a>
</li>
#end
</ul>
It is not working.Please help me out
Amruta Naidu, geändert vor 11 Jahren.
RE: provide link on images
New Member Beiträge: 12 Beitrittsdatum: 24.04.13 Neueste Beiträge
Hi Mehdi.....
its just a guess.......... remove '#' from href and try once......
its just a guess.......... remove '#' from href and try once......
mehdi sunasara, geändert vor 11 Jahren.
RE: provide link on images
Junior Member Beiträge: 26 Beitrittsdatum: 12.09.12 Neueste Beiträge
Thanks Amruta
After removing #,link is working but i am not able to see the image please help me out........
After removing #,link is working but i am not able to see the image please help me out........
Brijesh Desai, geändert vor 11 Jahren.
RE: provide link on images
New Member Beiträge: 6 Beitrittsdatum: 13.04.11 Neueste Beiträge
Not sure,
What following line is returning on img src attribute,
currentPage.getChildren().getData()
I don't think this is image, that's why it is not showing the image.
Put img path exactly from theme.
What following line is returning on img src attribute,
currentPage.getChildren().getData()
I don't think this is image, that's why it is not showing the image.
Put img path exactly from theme.
Brijesh Desai, geändert vor 11 Jahren.
RE: provide link on images
New Member Beiträge: 6 Beitrittsdatum: 13.04.11 Neueste Beiträge
If you are looking to provide link on images.
You can use, a href tag and put back ground image on that by css. this code you can do in VM file.
This will work for sure.
Regards
You can use, a href tag and put back ground image on that by css. this code you can do in VM file.
This will work for sure.
Regards
mehdi sunasara, geändert vor 11 Jahren.
RE: provide link on images (Antwort)
Junior Member Beiträge: 26 Beitrittsdatum: 12.09.12 Neueste Beiträge
Instead of Writing
<img src="$currentPage.getChildren().getData()" alt="" />
try
<img src="$currentPage.images.data" alt="" />
It is working.....
<img src="$currentPage.getChildren().getData()" alt="" />
try
<img src="$currentPage.images.data" alt="" />
It is working.....