publish_down field

publish_down field

6 years 6 months ago #44 by Rob

Perhaps I have missed it, is there currently a Field Type similar to the "Finish Publishing" on basic Joomla articles?

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

6 years 6 months ago - 6 years 6 months ago #47 by Gordon

Just a normal calendar field but you have to code it into your component. Best way is to modify the SQL that delivers the content with a WHERE/AND statement so the result is less than the finishing date.

Joomla Articles (in the front end do it via the content model...

                if ((!$user->authorise('core.edit.state', 'com_content')) && (!$user->authorise('core.edit', 'com_content'))) {
                    // Filter by start and end dates.
                    $nullDate = $db->quote($db->getNullDate());
                    $date = JFactory::getDate();

                    $nowDate = $db->quote($date->toSql());

                    $query->where('(a.publish_up = ' . $nullDate . ' OR a.publish_up <= ' . $nowDate . ')')
                        ->where('(a.publish_down = ' . $nullDate . ' OR a.publish_down >= ' . $nowDate . ')');
                }


Never doubt that a small group of committed people can change the world. Indeed, it is the only thing that ever has... Margaret Mead
Gordon Wright
Old fart developer
The following user(s) said Thank You: Søren Beck Jensen, Andres Maeso, RIP Graphics

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

6 years 6 months ago #48 by Rob

Thanks. I'll give it a whirl.

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

Time to create page: 0.126 seconds
Powered by Kunena Forum

We use cookies so that you can place orders and we can provide a better service. You can control the use of cookies at the individual browser level. If you reject cookies, you may still use our website, but your ability to use some features or areas of our website may be limited.