Well, taking 11 months to respond to all your hard work is not good enough and I apologise profusely.Possible but it requires a bit of development.
I'm now back to this, but using J5.
It works (thank you) when I put the code in the Joomla Core, replacing /components/com_content/src/Model/ArticlesModel.php. Obviously, that's not the right thing to do, but I'm not sure where this file should go - or should it have a new, unique name in the same location?
Whilst the articles are now sorted by the custom field date (hooray!) I would like to limit them to articles where the custom field date is in the future. In my test site I have four articles, one of which has a custom field date in the past. I modified your code as below but nothing changed and I still see four articles.
Code:
$query->where($db->quoteName('v.id') . ' = "1"' AND $db->quoteName('v.value') . ' > now()');
I have copied the basic J5 fields.xml file as a start and tweaked it:
Code:
<?xml version="1.0" encoding="UTF-8"?><extension type="plugin" group="content" method="upgrade"><name>plg_content_events</name><author>Joomla! Project</author><creationDate>2024-02-13</creationDate><copyright>(C) 2017 Open Source Matters, Inc.</copyright><license>GNU General Public License version 2 or later; see LICENSE.txt</license><authorEmail>admin@joomla.org</authorEmail><authorUrl>www.joomla.org</authorUrl><version>5.0.2</version><description>Events Blog</description><namespace path="src">Joomla\Plugin\Content\Events</namespace><files><folder plugin="events">services</folder><folder>src</folder></files><config><fields name="params"><fieldset name="basic"></fieldset></fields></config></extension>
Statistics: Posted by GillianBPP — Tue Feb 13, 2024 6:34 pm