Afficher un champ file

7 years 9 months ago #13699 by zimzoum10
Bonjour,

j'ai rajouté un champ "file" à mon contenu. Dans mon template, j'arrive bien à l'afficher grace à la méthode ->DISPLAY. Par contre, cela affiche suivant les options le nom du fichier, ou le MIME,...
J'aimerai savoir si c est possible de récupérer l'url du fichier afin d'afficher toujours le meme lien.
exemple:
[url=<?php echo $champ->DISPLAY;?>]cliquez ici[/url]

Il y a une solution? merci encore pour ce magnifique composant !

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

7 years 9 months ago #13704 by micker
Replied by micker on topic Afficher un champ file
hello
y a pas de souci
lis ca c'est toujour d'actualité
http://flexicontent.org/documentation/t ... ation.html
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.

7 years 9 months ago #13732 by zimzoum10
Replied by zimzoum10 on topic Afficher un champ file
bonjour,

soit je me suis mal exprimé, soit je n ai pas vu la réponse dans la doc que tu m as fourni.

J'ai tout à fait compris le role des templates.

Mon seul probleme est le suivant (field est de type FILE):
$field->display affiche trop d'informations. Je souhaiterai obtenir uniquement l'url du fichier "$field".

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

7 years 9 months ago #13734 by micker
Replied by micker on topic Afficher un champ file
hello peus tu me montrer ce que tu as et ce que tu voudrais ?
sinon il te faudra modifier les fichiers du plugin file
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.

7 years 9 months ago #13735 by zimzoum10
Replied by zimzoum10 on topic Afficher un champ file
dans mon item.php:
$this->fields['pdf63']->display

ce qui donne en html:
<form action="/cfatp/index.php?id=13&amp;cid=83&amp;fid=32&amp;task=download&amp;option=com_flexicontent&amp;Itemid=92" method="post" id="form-download-32-1"><img class="icon-mime" alt="pdf" src="/cfatp/components/com_flexicontent/assets/images/mime-icon-16/pdf.png">
&nbsp;
<input type="submit" value="Download" class="button" name="download-32[]">
</form>

je voudrais avoir seuelement:
"/cfatp/index.php?id=13&amp;cid=83&amp;fid=32&amp;task=download&amp;option=com_flexicontent&amp;Itemid=92"

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

7 years 9 months ago #13737 by micker
Replied by micker on topic Afficher un champ file
regarde coté du plugin (com_flexicontent\plugin ...)
et change le form action par un a href
non ?

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.

5 years 10 months ago #32942 by yopyop001
Replied by yopyop001 on topic Afficher un champ file
Bonjour,

Je déterre un post un peu vieux, mais si cela peut-être utile à quelqu'un et éventuellement être une option du champs 'File' :

Dans le plugin flexicontent (plugins/flexicontent_fields/file.php)

En ajoutant à la fin de la fonction onDisplayFieldValue le code :
$field->url = $dl_link;

On peut récupérer le lien en utilisant
$this->item->fields["field_name"]->url
dans le template

A plus tard

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

5 years 10 months ago #32944 by ggppdk
Replied by ggppdk on topic Afficher un champ file
Thanks, yopyop001
i ll add this variable 'url', but note it will be an array since file is multi-value.

The best place to add this is just after:
$field->{$prop}[] = $pretext . $str . $posttext;
add this (note the [] to make url variable an array since file field is multi-value)
$field->url[] = $dl_link;

and then inside use:
...->url[0]


-- 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
© 2018 Flexicontent. All Rights Reserved.