From 305d7d2ec90333915b21a7a930e2cb3205a78815 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 22 Nov 2013 17:08:38 -0800 Subject: [PATCH] News List caption option added to v2 template (same as $NEWSLISTTITLE in v1.x) --- e107_plugins/news/templates/news_template.php | 1 + news.php | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/e107_plugins/news/templates/news_template.php b/e107_plugins/news/templates/news_template.php index a8d324e69..4719e47b5 100644 --- a/e107_plugins/news/templates/news_template.php +++ b/e107_plugins/news/templates/news_template.php @@ -23,6 +23,7 @@ $NEWS_MENU_TEMPLATE['list']['end'] = ''; // {NEWSBODY} should not appear in the LISTSTYLE as it is NOT the same as what would appear on news.php (no query) // Template/CSS to be reviewed for best bootstrap implementation +$NEWS_TEMPLATE['list']['caption'] = '{NEWSCATEGORY}'; $NEWS_TEMPLATE['list']['start'] = '{SETIMAGE: w=400&h=300&crop=1}'; $NEWS_TEMPLATE['list']['end'] = ''; $NEWS_TEMPLATE['list']['item'] = ' diff --git a/news.php b/news.php index d2795c2fe..880ccd7f9 100644 --- a/news.php +++ b/news.php @@ -275,11 +275,15 @@ if ($action == 'cat' || $action == 'all' || vartrue($_GET['tag'])) $text .= $tp->parseTemplate("{NEXTPREV={$parms}}"); - if(!$NEWSLISTTITLE) + if(varset($template['caption'])) // v2.x + { + $NEWSLISTTITLE = str_replace("{NEWSCATEGORY}",$tp->toHTML($category_name,FALSE,'TITLE'), $template['caption']); + } + elseif(!$NEWSLISTTITLE) // default { $NEWSLISTTITLE = LAN_NEWS_82." '".$tp->toHTML($category_name,FALSE,'TITLE')."'"; } - else + else // v1.x { $NEWSLISTTITLE = str_replace("{NEWSCATEGORY}",$tp->toHTML($category_name,FALSE,'TITLE'),$NEWSLISTTITLE); }