1

I am looking for a solution to sort a Category-Blog by 'unpublish-date'.

What i have done so far:

  1. created an own menu-style by copying
    blog.xml, blog.php, blog-item.php and blog-links.php to my-*.* into my template directory
  2. checked menu-items: now i can select a category-blog (my~)
  3. added the following line to my-blog.xml
    <option value="publish_down">JUNPUBLISHED</option>
  4. selected 'unpubish' as order_date in menu-item

Hewe comes my problem now:

Some time ago i used to edit query.php in root/components/com_content/helpers/ (i know its a core hack, now i want to do better) to add the 'publish_down' case like

case 'publish_down' :
    $queryDate = ' CASE WHEN a.publish_down = ' . $db->quote($db->getNullDate()) . ' THEN a.created ELSE a.publish_down END ';
    break;
But unfortunately this doesn't work anymore.

Have you guys any hints for me? Appreciate you help!

0

You can easily avoid core hacks loading your own model to replace the original one. Please, check these links:

How to override the component mvc from the Joomla! core https://docs.joomla.org/How_to_override_the_component_mvc_from_the_Joomla!_core

Did you know? Overrides are not just for HTML! https://community.joomla.org/blogs/community/521-did-you-know-overrides-are-not-just-for-html.html

  • Hi Anibal, unfortunately this does not solve my problem. It seems as if my core hack (editing the query.php) is overwritten by another compontent. Maybe another mvp-override. After studying your hints i can not adapt them to my problem. (Just want to sorty by publish_down.) Do you have any other hints that may help me? – Martin Nov 21 '16 at 13:14
  • Hi, a system plugin override is the best way to modify a core behavior. It works 99% of the cases. – Anibal Nov 22 '16 at 16:50
  • If it does not work. You have to check if the core class is already loaded before your plugin, and look for a way to load your version first. – Anibal Nov 22 '16 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.