Forums / Developer / Extracting a list of all inline images in an article

Extracting a list of all inline images in an article

Author Message

Raul R

Tuesday 17 February 2009 12:50:30 pm

I am not sure how to do this in either the template language or PHP. What I want to do is get a list of all the images that an article uses as well as extract their attributes such as filename, path, caption and credits.

Thanks

Gary Teh

Tuesday 17 February 2009 10:32:26 pm

You can easily do this in the template language the syntax should be something like the below

//you define $node_id of the article yourself 

{def $node=fetch( 'content', 'node', hash( 'node_id', $node_id ) )}

									{attribute_view_gui href=$node.url_alias|ezurl image_class=small attribute=$node.data_map.image}

http://name1price.com : Get a Cool website for yourself and also learn how to manage it. It is easy. Use it to get more customers for your business.