10 years ago
7
Topic

I am building a article submit form and can't figure out how to change the TITLE of the article properly.  I want it to display the information from a CALENDER field and also say either Morning or Evening. ( i.e. 10/30/2013 Morning News or 10/31/13 Nightly News)...As it is right now, it displays properly in the form, but the article title shows as 2013-10-14 16:20:00...  

Get a VIP membership
10 years ago
3
Level 1

I also noticed that the CALENDER field does not validate and will bypass it's time settings upon submittion.  If you create a form with this field, and leave it blank, you can still submit the form and it will automatically put the current date and time instead.  This is no bueno and should be addressed.

10 years ago
2
Level 2

which field use for the date, field of content article ? Where is storage ? 

10 years ago
1
Level 3

I used "Article Title" field and changed the field type to calendar with Time Display set to hide.  When the title displays, it still shows the time as 00:00:00.  

I set another text field as the title, and then used concatenate on the Date field and it seems to display it correctly.
However, if I try to set it as a hidden field, the data doesn't appear at all.  The title only seems to work with TEXT field only?  


10 years ago
0
Level 4

I would be careful with changing the default Article Title field type. This will change it for all articles in your installation.


So if you need to have that special title for only one custom content type then you better make a new field with type calendar and set the Storage to Datetime in a different field in the DB.

10 years ago
1
Level 1

WHy use the article title for that ? 

just use the date created, and use the search list for order by date created and in the element you apply a plugin typo. 

you develop a new plugin typo for format your display date 10/30/2013 Morning News or 10/31/13 Nightly News. 

10 years ago
0
Level 2

Do I need to download and install a specific plugin to do this?

10 years ago
0
Level 1

Hi aspiringpro,

Thank you for your post.

Here, your problem is how i can display the right information in the content view, not in the form view.

If a user save an article without setting a title then Joomla set title as the current date and time. I suggest to have "article title" field as a text field. I suggest also to hide article title in the form view.

If you would like to display value as "10/31/13 Nightly News", i advise you to use "Article created" field. After that, you should define a custom variation. In this variation, you should get the value of this field as:

$date = cck->getValue('art_created');

You will have value as for example
2013-11-10 10:51:00.


With PHP, you can compute if this time is in the night or not.

PS : I insist, your problem is not in the form but in terms of the date display

Regards,
Mehdi.

Get a VIP membership