Afficher le contenu d'un champ image

More
12 years 3 months ago #21139 by erehcab
Bonjour,

j'ai créé un champ image que j'ai lié au type article de base et j'aimerais l'afficher dans mon template mais lorsque que je lui demande la propriété display comme pour les mini gallery php me répond que la méthode n'existe pas ...
Code:
$this->items[0]->fields['mon_champ_image']->display
quelqu'un aurait'il une idée de ce qu'il faut faire pour récupérer au moins l'url de l'image histoire de la mettre dans l'attribut src d'une balise img ?

Voilà ce que je fais pour le moment :
Code:
<?php foreach ($this->items as $item) : ?> <img src="<?php echo $item->fields['field22']->display ?>" alt="" /> <?php endforeach ?>

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #21145 by erehcab
Je me suis fourvoyé, si j'utilise display comme dans mon premier post ça ne marchera jamais ...
Je pense plus l'utiliser de la sorte :
Code:
<?php foreach ($this->items as $item) : ?> <?php echo $item->fields['field22']->display ?> <?php endforeach ?>
En tout les cas ça ne fonctionne toujours pas ...

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #21146 by ggppdk
Which version are you using?

If you using v1.5.6 , either goto global config and set fields to be always created in item view, or goto the template and drag and drop the field in the renderonly position
by doing either the field html display will be created.


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #21159 by erehcab
Hello, this option was checked. Can you explain me why i can't use the display property ?

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #21160 by ggppdk
In my previous POST what i said applies for item view, if you need to use them in category view, put the field in 'renderonly' position of the category layout template.

The 'renderonly' position doesnot exist anywhere in the template it is just a dummy/fake position so that you can place there fields that you want to display manually.

(In global configuration you could enable creating fields always but this will make your category view slower if you have many items and fields that you do not use)

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #21199 by erehcab
I dont't find where i can put the field in renderonly, can you tell me please ?

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.355 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline