-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
264 additions
and
165 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Sort By Field 2.0.0 | ||
================================================================================ | ||
~ Updated for Joomla 4.2 or later, PHP 8.0 or later |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# Sort by Field | ||
|
||
A Joomla 3 plugin to sort the articles in a category by the value of a custom field. | ||
A Joomla 4.2 or later plugin to sort the articles in a category by the value of a custom field. | ||
|
||
This is useful when making a category of events where the event date is stored in a Joomla! custom field. Create a menu | ||
item for the category (list or blog view) and set it to order by the value of the event date custom field ascending. | ||
Archive past events. Create another menu item to show only archived articles and set it to sort by the event date custom | ||
field descending. There you go! You now have a quick'n'dirty event calendar using core Joomla features. | ||
|
||
I wrote this plugin because I needed it. Also, the use case I had presented back in 2015 in the (literal) round table | ||
discussion regarding Joomla 4 features with regards to custom fields was exactly that: a quick'n'dirty event calendar! | ||
discussion regarding Joomla 4 features with regard to custom fields was exactly that: a quick and dirty event calendar! | ||
It's sad that Joomla decided to add custom fields but not make it possible to sort or filter by them. This plugin gets | ||
the custom fields closer to my original vision of the feature and the possibilities it opens for site integrators. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
A Joomla 3 plugin to sort the articles in a category by the value of a custom field. | ||
A Joomla plugin to sort the articles in a category by the value of a custom field. | ||
|
||
**Requirements** | ||
* PHP 7.2 or later; or 8.0 | ||
* Joomla 3.9; or 3.10 | ||
* PHP 8.0, 8.1, or 8.2 | ||
* Joomla 4.2 or later |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
/** | ||
* @project sortbyfield | ||
* @license GPLv3 | ||
* @copyright Copyright (c) 2021-2023 Nicholas K. Dionysopoulos | ||
*/ | ||
|
||
use Joomla\CMS\Installer\InstallerAdapter; | ||
use Joomla\CMS\Installer\InstallerScript; | ||
use Joomla\CMS\Installer\InstallerScriptInterface; | ||
|
||
defined('_JEXEC') or die; | ||
|
||
return new class extends InstallerScript implements InstallerScriptInterface { | ||
protected $minimumPhp = '8.0'; | ||
|
||
protected $minimumJoomla = '4.2'; | ||
|
||
public function preflight($type, $adapter): bool | ||
{ | ||
return parent::preflight($type, $adapter); | ||
} | ||
|
||
public function install(InstallerAdapter $adapter): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function update(InstallerAdapter $adapter): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function uninstall(InstallerAdapter $adapter): bool | ||
{ | ||
return true; | ||
} | ||
|
||
public function postflight(string $type, InstallerAdapter $adapter): bool | ||
{ | ||
return true; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
/** | ||
* @project sortbyfield | ||
* @license GPLv3 | ||
* @copyright Copyright (c) 2021-2023 Nicholas K. Dionysopoulos | ||
*/ | ||
|
||
defined('_JEXEC') || die; | ||
|
||
use Dionysopoulos\Plugin\System\SortByField\Extension\SortByField; | ||
use Joomla\CMS\Extension\MVCComponent; | ||
use Joomla\CMS\Extension\PluginInterface; | ||
use Joomla\CMS\Factory; | ||
use Joomla\CMS\Plugin\PluginHelper; | ||
use Joomla\DI\Container; | ||
use Joomla\DI\ServiceProviderInterface; | ||
use Joomla\Event\DispatcherInterface; | ||
|
||
return new class implements ServiceProviderInterface { | ||
/** | ||
* Registers the service provider with a DI container. | ||
* | ||
* @param Container $container The DI container. | ||
* | ||
* @return void | ||
*/ | ||
public function register(Container $container): void | ||
{ | ||
/** @var MVCComponent $component */ | ||
$container->set( | ||
PluginInterface::class, | ||
function (Container $container) { | ||
$config = (array) PluginHelper::getPlugin('system', 'sortbyfield'); | ||
$subject = $container->get(DispatcherInterface::class); | ||
$plugin = new SortByField($subject, $config); | ||
|
||
$plugin->setApplication(Factory::getApplication()); | ||
|
||
return $plugin; | ||
} | ||
); | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
|
||
<!--~ | ||
~ * @project sortbyfield | ||
~ * @license GPLv3 | ||
~ * @copyright Copyright (c) 2021 Nicholas K. Dionysopoulos | ||
~ @project sortbyfield | ||
~ @license GPLv3 | ||
~ @copyright Copyright (c) 2021-2023 Nicholas K. Dionysopoulos | ||
--> | ||
|
||
<extension version="3.9.0" type="plugin" group="system" method="upgrade"> | ||
<extension type="plugin" group="system" method="upgrade"> | ||
<name>PLG_SYSTEM_SORTBYFIELD</name> | ||
<version>1.0.2</version> | ||
<creationDate>2021-03-27</creationDate> | ||
|
@@ -15,24 +15,22 @@ | |
<authorEmail>[email protected]</authorEmail> | ||
<authorUrl>https://www.dionysopoulos.me</authorUrl> | ||
|
||
<copyright>Copyright (c)2020-2021 Nicholas K. Dionysopoulos</copyright> | ||
<copyright>Copyright (c)2021-2023 Nicholas K. Dionysopoulos</copyright> | ||
<license>GNU GPL v3 or later</license> | ||
|
||
<description>PLG_SYSTEM_SORTBYFIELD_XML_DESC</description> | ||
<namespace path="src">Dionysopoulos\Plugin\System\SortByField</namespace> | ||
|
||
<files> | ||
<filename plugin="sortbyfield">sortbyfield.php</filename> | ||
<folder>fields</folder> | ||
<folder>forms</folder> | ||
<folder>library</folder> | ||
|
||
<filename>.htaccess</filename> | ||
<filename>web.config</filename> | ||
<folder>services</folder> | ||
<folder plugin="sortbyfield">src</folder> | ||
</files> | ||
|
||
<languages folder="language"> | ||
<language tag="en-GB">en-GB/en-GB.plg_system_sortbyfield.ini</language> | ||
<language tag="en-GB">en-GB/en-GB.plg_system_sortbyfield.sys.ini</language> | ||
</languages> | ||
|
||
<scriptfile>script.php</scriptfile> | ||
</extension> |
Oops, something went wrong.