-
AuthorPosts
-
cbc575 Friend
cbc575
- Join date:
- April 2015
- Posts:
- 208
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 53
- Thanked:
- 11 times in 1 posts
July 14, 2015 at 4:58 pm #208739Hi there @jooservices (per your request)
I noticed that the Featured Articles at the “Knowing What’s Happening…” are chosen (sorted/ordered) by the ID, the lower the article’s ID the higher it’s the priority.
Perhaps the big window on the left has the lower ID and the 3 article in the right are consecutively higher. How can we invert this rule….? assuming that it’s the latest article the one with higher ID and priority for the user.
Or, is there a way to manually select which articles will go where…?
cbc575 Friendcbc575
- Join date:
- April 2015
- Posts:
- 208
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 53
- Thanked:
- 11 times in 1 posts
July 14, 2015 at 6:22 pm #577395<em>@cbc575 482853 wrote:</em><blockquote>Hi there @jooservices (per your request)
I noticed that the Featured Articles at the “Knowing What’s Happening…” are chosen (sorted/ordered) by the ID, the lower the article’s ID the higher it’s the priority.
Perhaps the big window on the left has the lower ID and the 3 article in the right are consecutively higher. How can we invert this rule….? assuming that it’s the latest article the one with higher ID and priority for the user.
Or, is there a way to manually select which articles will go where…?</blockquote>
The attached picture will illustrate my point better. The articles position in the “Knowing What’s Happening” is determined by the ID, unfortunately the lower ID number, and since ID’s are fix and assigned automatically (subsequently), under the current condition, this means that the older article is the one with higher importance. I would like to either reverse (invert) this, so the Higher ID number (newest) has the priority or be able to manually pick with article goes where.
How do I do that…?
Thank you for your support.
cbc575 Friendcbc575
- Join date:
- April 2015
- Posts:
- 208
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 53
- Thanked:
- 11 times in 1 posts
July 14, 2015 at 6:22 pm #643692<em>@cbc575 482853 wrote:</em><blockquote>Hi there @jooservices (per your request)
I noticed that the Featured Articles at the “Knowing What’s Happening…” are chosen (sorted/ordered) by the ID, the lower the article’s ID the higher it’s the priority.
Perhaps the big window on the left has the lower ID and the 3 article in the right are consecutively higher. How can we invert this rule….? assuming that it’s the latest article the one with higher ID and priority for the user.
Or, is there a way to manually select which articles will go where…?</blockquote>
The attached picture will illustrate my point better. The articles position in the “Knowing What’s Happening” is determined by the ID, unfortunately the lower ID number, and since ID’s are fix and assigned automatically (subsequently), under the current condition, this means that the older article is the one with higher importance. I would like to either reverse (invert) this, so the Higher ID number (newest) has the priority or be able to manually pick with article goes where.
How do I do that…?
Thank you for your support.
cbc575 Friendcbc575
- Join date:
- April 2015
- Posts:
- 208
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 53
- Thanked:
- 11 times in 1 posts
July 14, 2015 at 6:22 pm #742339<em>@cbc575 482853 wrote:</em><blockquote>Hi there @jooservices (per your request)
I noticed that the Featured Articles at the “Knowing What’s Happening…” are chosen (sorted/ordered) by the ID, the lower the article’s ID the higher it’s the priority.
Perhaps the big window on the left has the lower ID and the 3 article in the right are consecutively higher. How can we invert this rule….? assuming that it’s the latest article the one with higher ID and priority for the user.
Or, is there a way to manually select which articles will go where…?</blockquote>
The attached picture will illustrate my point better. The articles position in the “Knowing What’s Happening” is determined by the ID, unfortunately the lower ID number, and since ID’s are fix and assigned automatically (subsequently), under the current condition, this means that the older article is the one with higher importance. I would like to either reverse (invert) this, so the Higher ID number (newest) has the priority or be able to manually pick with article goes where.
How do I do that…?
Thank you for your support.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
July 15, 2015 at 4:06 am #577445Hi there
May i know which module / component you are using for that ?
In basic Joomla! allow we choose ordering method .Thank you,
Viet Vujooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
July 15, 2015 at 4:06 am #643742Hi there
May i know which module / component you are using for that ?
In basic Joomla! allow we choose ordering method .Thank you,
Viet Vujooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
July 15, 2015 at 4:06 am #742389Hi there
May i know which module / component you are using for that ?
In basic Joomla! allow we choose ordering method .Thank you,
Viet Vucbc575 Friendcbc575
- Join date:
- April 2015
- Posts:
- 208
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 53
- Thanked:
- 11 times in 1 posts
July 15, 2015 at 7:14 pm #577533<em>@jooservices 482947 wrote:</em><blockquote>Hi there
May i know which module / component you are using for that ?
In basic Joomla! allow we choose ordering method .Thank you,
Viet Vu</blockquote>According to a response you gave in a similar Thread this is hard code and not a module. On regards to the settings, I have not change anything from the original sample data.
I just want to be able to manually pick what Articles go on the big left window and which one should go in the three item list (at the right).
Please check the attached images.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
July 15, 2015 at 10:41 pm #577552Hi there
As your link ref it’s homepage and it’s using com_content featured
Please check at backend for ordering confighttps://www.dropbox.com/s/4056g74r31z9y1e/2015-07-16_5-41-06.png?dl=0
Thank you,
Viet Vucbc575 Friendcbc575
- Join date:
- April 2015
- Posts:
- 208
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 53
- Thanked:
- 11 times in 1 posts
July 16, 2015 at 9:14 pm #577715I did try moving the order in the articles section and it doesn’t work, as I explained several times, this is controlled by the Featured Article’s Lower ID, and I need to be able to peak the location of the article to a specific position, or at very least able to invert the order so it selects the higher Article’s ID Number.
I’m positive that I already provided you with all the info and that this should be possible modifying the hard code (AS YOU KNOW, THIS SEGMENT DOESN’T HAVE A MODULE”.
Please let me know how I could do that (BTW, this is a flaw in the design, because we always want to highlight the latest news, not the older ones).
If you can’t help me, I would appreciate if you could please pass this issue to somebody that will.
Thanks.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
July 17, 2015 at 2:36 am #577734Hi there
# At first it’s absolute Joomla! configuration ( com_content&view=featured ) . Please consider check & ask it in Joomla! Community. It’s none JA issue.
# But let me try to explain it in detail.http://ja-techzone.demo.joomlart.com/index.php/en/
Here is homepage link, which one provided from you.
It’s pointed to index.php?option=com_content&view=featured in menu item id ( 101 – Home ).What’s it.
– This’s default home menu
– This menu item pointed to com_content with featured view
– By check into this menu we can see configuration
Article Order . It’s configured “Featured Articles Order”
Change it to Article Manager Order. This option apply to use .orderingNow we go to featured articles page.
administrator/index.php?option=com_content&view=featured
– We have Ordering column.
– In Joomla! it’s used to management ordering.
– In case we want to do custom ordering. Click on it to switch to Ordering
– We’ll have Ordering button to control custom ordering. Check this screenshot for detail
https://www.dropbox.com/s/kkogyo6in4mezrk/2015-07-17_9-08-47.png?dl=0
– Now we can change it as your needed.
For sample i move Sungard and Google bet on the cloud to 2nd position under Apple Mail … ( Check this screenshot for detail )
https://www.dropbox.com/s/5d5krg93g2hblm9/2015-07-17_9-10-21.png?dl=0
And clear cache and go back Frontpage – HomeIt should work but it’s not. But once again. It’s not JA issue.
Checked into this component model query. We’ll see this
/**
* Get the list of items.
*
* @return JDatabaseQuery
*/
protected function getListQuery()
{
// Set the blog ordering
$params = $this->state->params;
$articleOrderby = $params->get('orderby_sec', 'rdate');
$articleOrderDate = $params->get('order_date');
$categoryOrderby = $params->def('orderby_pri', '');
$secondary = ContentHelperQuery::orderbySecondary($articleOrderby, $articleOrderDate) . ', ';
$primary = ContentHelperQuery::orderbyPrimary($categoryOrderby);$orderby = $primary . ' ' . $secondary . ' a.created DESC ';
$this->setState('list.ordering', $orderby);
$this->setState('list.direction', '');// Create a new query object.
$query = parent::getListQuery();// Filter by frontpage.
if ($this->getState('filter.frontpage'))
{
$query->join('INNER', '#__content_frontpage AS fp ON fp.content_id = a.id');
}// Filter by categories
$featuredCategories = $this->getState('filter.frontpage.categories');if (is_array($featuredCategories) && !in_array('', $featuredCategories))
{
$query->where('a.catid IN (' . implode(',', $featuredCategories) . ')');
}return $query;
}We’ll have query
SELECT a.id, a.title, a.alias, a.introtext, a.fulltext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = '0000-00-00 00:00:00' THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = '0000-00-00 00:00:00' THEN a.created ELSE a.publish_up END as publish_up,a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, a.language, LENGTH(a.fulltext) AS readmore,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published
FROM #__content AS a
LEFT JOIN #__categories AS c ON c.id = a.catid
LEFT JOIN #__users AS ua ON ua.id = a.created_by
LEFT JOIN #__users AS uam ON uam.id = a.modified_by
LEFT JOIN #__categories as parent ON parent.id = c.parent_id
LEFT JOIN #__content_rating AS v ON a.id = v.content_id
LEFT OUTER JOIN (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id
INNER JOIN #__content_frontpage AS fp ON fp.content_id = a.id
WHERE a.access IN (1,1,5) AND c.access IN (1,1,5) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2015-07-17 02:28:59') AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2015-07-17 02:28:59') AND a.catid IN (10,11,12,13,14,15,16)
ORDER BY c.lft, a.ordering, a.created DESCAt first it’ll ordering by c.lft . It’s Category ordering !
Second is a.ordering. It’s article ordering !Pingo !
In this case. If you still want to modify it as your needed.
# Remove Category ordering ( or Change Category as your needed first ).
To remove category ordering . Do replace
$orderby = $primary . ' ' . $secondary . ' a.created DESC ';
To
$orderby = $secondary . ' a.created DESC ';
And we’ll have query like this
SELECT a.id, a.title, a.alias, a.introtext, a.fulltext, a.checked_out, a.checked_out_time, a.catid, a.created, a.created_by, a.created_by_alias, CASE WHEN a.modified = '0000-00-00 00:00:00' THEN a.created ELSE a.modified END as modified, a.modified_by, uam.name as modified_by_name,CASE WHEN a.publish_up = '0000-00-00 00:00:00' THEN a.created ELSE a.publish_up END as publish_up,a.publish_down, a.images, a.urls, a.attribs, a.metadata, a.metakey, a.metadesc, a.access, a.hits, a.xreference, a.featured, a.language, LENGTH(a.fulltext) AS readmore,CASE WHEN badcats.id is not null THEN 0 ELSE a.state END AS state,c.title AS category_title, c.path AS category_route, c.access AS category_access, c.alias AS category_alias,CASE WHEN a.created_by_alias > ' ' THEN a.created_by_alias ELSE ua.name END AS author,ua.email AS author_email,parent.title as parent_title, parent.id as parent_id, parent.path as parent_route, parent.alias as parent_alias,ROUND(v.rating_sum / v.rating_count, 0) AS rating, v.rating_count as rating_count,c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published
FROM #__content AS a
LEFT JOIN #__categories AS c ON c.id = a.catid
LEFT JOIN #__users AS ua ON ua.id = a.created_by
LEFT JOIN #__users AS uam ON uam.id = a.modified_by
LEFT JOIN #__categories as parent ON parent.id = c.parent_id
LEFT JOIN #__content_rating AS v ON a.id = v.content_id
LEFT OUTER JOIN (SELECT cat.id as id FROM #__categories AS cat JOIN #__categories AS parent ON cat.lft BETWEEN parent.lft AND parent.rgt WHERE parent.extension = 'com_content' AND parent.published != 1 GROUP BY cat.id ) AS badcats ON badcats.id = c.id
INNER JOIN #__content_frontpage AS fp ON fp.content_id = a.id
WHERE a.access IN (1,1,5) AND c.access IN (1,1,5) AND CASE WHEN badcats.id is null THEN a.state ELSE 0 END = 1 AND (a.publish_up = '0000-00-00 00:00:00' OR a.publish_up <= '2015-07-17 02:31:37') AND (a.publish_down = '0000-00-00 00:00:00' OR a.publish_down >= '2015-07-17 02:31:37') AND a.catid IN (10,11,12,13,14,15,16)
ORDER BY a.ordering, a.created DESCAlmost done
But by default in MySQL a.ordering ( without direction ). It’ll be ASC
http://www.techonthenet.com/mysql/order_by.php
<blockquote>ASC
Optional. It sorts the result set in ascending order by expression (default, if no modifier is provider).</blockquote>So it’ll show up like this.
https://www.dropbox.com/s/8qgaf6gngoa1k2f/2015-07-17_9-34-37.png?dl=0
But in fact i would suggest to do core hacking . Specially with Joomla! core
There are fews alt ways
# Check into layout file and do re-ordering it as your needed. It’ll cause performance issue but at least it works
# Use 3rd party module instead component. We can manage it in better our needed way.Thank you,
Viet Vucbc575 Friendcbc575
- Join date:
- April 2015
- Posts:
- 208
- Downloads:
- 0
- Uploads:
- 29
- Thanks:
- 53
- Thanked:
- 11 times in 1 posts
July 18, 2015 at 7:15 pm #577866Dear @jooservices, thank you for all the effort you are doing to resolve this.
First I want to point that I tried ordering the featured articles many times and even before requesting help through this thread, I did it again and cleared all the cached info several times with negative results. (see the attended pictures).
You do mention some alternative ways to do this change, but unfortunately you don’t mention where are those files located.
Hope you can elaborate more about the changes I need to make and where to find such files.
Thank you.
jooservices Friendjooservices
- Join date:
- October 2014
- Posts:
- 8556
- Downloads:
- 0
- Uploads:
- 130
- Thanked:
- 1245 times in 1121 posts
July 20, 2015 at 1:49 am #577895Hi there
I already explain it in detail.
Anyways as your asked
– Please check file
componentscom_contentmodelsfeatured.php
– Replace
$orderby = $primary . ' ' . $secondary . ' a.created DESC ';
By
$orderby = $secondary . ' a.created DESC ';
And you can can use your own ordering as well.
But please mention
# It’s Joomla! core hacking. You’ll accept your risky and lose it when do Joomla! upgrade
# It’s nona JA issue. For next time you would go with Joomla! CommunityThank you,
Viet Vu1 user says Thank You to jooservices for this useful post
-
AuthorPosts
This topic contains 17 replies, has 2 voices, and was last updated by jooservices 9 years, 3 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum