#1 2011-03-31 15:29:24

Michel-Ange
Ionize Core Team
From: Paris, France
Registered: 2010-03-22
Posts: 927
Website

About Date fields in Ionize...

Yesterday, I came on a suggestion : Why not add another date field in Articles and Pages ?

Why ? Because sometime, the data model needs to be extended...

Your point of view are welcome, even it's a "light" topic !


Inspiration & Innovation : Websites by Partikule, Agence Web Paris

Offline

#2 2011-06-05 14:17:23

Guardian
Ion Tester
From: Mragowo, Poland
Registered: 2010-08-02
Posts: 133
Website

Re: About Date fields in Ionize...

Some improvements here would be very useful.
For example, I would like to be able to get a specific date like Created On, or Published On so we could use something like
<ion:date=published />
<ion:date=created />
but ALSO I would like more flexibility to be able to display the date in PHP date() format, for example;
<ion:date=published(dddd) /> which would display the first 4 letters of the DAY
<ion:date-published(D) /> would display the full day

A lot of my clients like to have a small square calendar type icon with the date inside and something like this would give developers the flexibility to do that.

Offline

#3 2011-10-18 18:17:23

thedoglett
Member
Registered: 2011-07-15
Posts: 128

Re: About Date fields in Ionize...

I can't seem to find this in the documentation so can anyone let me know if it is possible to display the unpublish date using something like <ion:date=unpublish /> ?

I've got a page for a client which is for special offers and I'd like to pull the un-publish date and display it as an 'offer expires' date.

Offline

#4 2012-02-24 10:40:30

cip
Member
Registered: 2012-02-24
Posts: 10

Re: About Date fields in Ionize...

in file tagmanager->page.php

'articles:date' =>             'tag_article_date',
'articles:datec' =>             'tag_article_datec',
'articles:datep' =>             'tag_article_datep',
'articles:dateup' =>             'tag_article_dateup',

and aprox 1990 line:

public static function tag_article_date($tag) { return self::wrap($tag, self::format_date($tag, $tag->locals->article['date'])); }
        public static function tag_article_datec($tag) { return self::wrap($tag, self::format_date($tag, $tag->locals->article['created'])); }
        public static function tag_article_datep($tag) { return self::wrap($tag, self::format_date($tag, $tag->locals->article['publish_on'])); }
        public static function tag_article_dateup($tag) { return self::wrap($tag, self::format_date($tag, $tag->locals->article['publish_off'])); }


and you can use it:
<ion:datep format="l d Y"/>
<ion:dateup format="l d Y"/>
<ion:datec format="l d Y"/>
etc
format="l d Y" -> optional

you must test if publish_off  publich_on are empty and decide what you'll do if  are empty

you can order : order_by="publish_off DESC" etc

simple

Last edited by cip (2012-02-24 11:07:31)

Offline

#5 2012-03-04 23:50:00

Michel-Ange
Ionize Core Team
From: Paris, France
Registered: 2010-03-22
Posts: 927
Website

Re: About Date fields in Ionize...

We will add one attribute to the date tag :

<ion:date type="created" />


Inspiration & Innovation : Websites by Partikule, Agence Web Paris

Offline

What's Ionize ?

Ionize is an Open Source Content Management System created by webdesigners for webdesigners.

Created and maintained by Partikule and Toopixel, Ionize wants to be the easiest and most powerful CMS.

Can I help ?

Because talent is nothing without involvement, we are looking for motivated coders and webdesigners to join the project team.

Resources

Website : ionizecms.com
Documentation : doc.ionizecms.com

Development : Ionize on GitHub
Translations : Ionize Translations