How to change created date in frontend in Joomla 2.5?
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.
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.
-
- Joomla! Apprentice
- Posts: 28
- Joined: Sat Apr 21, 2012 2:14 am
How to change created date in frontend in Joomla 2.5?
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?
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.
-
- Joomla! Apprentice
- Posts: 28
- Joined: Sat Apr 21, 2012 2:14 am
Re: How to change created date in frontend?
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'); ?>
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'); ?>
-
- Joomla! Fledgling
- Posts: 1
- Joined: Fri Jan 16, 2009 1:37 pm
Re: How to change created date in frontend in Joomla 2.5?
Hi,
I also needed this fix - and followed your instructions.. All worked.
Thanks
I also needed this fix - and followed your instructions.. All worked.
Thanks
-
- Joomla! Apprentice
- Posts: 5
- Joined: Wed Jan 20, 2010 5:17 pm
Re: How to change created date in frontend in Joomla 2.5?
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
Can somone help me?
Thank you
-
- Joomla! Apprentice
- Posts: 5
- Joined: Wed Jan 20, 2010 5:17 pm
Re: How to change created date in frontend in Joomla 2.5?
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
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
- Souls33k
- 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?
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!
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!
-
- Joomla! Apprentice
- Posts: 22
- Joined: Tue Apr 10, 2007 1:05 pm
Re: How to change created date in frontend in Joomla 2.5?
Yeah, this work with joomla 3.x too!
Thanks
Thanks
-
- Joomla! Fledgling
- Posts: 1
- Joined: Thu Mar 12, 2015 9:37 am
Re: How to change created date in frontend in Joomla 2.5?
This will be overwritten when Joomla updates.
Instead create the override and install and activate the attached plugin.
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.
- leolam
- Joomla! Master
- Posts: 20652
- Joined: Mon Aug 29, 2005 10:17 am
- Location: Netherlands/ Germany/ S'pore/Bogor/ North America
- Contact:
Re: How to change created date in frontend in Joomla 2.5?
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_Overridesmgalassi wrote: save it in:
site/templates/your_template/styles/your_style/layouts/com_content/form/edit.php
Leo
Joomla's #1 Professional Services Provider:
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -
#Joomla Professional Support: https://gws-desk.com -
#Joomla Specialized Hosting Solutions: https://gws-host.com -
-
- Joomla! Enthusiast
- Posts: 110
- Joined: Thu Nov 16, 2006 12:49 pm
Re: How to change created date in frontend in Joomla 2.5?
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
@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