Afficher le contenu d'un champ image

More
14 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
14 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
14 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 review. Thanks!

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

More
14 years 2 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
14 years 2 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 review. Thanks!

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

More
14 years 2 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.

More
14 years 2 months ago #21209 by micker
hello
dans ton item.xml et category.xml
tu rajoute la position renderonly
apres ca sera dans ton admin
a+

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
14 years 2 months ago #21210 by ggppdk
Goto (backend) the templates manager tab, there you will see a list of the templates, click to open the category layout of your template , drag and drop the field into renderonly position.

-- If you have an old custom templatem then open in the folder: components/com_flexicontent/templates/mycustomtemplate/category.xml and put the renderonly position
Code:
... <fieldgroups> ... <group>somenname</group> <group>renderonly</group> </fieldgroups>

-- ALTERNATIVELY you can use:
Code:
<?php foreach ($this->items as $item) : ?> <?php FlexicontentFields::getFieldDisplay($item, 'field22'); ?> <?php echo $item->fields['field22']->label; ?> <?php echo $item->fields['field22']->display; ?> <?php endforeach ?>

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 review. Thanks!

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

More
14 years 2 months ago #21216 by erehcab
i have done it but i don't find it in the backend ...
Code:
<fieldgroups> <group>renderonly</group> </fieldgroups>
i go in flexicontent -> template .. and it's after this that i'm lost.

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

More
14 years 2 months ago #21219 by ggppdk
Forgot to say , you must clean cache so that the position will appear.

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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
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
Save