Keyword

frontend edit changes creation date

  • Sebastian van Greunen
  • Sebastian van Greunen's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 3 weeks ago #99665 by Sebastian van Greunen
frontend edit changes creation date was created by Sebastian van Greunen
I have set category list views to shoe the creation date. I have noticed that if an item is edited from the frontend form, the creation date is changed along with the modified date. Seems a bit wierd, no?

 

I don't want every edited item to show as a new item as it defeats the point of latest items.

 

how can this be changed? thanks

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

More
13 years 3 weeks ago #99666 by Jiliko.net
Replied by Jiliko.net on topic frontend edit changes creation date
Hi Sebastian,

 

I think it's because the creation date field is not in your frontend form (customization) and as it's not set when the item is saved, it's automatically set with the current date/time.

 

Just add a hidden field in the frontend form with the current item creation date as value...

 

Olivier

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

  • Sebastian van Greunen
  • Sebastian van Greunen's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 3 weeks ago #99667 by Sebastian van Greunen
Replied by Sebastian van Greunen on topic frontend edit changes creation date
Hi Olivier

 

I tried this:

<input type="hidden" name="date" value="<?php echo JHTML::_('date', $this->item->created); ?>" /> and placed it with the rest of the hidden fields at the bottom.

 

this does not change anything. Is my code not correct?

 

 

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

More
13 years 3 weeks ago #99668 by Jiliko.net
Replied by Jiliko.net on topic frontend edit changes creation date
Sebastian,

 

the name field value should be "created", not "date" :

 

<input type="hidden" name="created" value="<?php echo JHTML::_('date', $this->item->created); ?>" />

 

Olivier

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

  • Sebastian van Greunen
  • Sebastian van Greunen's Avatar Topic Author
  • Offline
  • Junior Member
More
13 years 1 week ago #99669 by Sebastian van Greunen
Replied by Sebastian van Greunen on topic frontend edit changes creation date
Hi Olivier i have noticed that all items added in the frontend have the correct date, but the time is set to 00:00 for all the items, so the latest item order is thrown out. Does this need another hidden field or does the format of the creation date need to be changed. When I modify the items in the admin backend, the time updates correctly.

 

Thanks

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


Powered by Kunena Forum