Hi everyone,
I'm trying to output various properties of an image asset, using an asset listing page.
%asset_contents% - works fine, displays the full <img> tag with width, height and alt text.
%asset_short_name% - works fine, displays the 'Title' of 'friendly name' for the image
%asset_image_caption% - doesn't return anything, and the image does have a caption filled in
So, my quetions are:
1 - how do I get the image caption to display?
2 - is there a way to return the alt text of an image on its own, rather than using the full %asset_contents% (I'd like to hard-code in image width and height, but return the alt of the image)
3 - Is there a way to have the image displayed in one area of the parse file, but display the caption in another. I could create a seperate asset list to do the same search but then just display the caption, but could I retrive the caption in the first asset list and use it to fill in a variable, and then use that later on in the parse file?
Many thanks!
Charlie.
Hi Charlie
The keyword you are looking for would be:
%asset_attribute_caption%
Find more keywords here:
http://matrixsecrets.com/keywords/#Image Keywords
Hi Dave,
Brilliant - have bookmarked the keyword list!
So, to move onto stage 2 of my design, is there a clever way to get the asset list to find the image caption, but then use it elsewhere in the design parse file.
Basically I have this in my design parse file:
<html code⦠>
[asset list to find the image (the image ID is stored in the page's metadata field) displays the whole <img> tag ]
<bit more html goes here>
[Now I need to get the caption from the image that I found in the asset list above, and display it here]
<last bit of html>
Or will I have to create another asset listing, just to show the caption?
Thanks!
[quote]
Find more keywords here:
http://matrixsecrets.com/keywords/#Image Keywords
[/quote]
Better to use the official documentation. This is the link for the image keywords:
http://manuals.matrix.squiz.net/keyword-replacements/chapters/image
Happy to see new Matrix user 
Using image caption again is possible with javascript (You have to write it by Yourself).
If You're not familiar with JS - second Asset Listing is the answer.
[quote]
Happy to see new Matrix user 
Using image caption again is possible with javascript (You have to write it by Yourself).
If You're not familiar with JS - second Asset Listing is the answer.
[/quote]
Managed to set a js variable with the caption, and then display it further down the parse file - thanks for all the advice!