Récupérer dans des champs la taille X, taille Y et le poids d'une image

More
9 years 6 days ago - 9 years 6 days ago #58455 by alain_grach
Bonjour,

Je cherche à récupérer facilement dans un champ personnalisé la taille X d'une image présente dans un champ "image or Gallery" du même article, et idem pour la taille Y et le poids de cette image.
lien du site : parisdespeintres.fr/index.php/les-tableaux/item/1151-test
Merci
Last edit: 9 years 6 days ago by alain_grach. Reason: correction du lien

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

More
9 years 5 days ago - 9 years 5 days ago #58484 by ggppdk
Hello

for image field, add it to any template position so that it gets created

Then, the filesystem page for images in image field can be found:
// the following are arrays do a print_r on them
Code:
$field->thumbs_path['backend'][] $field->thumbs_path['small'][] $field->thumbs_path['medium'][] $field->thumbs_path['large'][] $field->thumbs_path['original'][]

you can use $field inside an field position or do:
Code:
$field = $item->fields['thename_of_my_field'];

so e.g.
Code:
if ( isset($field->thumbs_path['large'][0]) ) { $img_path = $field->thumbs_path['large'][0]; list($width, $height) = getimagesize($img_path); echo "width: " . $width . "<br />"; echo "height: " . $height; }


-- 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...
Last edit: 9 years 5 days ago by ggppdk.

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.314 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