issue with image element display in a list

kouros91

Member
Hi.
I have a php_events (on load) routine in a list which changes path and file of picture of "image element" depending of another element nbjoursavtecheance ( number od days between now and a date element).
When picture changes, it's the path name and filename wxhich are displayed instead of picture.
I must reload again the list to have picture display
How can i do for this issue ?

Thank you
Nicolas
 
I'd have to see your site, and exactly what you are doing in your code.

Are you using AJAX navigation?

-- hugh
 
My site is in local for now. Yes Ajax navigation. I have an element image and i change filename of the picture depending of another element.
With php_events plugin ofmy list in ONLOAD , i take elements with :
$data = $model->getData();

foreach ($data as $group)
{
foreach ($group as $row)
{
$this_user_idadhsymp = $row->table_adhcont2___IDADHSYMP_raw;
$this_user_adhesionactive = $row->table_adhcont2___ADHESIONACTIVE_raw;


etc etc

and depending of the value of my variables , i put anither picture to my element image as :

$row->table_adhcont2___IMAGEALERTEFINADHESION = (string) $this_user_imagealertefinadhesionnew;

and i write into the db too.

The code runs correctly but, instead of picture of my image element, i see in the list the filename.
I must reload again the list to see the picture. It's the same thing when the value of my image element changes.

I must reload the list to see the new picture.
 
Here is
first before reload list when image is changed with the php_events onload plugin list
and second after reload list
upload_2017-1-9_0-27-42.png upload_2017-1-9_0-27-3.png
 
Last edited:
With or Without ajax navigation it's the same.
Is iot possible to "refresh" image element with the new value in raw->table_adhcont2___IMAGEALERTEADHESION ?

When i put code in preload , it makes error server.

Perhaps, i must try to read elements value with queries instead of $data = $model->getData();
and make this query in preload.
 
Last edited:
Ah OK. Well you need to include the markup for the image tag when you set the non-raw value. So <img src="..." />. At the point that plugin runs, the list data has already been rendered for display, which in the case of an image element includes building the img tag.

Inspect your page to see the exact markup we use for images. I can't remember offhand if we include classes or any other styling on them.

-- hugh
 
I see : <img src="http://localhost/Glyco363/images/Icones/AdhesionActive/button-blue.png" alt="images/Icones/AdhesionActive/button-blue.png" />
in the source but i can't make the string http://localhost/ , cause on line it will not work. How can i do ?
I write :
$row->table_adhcont2___IMAGEALERTEFINADHESION ='<img src="'.(string) $this_user_imagealertefinadhesionnew.'"/>';
when $this_user_imagealertefinadhesionnew = '/images/Icones/AdhesionActive/button-violet.png' but it does not display my icon.
 
Last edited:
Try ...

Code:
$row->table_adhcont2___IMAGEALERTEFINADHESION ='<img src="' . COM_FABRIK_LIVESITE . (string) $this_user_imagealertefinadhesionnew . '"/>';

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top