You need to be logged in to post in the forum - Log In

An active JCE Pro Subscription is required to post in the forum - Buy a Subscription

  Thursday, 06 July 2023
  3 Replies
  1.1K Visits
Hi

I really like your custom field (media field) to extend the fields of the articles.

For a new project, we would like to allow images to be uploaded only to the folder that is named with the ID of the article (for example, images/news/1234 if the id of the article is 1234). However, in the current version of the plugin it is only possible to specify a path (images/news/), but not the ID.

Is there a possibility to extend the field with a parameter so that the above can be implemented? That would be a really useful feature.

Regards
Stef
more than a month ago
·
#114123
Accepted Answer
The article id is only available once an article has been created (ie: saved). This means that if you attempted to upload an image using a path that contained the id, before the article was saved, then it would be uploaded to a different folder, eg: images/news/0 than the one intended for the article.

For this reason, dynamic variables like id are not available for the File Directory Path.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#114123
Accepted Answer
The article id is only available once an article has been created (ie: saved). This means that if you attempted to upload an image using a path that contained the id, before the article was saved, then it would be uploaded to a different folder, eg: images/news/0 than the one intended for the article.

For this reason, dynamic variables like id are not available for the File Directory Path.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

more than a month ago
·
#114125
Thanks for the quick reply, Ryan.

I can understand your reasoning, somehow it seems to work though. Tassos has such a solution on offer (https://www.tassos.gr/joomla-extensions/advanced-custom-fields/docs/how-to-add-a-file-upload-field-in-joomla-forms#settings). I just tested it, it works as desired. Maybe the extension can serve as an inspiration, how this feature could be implemented in your custom field.
smartweb selected the reply #114123 as the answer for this post — 7 months ago
more than a month ago
·
#114126
I'll look into it. It does look feasible, with the caveat I highlighted above.

Just because you're not paranoid doesn't mean everybody isn't out to get you.

  • Page :
  • 1
There are no replies made for this post yet.
Be one of the first to reply to this post!