How to change created date in frontend in Joomla 2.5?

Everything to do with Joomla! 2.5 templates and templating.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
cryptbear
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Sat Apr 21, 2012 2:14 am

How to change created date in frontend in Joomla 2.5?

Post by cryptbear » Sun Jul 01, 2012 10:47 pm

Hello to all!

I have a problem with changing the created date in the frontend editor form.

I made an override for the file /COMPONTENTS/COM_CONTENT/VIEWS/FORM/TMPL/edit.php

and I added there the following PHP code:
<?php echo $this->form->getLabel('created'); ?>
<?php echo $this->form->getInput('created'); ?>

Now I'm able to read the created date. But, when I change it and hit the SAVE button, it remains always the old value as it would be read-only.

How and where do I have to make changes that the created date can be modified and saved in frontend?
Last edited by cryptbear on Wed Jul 04, 2012 12:05 am, edited 2 times in total.

cryptbear
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Sat Apr 21, 2012 2:14 am

Re: How to change created date in frontend?

Post by cryptbear » Tue Jul 03, 2012 11:54 pm

I managed it by myself.

To enable the saving of the created date in frontend, I had to "hack" joomla, because I don't think that the article.xml is overridable.

So, for whom who wants to save the created date on frontend go to:

1) /COMPONENTS/COM_CONTENT/MODELS/FORMS/ARTICLE.XML (This part makes it savable)

and change the following field:

<field
id="created"
name="created"
...

to

<field
id="created"
name="created"
type="calendar"
label="JGLOBAL_FIELD_CREATED_LABEL"
description="JGLOBAL_FIELD_CREATED_DESC"
class="inputbox"
format="%Y-%m-%d %H:%M:%S"
size="22"
filter="user_utc" />

2) Create language overrides in the backend (or in the file) in Language Manager->Overrides
for:

JGLOBAL_FIELD_CREATED_LABEL = "Created date" (or whatever you like)
JGLOBAL_FIELD_CREATED_DESC = "Created date of the article" (or whatever you like)

3) Create an override file for: (this part makes it visible in the frontend editor)
/COMPONTENTS/COM_CONTENT/VIEWS/FORM/TMPL/edit.php
in
/YOUR_TEMPLATE/HTML/COM_CONTENT/FORM/edit.php

and add the following code:
<?php echo $this->form->getLabel('created'); ?>
<?php echo $this->form->getInput('created'); ?>

above or where you like:
<?php echo $this->form->getLabel('publish_up'); ?>
<?php echo $this->form->getInput('publish_up'); ?>

tpgdesign
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Jan 16, 2009 1:37 pm

Re: How to change created date in frontend in Joomla 2.5?

Post by tpgdesign » Tue Sep 11, 2012 3:03 pm

Hi,

I also needed this fix - and followed your instructions.. All worked.

Thanks

mgalassi
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Jan 20, 2010 5:17 pm

Re: How to change created date in frontend in Joomla 2.5?

Post by mgalassi » Mon Sep 24, 2012 10:23 am

Hello. I am using Warp 6 by YOO Theme. In my case the override is a little bit more complicated.
Can somone help me?

Thank you

mgalassi
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Jan 20, 2010 5:17 pm

Re: How to change created date in frontend in Joomla 2.5?

Post by mgalassi » Mon Sep 24, 2012 1:40 pm

For who use the framework WARP I have the answer.

At the point 3), to have the override, you must to take the file
site/templates/your_template/warp/systems/joomla/layouts/com_content/form/edit.php
edit it how cryptbear said and save it in:
site/templates/your_template/styles/your_style/layouts/com_content/form/edit.php

User avatar
Souls33k
Joomla! Apprentice
Joomla! Apprentice
Posts: 16
Joined: Wed Oct 22, 2008 12:53 pm
Location: Athens, Greece

Re: How to change created date in frontend in Joomla 2.5?

Post by Souls33k » Wed Jan 29, 2014 1:41 pm

cryptbear, i just wanted to say THANK YOU for that post.
I had gotten as far as the template override but the modified creation date wasn't saved. The modification in article.xml did the trick! :D

carlodamo
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Tue Apr 10, 2007 1:05 pm

Re: How to change created date in frontend in Joomla 2.5?

Post by carlodamo » Tue Feb 11, 2014 12:59 pm

Yeah, this work with joomla 3.x too!

Thanks

webtools
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Mar 12, 2015 9:37 am

Re: How to change created date in frontend in Joomla 2.5?

Post by webtools » Thu Mar 12, 2015 9:44 am

This will be overwritten when Joomla updates.
Instead create the override and install and activate the attached plugin.
You do not have the required permissions to view the files attached to this post.

User avatar
leolam
Joomla! Master
Joomla! Master
Posts: 19139
Joined: Mon Aug 29, 2005 10:17 am
Location: Netherlands/ UK/ S'pore/Jakarta/ North America
Contact:

Re: How to change created date in frontend in Joomla 2.5?

Post by leolam » Thu Mar 12, 2015 4:34 pm

mgalassi wrote: save it in:
site/templates/your_template/styles/your_style/layouts/com_content/form/edit.php
That is wrong. This is being overwritten by the next update of the YT template/Warp. It needs to be saved in the 'html/content' folders of the template: Start here https://docs.joomla.org/Understanding_Output_Overrides

Leo 8)
Joomla's #1 Professional Support Provider:
-> Joomla Professional Support: https://gws-desk.com -
-> Joomla Specialized Hosting Solutions: https://gws-host.com -
Member Joomla Bug Squad & Joomla CMS Release Team

mattsh1
Joomla! Intern
Joomla! Intern
Posts: 84
Joined: Thu Nov 16, 2006 12:49 pm

Re: How to change created date in frontend in Joomla 2.5?

Post by mattsh1 » Tue Sep 06, 2016 11:50 am

Sorry to borrow this thread!

@webtools, your solution works fine for me.

But I don't manage to fix the translation for my Joomla 3.6.2 site for the created field.

Any suggestions?

Regards
Matt


Locked

Return to “Templates for Joomla! 2.5”