3.3: Getting the path to the original version of an image

Author Message

Alex Jones

Tuesday 02 March 2004 1:04:56 pm

I am setting up some code to display a random image background. The images are to be pulled from a folder (#522) within the Media section. As I am using CSS, I need the path to the original version of the image, but am not able to generate it as simply as I would like.

The code:

{let SiteTitleHeader=fetch(content,tree,hash(parent_node_id,522,
                                             class_filter_type,include,
                                             class_filter_array, array(5)))|shuffle}
  {attribute_view_gui attribute=$SiteTitleHeader.0.data_map.image image_class=original}<br />
  1. {$SiteTitleHeader.0.data_map.image.url_alias}<br>
  2. {$SiteTitleHeader.0.data_map.image[original].url_alias}<br>
  3. {$SiteTitleHeader.0.data_map.image.content[original].full_path}
{/let}

The shuffle function works perfectly, a random image is pulled each time. But, for some reason I cannot display the path to the image which is what I really need.

I am running 3.3.

Any ideas are appreciated!

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Jan Borsodi

Thursday 04 March 2004 4:36:13 am

Your 3rd line should do the trick, you can also write it like:

{$SiteTitleHeader.0.data_map.image.content.original.url}

Do you get any errors or warnings (check debug)?

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Alex Jones

Thursday 04 March 2004 6:57:38 am

There appears to be a problem with the eZimage class, specifically within <i>ezimagealiashandler.php</i>. Here's the debug info:

<b>Warning: PHP</b>
array_merge(): Argument #2 is not an array in /x/local/www/cuttingedge.data/ez/kernel/classes/ezcontentcache.php on line 67
<b>Warning: eZModuleOperationInfo::execute </b>
Missing main operation memento for key: ba704d646a75aca8247559105204c14e
<b>Warning: PHP</b>
array_merge(): Argument #2 is not an array in /x/local/www/cuttingedge.data/ez/kernel/classes/ezcontentcache.php on line 67
<b>Warning: PHP</b>
Undefined variable: nodePath in /x/local/www/cuttingedge.data/ez/kernel/classes/ezcontentobjecttreenode.php on line 906
<b>Warning: ezi18n </b>
No translation for file(translation.ts) in context(kernel/classes/datatypes): 'Image' with comment(Datatype name)
<b>Error: eZTSTranslator::loadTranslationFile</b>
Could not load translation file: share/translations/eng-US/translation.ts
<b>Warning: eZTranslationCache::setContextCache</b>
Translation cache for context 'cachecontexts' already exists
<b>Warning: ezi18n</b>
No translation for file(translation.ts) in context(kernel/classes/datatypes): 'Text line' with comment(Datatype name)
<b>Warning: PHP</b>
Undefined property: DataTypeCustom in /x/local/www/cuttingedge.data/ez/kernel/classes/datatypes/ezimage/ezimagealiashandler.php on line 588
<b>Warning: PHP</b>
Undefined variable: imageRow in /x/local/www/cuttingedge.data/ez/kernel/classes/datatypes/ezimage/ezimagealiashandler.php on line 861

Also, it will timeout if I try to use number 3, or the code Jan provided.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

Alex Jones

Thursday 04 March 2004 7:38:06 am

I think I might have found the problem. After reading this bug report (http://ez.no/community/bug_reports/critical_cache_template_compile_fails_with_fatal_errors_image_troubles) I turned off template compiling. Now the code that Jan provided, and version 3 both work.

It looks like I need to upgrade to 3.3.3 from my current version of 3.3.2.

Alex

Alex
[ bald_technologist on the IRC channel (irc.freenode.net): #eZpublish ]

<i>When in doubt, clear the cache.</i>

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 22:12:10
Script start
Timing: Jan 18 2025 22:12:10
Module start 'layout'
Timing: Jan 18 2025 22:12:10
Module start 'content'
Timing: Jan 18 2025 22:12:10
Module end 'content'
Timing: Jan 18 2025 22:12:10
Script end

Main resources:

Total runtime0.8641 sec
Peak memory usage4,096.0000 KB
Database Queries60

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0060 589.6016152.6563
Module start 'layout' 0.00600.0033 742.257839.5078
Module start 'content' 0.00930.8534 781.7656559.5703
Module end 'content' 0.86260.0014 1,341.335916.0938
Script end 0.8641  1,357.4297 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3752160.0002
Check MTime0.00130.1493160.0001
Mysql Total
Database connection0.00080.096210.0008
Mysqli_queries0.802592.8671600.0134
Looping result0.00060.0666580.0000
Template Total0.831396.220.4156
Template load0.00210.243620.0011
Template processing0.829295.956020.4146
Template load and register function0.00010.009010.0001
states
state_id_array0.00100.120610.0010
state_identifier_array0.00120.136320.0006
Override
Cache load0.00180.2139460.0000
Sytem overhead
Fetch class attribute can translate value0.00100.115120.0005
Fetch class attribute name0.00120.142060.0002
XML
Image XML parsing0.00080.094420.0004
class_abstraction
Instantiating content class attribute0.00000.002280.0000
General
dbfile0.00140.1629230.0001
String conversion0.00000.001040.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
2content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs