Fórumok

Nyitólap » Liferay Portal » English » 3. Development

Kombinált nézet Egyszerű nézet Fa-nézet
Szálak [ Előző | Következő ]
toggle
Lee Francis Wilhelmsen
Accessing the image description from Journal template (using velocity)
2009. április 21. 23:51
Válasz

Lee Francis Wilhelmsen

Rangsorolás: Junior Member

Hozzászólások: 40

Csatlakozás dátuma: 2007. július 27.

Legújabb hozzászólások

Hi

I have a number of images in my image gallery. These images have a description text assigned and I wish to use the image description in the image tag's alt attribute in a journal template.

So the journal structure may look like:

<root>
<dynamic-element name='image' type='image_gallery'></dynamic-element>
</root>

And in the journal template:

<img src="$image.getData()" width="42" height="19" alt="$image.get-the-image-description-here" />

Notice the bogus "$image.get-the-image-description-here" at the end. Is there a proper way to get to the image description?

Any ideas?
Aldo de Feo Martínez
RE: Accessing the image description from Journal template (using veloc
2009. április 22. 5:28
Válasz

Aldo de Feo Martínez

Rangsorolás: New Member

Hozzászólások: 17

Csatlakozás dátuma: 2009. február 20.

Legújabb hozzászólások

the same question over here! +1!!!!!!
Aldo de Feo Martínez
RE: Accessing the image description from Journal template (using veloc
2009. május 22. 4:31
Válasz

Aldo de Feo Martínez

Rangsorolás: New Member

Hozzászólások: 17

Csatlakozás dátuma: 2009. február 20.

Legújabb hozzászólások

The solution here!!!!!!!!!!!!
In Velocity template (5.1.2):
 1
 2#set ($imageService = $serviceLocator.findService("com.liferay.portlet.imagegallery.service.IGImageLocalService"))
 3....
 4....
 5....
 6#set ($info = $stringUtil.valueOf($image.data))
 7#set ($imageUuid = $httpUtil.getParameter($info, "uuid", false))
 8#set ($imageGroup = $httpUtil.getParameter($info, "groupId", false))
 9#set ($igimage = $imageService.getImageByUuidAndGroupId($imageUuid, $getterUtil.getLong($imageGroup)))
10#set ($imageSmallid = $igimage.getSmallImageId())
11#set ($imageLargeid = $igimage.getLargeImageId())
12#set ($imageDescription = $igimage.getDescription())
13
14#set ($urlLargeImage = "/image/image_gallery?img_id=$imageLargeid")
15#set ($urlSmallImage = "/image/image_gallery?img_id=$imageSmallid")
16
17<tr>
18    <td colspan="2">
19        <div style="float: left; padding-right: 10px;">
20            <a href="$urlLargeImage" target="_blank">
21                <img alt="$altImatgeResum.data" border="no" src="$urlSmallImage" title="$imageDescription" />
22            </a>
23        </div>
24        <div style="text-align: justify;">
25            $entrada.data
26        </div>
27    </td>
28</tr>


;D~~~~~~~~~~~~~~~~~~~~
Lee Francis Wilhelmsen
RE: Accessing the image description from Journal template (using veloc
2009. május 22. 6:05
Válasz

Lee Francis Wilhelmsen

Rangsorolás: Junior Member

Hozzászólások: 40

Csatlakozás dátuma: 2007. július 27.

Legújabb hozzászólások

Could you explain where you are getting the "altImatgeResum" variable from?
Aldo de Feo Martínez
RE: Accessing the image description from Journal template (using veloc
2009. július 15. 5:53
Válasz

Aldo de Feo Martínez

Rangsorolás: New Member

Hozzászólások: 17

Csatlakozás dátuma: 2009. február 20.

Legújabb hozzászólások

this variable from of portlet Journal, when you complete a journal with Structure and template and you complete the form....

when you create one structure, for witch row you insert on structure, you add a "name", this name is the variable....