By Nicolas OLIVIER on Tuesday, 29 May 2018
Posted in Feature Requests
Replies 24
Likes 0
Views 11.3K
Votes 0
Hi Geraint,
We have already talk about this few months ago but this time it's quite urgent for us.
We need the possibility to add a text for the link created by the eldownload custom field.

For example : the file is very_important_file.pdf and we want the text for the link be very important file (PDF, 3Mo, 15 pages).

Do you think this could be achieve shortly (in few weeks ?)

Thanks for your work on this ;-)
After hours : the links are good now ^^
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Sorry for the delay in responding - my telephone line and internet connection has been down so I'm forced to work with a tethered mobile phone connection with a 2G signal

I can easily change the custom field output to give you a raw URL for the file download - then you could add a second custom field for the displayed name and construct the output using wrappers. Is that a feasible solution in the short term?
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
Sorry to hear your difficulties.
Yes your proposition could be a thing ;-) Of course an all in one custom fields will be better (yeah yeah we are demanding ).
For my information, is it very muych complicated to create a custom fields with multiple input fields rather than a single fields ?

Thanks
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I have coded the option to output the raw value from the custom field - it will be included in the next build/release of EasyLayouts
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
after update we select "fields value" then "Display raw" but we still get the formatted value with <a> enclosure

We didn't have tried on another webiste for now.
Thanks
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I'm sorry - there was a typo in the modified code

Edit the file administrator/components/com_easylayouts/output/common/custom_field.php and change lin 66 from

if (isset($field["rawcustomfieldoutput"]) && $field["rawcustomfieldoutput"] == 1 && isset($this->fieldreference->rawvalue))

to

if (isset($field["customfieldoutputraw"]) && $field["customfieldoutputraw"] == 1 && isset($this->fieldreference->rawvalue))


I'll need to do a new release of EasyLayouts in the next day or two - I just realised that saving download field values when editing articles doesn't work in Joomla 3.8.10 without a different code change
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I just realised that saving download field values when editing articles doesn't work in Joomla 3.8.10 without a different code change


So ? We can't use it unitlyou have correct this save bug ?, that's it ?
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
code changes works.

An improvement that would be useful:
you should have a third choice in the field "Display formatted value?" which will give the link of the value.
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
code changes works.

An improvement that would be useful:
you should have a third choice in the field "Display formatted value?" which will give the link of the value.

I'm not sure I understand what you mean. By link to you mean the full <a> tag??
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
What I meant was.
In third choice, to be able to recover the whole url of the file.

See example url site (private) : button "fiche à télécharger"


example of the code that works:

$token = JSession::getFormToken();
$json = urlencode(json_encode(array('fieldid'=>$this->fieldreference->id,'article'=>$item->id)));
$downloadpath = JRoute::_("index.php?option=com_content&task=gwejson&file=downloadfile&path=plugin&folder=fields&plugin=eldownload&token=$token", false)."&json=$json";
$value=$downloadpath;
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
So you'd like the option to output the full <a> tag link to the download, the file name or the href that points to the validated download?
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi,
we you'd like "href" that points to the validated download.

Thanks
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I can add a config option to the eldownload field type so that it will output the href and not the <a> tag - but it would ALWAYS do that per field you define. Would that be ok?
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi ! Yes it's can do. We have do this with "hacking" the fields render (use without easylayout) and in the article override we combine your eldownload field and a field text for creating a nice link. The best is to havea text input and add this in the final rendering instead of the

$value = (string) $field->value;
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Try this version of the plugin - it has a new option when you edit the field in com_fields.
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok we use it with this code :

<?php if ((!empty($this->item->jcfields[11]->value)) && (!empty($this->item->jcfields[12]->value))) : ?>
<div class="lien"><a href="<?php echo $this->item->jcfields[11]->value; ?>" title="download file"><?php echo $this->item->jcfields[12]->value; ?></a> </div>
<?php endif ; ?>

where id 11 is eldownload and id 12 a simple text field

But now we have a serious issue : when we change the file in the fields the results en frontend never change. The simple text change in front if we change it in backoffice. If it can help you, if we show the plain link instead of href, we get a link with the name of the changed/new selected file BUT the files downloded is still the old one. As if the token or whatever stick to the first file we select.
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I come back After doing some tests : the issue looks liké a cache issue because thé information on thé database are good but thé link still give us old file. But I dont think it s a cache issue because when WE change thé other fields liké text they don t have any issues.
Where Can I look ? I précise again the fields issue install alone not with thé full easylayout pack
Thanks
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
can you give me the login details so I can take a look?

p.s. sorry for the slow response
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
I transmit you the information. For your testing : change mulmitple times the files. We see the issue sometimes after one change sometimes after 2 or 3 changes. THe render is by custom code (cf post #15)
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
We are in great trouble here ! My client want this functionnal now and we don't have any clue on where is the issue from. Of course we have try to clean every cache.
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
Is there anybody here ?
·
6 years ago
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post