Welcome, Guest
Username: Password: Remember me

TOPIC: [ADDED] adding unique ID fields to the fly views of images

[ADDED] adding unique ID fields to the fly views of images 05 Jul 2012 11:15 #2764

  • cefnllys
  • cefnllys's Avatar
  • Offline
  • Premium Member
  • Posts: 102
  • Thank you received: 5
  • Karma: 1
Basically i need to add ID fields to each of my fly view image upload previews. Is there an easy way to do this with Jdom? I only need to distinguish bettween two diffrent IDs. e.g. I have an image field for a tilable background image and one for a logo upload. please help
Last Edit: 25 Jul 2012 13:46 by admin.
The administrator has disabled public write access.

Re: adding unique ID fields to the fly views of images 10 Jul 2012 12:40 #2776

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
Maybe you only need to use the RENAME property

ex:
{BASE}-tile.{MIMEXT}

and
{BASE}-logo.{MIMEXT}


Not possible yet :
{ID}-tile.{MIMEXT}
{ID}-logo.{MIMEXT}

For the moment, you can retreive your images files using a DB query (getting the item which indexes the images)

It is not possible because the upload is processed BEFORE the item creation. (in controller) So the ID is still unknown when file is uploaded. Maybe not a good choice for the moment. It will evolve.
It is on the roadmap, and for sure, after the V2.0
Coding is now a piece of cake
The administrator has disabled public write access.

Re: adding unique ID fields to the fly views of images 16 Jul 2012 10:00 #2799

  • cefnllys
  • cefnllys's Avatar
  • Offline
  • Premium Member
  • Posts: 102
  • Thank you received: 5
  • Karma: 1
hmm... i could possibly do it that way but it would mean re-writing a lot of code, is ther any way i can create two diffrent instances of the images fly view in jdom and call either depending on what i want the id to be?
The administrator has disabled public write access.

Re: adding unique ID fields to the fly views of images 16 Jul 2012 10:55 #2800

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
In the controller,
you can reverse the order of operating the saving function.

I mean, you first save the item, and then you call the upload function.


TODO :
In your context controller, (function save() )
- place the 'upload' call function at the end, or maybe only if the storing succeed`;
- send a new parameter in this function (id value)

In classes/file.php,
- add a parser tag ({ID} for instance)
- receive the id parameter for your new tag (replace the tag with this value)

That's it.
Coding is now a piece of cake
The administrator has disabled public write access.

Re: adding unique ID fields to the fly views of images 14 Oct 2012 09:59 #4474

  • admin
  • admin's Avatar
  • Online
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 984
  • Karma: 140
In V2.0 you can now use {ID} to reuse the item ID in the uploaded file name, or directory.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.097 seconds

Get Started