Schedule featured articles #13596#18052
Conversation
|
Please add more information to your issue. Without test instructions and/or any description we will close this issue within 4 weeks. Thanks. |
| 'ordering', 'a.ordering', | ||
| 'featured', 'a.featured', | ||
| 'featured_up', 'a.featured_up', | ||
| 'featured_down', 'featured_down', |
| { | ||
| $query->where('a.featured = 1'); | ||
| } | ||
| $query->where('(a.featured_up = ' . $nullDate . ' OR a.featured_up <= ' . $nowDate . ')') |
There was a problem hiding this comment.
Should these lines be after $query->where('a.featured = 1');?
There was a problem hiding this comment.
I don't think so. The full plain query could be produced by this piece of code
if ($this->getState('filter.frontpage'))
{
// filter only featured articles
$query->where('a.featured = 1')
->where('(a.featured_up = ' . $nullDate . ' OR a.featured_up <= ' . $nowDate . ')')
->where('(a.featured_down = ' . $nullDate . ' OR a.featured_down >= ' . $nowDate . ')');
// join #__content_frontpage for ordering
if ($orderby_sec === 'front')
{
$query->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id');
}
}
Articles have a row in the #__content_frontpage only if a.featured = 1, so you can optimize the query
if ($this->getState('filter.frontpage'))
{
if ($orderby_sec === 'front')
{
$query->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id');
}
else
{
$query->where('a.featured = 1');
}
$query->where('(a.featured_up = ' . $nullDate . ' OR a.featured_up <= ' . $nowDate . ')')
->where('(a.featured_down = ' . $nullDate . ' OR a.featured_down >= ' . $nowDate . ')');
}
| @@ -0,0 +1,2 @@ | |||
| ALTER TABLE "#__content" ADD "featured_up" datetime2(0) NOT NULL DEFAULT '1900-01-01 00:00:00'; | |||
There was a problem hiding this comment.
I don't use sqlazure so I don't know which syntax " or [] is correct.
See another PR that uses []
https://github.com/joomla/joomla-cms/pull/17709/files#diff-f6d977844dc2f4c65fe3e3262b042bd6
|
How about changing |
|
Thanks for working on it to everybody who is joining this issue. |
| COM_CONTENT_FIELD_CREATED_LABEL="Created Date" | ||
| COM_CONTENT_FIELD_FEATURED_DESC="Assign the article to the featured blog layout." | ||
| COM_CONTENT_FIELD_FEATURED_DOWN_DESC="An optional date to end the article being featured." | ||
| COM_CONTENT_FIELD_FEATURED_DOWN_LABEL="End Featured" |
| COM_CONTENT_FIELD_CREATED_DESC="Created date." | ||
| COM_CONTENT_FIELD_CREATED_LABEL="Created Date" | ||
| COM_CONTENT_FIELD_FEATURED_DESC="Assign the article to the featured blog layout." | ||
| COM_CONTENT_FIELD_FEATURED_DOWN_DESC="An optional date to end the article being featured." |
|
In the Featured tooltip, seconds is displayed, but not in the Publishing tooltip. To be consistent, do not display the seconds. |
|
Installation SQLs have to be updated with the new columns. |
| $tips[] = JText::sprintf('JLIB_HTML_FEATURED_STARTED', JHtml::_('date', $featured_up, JText::_('DATE_FORMAT_LC5'), 'UTC')); | ||
| } | ||
| } | ||
|
|
| $tips[] = JText::sprintf('JLIB_HTML_FEATURED_FINISH', JHtml::_('date', $featured_down, JText::_('DATE_FORMAT_LC5'), 'UTC')); | ||
| } | ||
| } | ||
|
|
| { | ||
| $nullDate = JFactory::getDbo()->getNullDate(); | ||
| $nowDate = JFactory::getDate()->toUnix(); | ||
|
|
|
|
||
| $featured_up = ($featured_up != $nullDate) ? JFactory::getDate($featured_up, 'UTC')->setTimeZone($tz) : false; | ||
| $featured_down = ($featured_down != $nullDate) ? JFactory::getDate($featured_down, 'UTC')->setTimeZone($tz) : false; | ||
|
|
|
Hello.. what is the current status of this feature.. when will this be released or build in the core joomla?.. greetings. This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18052. |
|
@johanpeters 3.x series has a feature freeze, so this PR has to be ported to J4 and maybe get included in in Joomla 4.0 |
|
@HLeithner you really need to announce (and define) this feature freeze and then review and update ALL the existing issues and PR. No point in having open feature PR for the J3 branch AND ensure that all new PR and Issues for the J3 branch are commented on appropriately - just leaving them there just creates frustration and WASTES TIME for everyone |
|
@brianteeman thats not my decision thats from the last Production meeting Report:
Also reflected in the Roadmap https://developer.joomla.org/roadmap.html
I'm not in the position to say that this is valid for all PR's so maybe there are PR's that gets into a patch level which adds a small feature. My comment may was not detailed enough, sry for this. |
|
There is a missing word or phrase in the minutes that says what the proposal was that was discussed - the community are not mind readers |
|
maybe @wilsonge can tell us more about this. I'm not part of the production team atm. |
|
We discussed this in the last days in the maintainers chat and George wanted to see with Sandra to write something. |
|
Let's get this rebased onto j4 and get a fresh test. seems like a nice feature :) |
|
Set to "closed" on behalf of @alikon by The JTracker Application at issues.joomla.org/joomla-cms/18052 |
|
As we are in feature freeze Please rebase this nice feature in J4 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18052. |
|
PR #25979 rebased for J4 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/18052. |
Pull Request for Issue #13596.
Summary of Changes
Added two fields in the article editor

featured_up(Start Featured) andfeatured_down(End Featured)An article is featured if
featuredis yes and (featured_upis null or is less than or is equal to now) and (featured_downis null or is greater than or is equal to now)Testing Instructions
modify the database structure using the file 3.8.0-2017-09-21.sql
create 5 articles:
Create an
Articles » Featured Articlesmenu itemCreate a
News Flashmodule and set the optionFeatured ArticlestoOnly show Featured Articles.Expected result
Only the articles 2 and 5 will be shown in the
Articles » Featured Articlesmenu item and in theNews Flashmodule.Actual result
Documentation Changes Required