Forums / Setup & design / 3.3: Getting the path to the original version of an image

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>