category_plugin: hide frontpage link
Posted: Fri Jan 30, 2009 12:33 pm
That's about the frontpage link shown above the list of all categories. I added an option to disable this link because it's redundant on my configuration (click on the banner leads to the frontpage which contains all categories). Maybe you want to add something like this, diff is against the snapshot from yesterday (s9y_200901292342.tar.gz ).
Code: Select all
--- plugin_internal.inc.php 2009-01-30 12:05:30.000000000 +0100
+++ /var/www/include/plugin_internal.inc.php 2009-01-30 12:06:57.000000000 +0100
@@ -1430,7 +1430,7 @@
$propbag->add('stackable', true);
$propbag->add('author', 'Serendipity Team');
$propbag->add('version', '2.03');
- $propbag->add('configuration', array('title', 'authorid', 'parent_base', 'hide_parent', 'image', 'sort_order', 'sort_method', 'allow_select', 'hide_parallel', 'show_count', 'smarty'));
+ $propbag->add('configuration', array('title', 'authorid', 'parent_base', 'hide_parent', 'image', 'sort_order', 'sort_method', 'allow_select', 'hide_parallel', 'show_count', 'show_all', 'smarty'));
$propbag->add('groups', array('FRONTEND_VIEWS'));
}
@@ -1545,6 +1545,13 @@
$propbag->add('default', false);
break;
+ case 'show_all':
+ $propbag->add('type', 'boolean');
+ $propbag->add('name', CATEGORY_PLUGIN_SHOWALL);
+ $propbag->add('description', '');
+ $propbag->add('default', true);
+ break;
+
default:
return false;
}
@@ -1615,6 +1622,8 @@
$hide_parallel = serendipity_db_bool($this->get_config('hide_parallel'));
$hidedepth = 0;
+ $show_all_link = $this->get_config('show_all');
+
if (is_array($categories) && count($categories)) {
$categories = serendipity_walkRecursive($categories, 'categoryid', 'parentid', VIEWMODE_THREADED);
foreach ($categories as $cid => $cat) {
@@ -1695,13 +1704,17 @@
}
if (!$smarty) {
- $html .= sprintf(
- '<div class="category_link_all"><br /><a href="%s" title="%s">%s</a></div>',
-
- $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?frontpage',
- ALL_CATEGORIES,
- ALL_CATEGORIES
- );
+ if ($show_all_link) {
+ $html .= sprintf(
+ '<div class="category_link_all"><br /><a href="%s" title="%s">%s</a></div>',
+
+ $serendipity['serendipityHTTPPath'] . $serendipity['indexFile'] . '?frontpage',
+ ALL_CATEGORIES,
+ ALL_CATEGORIES
+ );
+ } else {
+ $html .= '<br />';
+ }
}
if (!$smarty && $is_form) {
--- serendipity_lang_en.inc.php 2009-01-30 12:15:58.000000000 +0100
+++ /var/www/lang/serendipity_lang_en.inc.php 2009-01-30 12:08:59.000000000 +0100
@@ -807,6 +807,7 @@
@define('CATEGORY_PLUGIN_TEMPLATE', 'Enable Smarty-Templates?');
@define('CATEGORY_PLUGIN_TEMPLATE_DESC', 'If this option is enabled, the plugin will utilize Smarty-Templating features to output the category listing. If you enable this, you can change the layout via the "plugin_categories.tpl" template file. Enabling this option will impact performance, so if you do not need to make customizations, leave it disabled.');
@define('CATEGORY_PLUGIN_SHOWCOUNT', 'Show number of entries per category?');
+@define('CATEGORY_PLUGIN_SHOWALL', 'Show link to content of all categories?');
@define('AUTHORS_SHOW_ARTICLE_COUNT', 'Show number of articles next to author name?');
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.');
@define('CUSTOM_ADMIN_INTERFACE', 'Custom admin interface available');
--- serendipity_lang_de.inc.php 2009-01-30 12:16:17.000000000 +0100
+++ /var/www/lang/serendipity_lang_de.inc.php 2009-01-30 12:09:56.000000000 +0100
@@ -809,6 +809,7 @@
@define('CATEGORY_PLUGIN_TEMPLATE', 'Smarty-Templating aktivieren?');
@define('CATEGORY_PLUGIN_TEMPLATE_DESC', 'Falls diese Option aktiviert ist, wird das Kategorie-Plugin die Liste mittels Smarty-Templates ausgeben. Durch die Aktivierung der Option kann dann das Layout mittels der Template-Datei "plugin_categories.tpl" angepasst werden. Die Aktivierung dieser Option bringt Performance-Einbußen mit sich, daher sollten Sie die Option nur dann aktivieren, wenn Ihnen die Anpassungen wichtig sind.');
@define('CATEGORY_PLUGIN_SHOWCOUNT', 'Anzahl der Einträge pro Kategorie anzeigen?');
+@define('CATEGORY_PLUGIN_SHOWALL', 'Link zum Inhalt aller Kategorien anzeigen?');
@define('AUTHORS_SHOW_ARTICLE_COUNT', 'Anzahl der Artikel neben dem Autor-Namen anzeigen? ');
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Wenn diese Option aktiviert ist, wird die Anzahl der von diesem Autor verfassten Artikel in Klammern neben seinem Namen angezeigt.');
@define('CUSTOM_ADMIN_INTERFACE', 'Angepasste Admin-Oberfläche vorhanden');
--- serendipity_lang_en.inc.php-utf8 2009-01-30 12:15:50.000000000 +0100
+++ /var/www/lang/UTF-8/serendipity_lang_en.inc.php 2009-01-30 12:09:11.000000000 +0100
@@ -807,6 +807,7 @@
@define('CATEGORY_PLUGIN_TEMPLATE', 'Enable Smarty-Templates?');
@define('CATEGORY_PLUGIN_TEMPLATE_DESC', 'If this option is enabled, the plugin will utilize Smarty-Templating features to output the category listing. If you enable this, you can change the layout via the "plugin_categories.tpl" template file. Enabling this option will impact performance, so if you do not need to make customizations, leave it disabled.');
@define('CATEGORY_PLUGIN_SHOWCOUNT', 'Show number of entries per category?');
+@define('CATEGORY_PLUGIN_SHOWALL', 'Show link to content of all categories?');
@define('AUTHORS_SHOW_ARTICLE_COUNT', 'Show number of articles next to author name?');
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'If this option is enabled, the number of articles by this author is shown next to the authors name in parentheses.');
@define('CUSTOM_ADMIN_INTERFACE', 'Custom admin interface available');
--- serendipity_lang_de.inc.php-utf8 2009-01-30 12:16:06.000000000 +0100
+++ /var/www/lang/UTF-8/serendipity_lang_de.inc.php 2009-01-30 12:10:33.000000000 +0100
@@ -809,6 +809,7 @@
@define('CATEGORY_PLUGIN_TEMPLATE', 'Smarty-Templating aktivieren?');
@define('CATEGORY_PLUGIN_TEMPLATE_DESC', 'Falls diese Option aktiviert ist, wird das Kategorie-Plugin die Liste mittels Smarty-Templates ausgeben. Durch die Aktivierung der Option kann dann das Layout mittels der Template-Datei "plugin_categories.tpl" angepasst werden. Die Aktivierung dieser Option bringt Performance-Einbußen mit sich, daher sollten Sie die Option nur dann aktivieren, wenn Ihnen die Anpassungen wichtig sind.');
@define('CATEGORY_PLUGIN_SHOWCOUNT', 'Anzahl der Einträge pro Kategorie anzeigen?');
+@define('CATEGORY_PLUGIN_SHOWALL', 'Link zum Inhalt aller Kategorien anzeigen?');
@define('AUTHORS_SHOW_ARTICLE_COUNT', 'Anzahl der Artikel neben dem Autor-Namen anzeigen? ');
@define('AUTHORS_SHOW_ARTICLE_COUNT_DESC', 'Wenn diese Option aktiviert ist, wird die Anzahl der von diesem Autor verfassten Artikel in Klammern neben seinem Namen angezeigt.');
@define('CUSTOM_ADMIN_INTERFACE', 'Angepasste Admin-Oberfläche vorhanden');