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.

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 16:20:24
Script start
Timing: Jan 18 2025 16:20:24
Module start 'layout'
Timing: Jan 18 2025 16:20:24
Module start 'content'
Timing: Jan 18 2025 16:20:24
Module end 'content'
Timing: Jan 18 2025 16:20:24
Script end

Main resources:

Total runtime0.0141 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0047 589.1953152.6406
Module start 'layout' 0.00470.0024 741.835939.4766
Module start 'content' 0.00710.0051 781.312589.3984
Module end 'content' 0.01220.0018 870.710930.3047
Script end 0.0140  901.0156 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.002517.8374140.0002
Check MTime0.00117.5401140.0001
Mysql Total
Database connection0.00074.760910.0007
Mysqli_queries0.002014.063930.0007
Looping result0.00000.057710.0000
Template Total0.001510.610.0015
Template load0.00096.525510.0009
Template processing0.00064.048310.0006
Override
Cache load0.00075.030710.0007
General
dbfile0.00031.879980.0000
String conversion0.00000.057740.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs