1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

#2475 Removed news_categories.sc template from news template and replaced with 'category' template which is a copy of 'default'

This commit is contained in:
Cameron 2017-03-03 11:56:51 -08:00
parent 20e146f626
commit bfaf50ab25
3 changed files with 24 additions and 32 deletions

View File

@ -35,11 +35,12 @@ $nbr_cols = (defined("NEWSCAT_COLS")) ? NEWSCAT_COLS : $nbr_cols;
}
// News templates with BC
if(!$NEWSCAT)
/* if(!$NEWSCAT)
{
$tmpl = e107::getTemplate('news', 'news', 'category');
$NEWSCAT = $tmpl['body'];
}
*/
if(!$NEWSCAT)
{
$NEWSCAT = "
@ -52,11 +53,13 @@ $nbr_cols = (defined("NEWSCAT_COLS")) ? NEWSCAT_COLS : $nbr_cols;
}
// News templates with BC
/*
if(!$NEWSCAT_ITEM)
{
$tmpl = e107::getTemplate('news', 'news', 'category');
$NEWSCAT_ITEM = $tmpl['item'];
}
*/
if(!$NEWSCAT_ITEM)
{
$NEWSCAT_ITEM = "

View File

@ -1478,13 +1478,21 @@ class news_front
{
$template = $NEWSSTYLE;
}
else
else // v2.x
{
$tmpl = e107::getTemplate('news', 'news', 'default'); // default - we show the full items, except for the 'extended' part..
$layout = e107::getTemplate('news', 'news');
$tmpl = $layout['default']; // default - we show the full items, except for the 'extended' part..
$template = $tmpl['item'];
// unset($tmp);
}
// load the category template if found.
if($this->action === 'list' && isset($layout['category']) && !isset($layout['category']['body'])) // make sure it's not old news_categories.sc
{
$tmpl = $layout['category'];
$template = $tmpl['item'];
$param['template_key'] = 'category';
}
if(!empty($tmpl['start'])) //v2.1.5
@ -1493,7 +1501,7 @@ class news_front
echo $tp->parseTemplate($tmpl['start'],true,$nsc);
}
elseif($sub_action && 'list' == $action && vartrue($newsAr[1]['category_name'])) //old
elseif($sub_action && 'list' == $action && vartrue($newsAr[1]['category_name'])) //old v1.x stuff
{
// we know category name - pass it to the nexprev url
$category_name = $newsAr[1]['category_name'];

View File

@ -87,7 +87,7 @@ $NEWS_TEMPLATE['default']['item'] = '
$NEWS_WRAPPER['default']['item']['NEWSIMAGE: item=1'] = '<span class="news-images-main pull-left col-xs-12 col-sm-6 col-md-6">{---}</span>';
$NEWS_TEMPLATE['default']['start'] = '';
$NEWS_TEMPLATE['default']['start'] = '<!-- Default News Template -->';
$NEWS_TEMPLATE['default']['item'] = '
{SETIMAGE: w=400&h=400}
<div class="default-item">
@ -118,6 +118,13 @@ $NEWS_TEMPLATE['default']['item'] = '
$NEWS_TEMPLATE['default']['end'] = '';
$NEWS_TEMPLATE['category'] = $NEWS_TEMPLATE['default'];
$NEWS_TEMPLATE['category']['start'] = '<!-- Category News Template -->';
###### Default view item (temporary) ######
//$NEWS_MENU_TEMPLATE['view']['start'] = '<ul class="nav nav-list news-menu-months">';
//$NEWS_MENU_TEMPLATE['view']['end'] = '</ul>';
@ -176,18 +183,12 @@ $NEWS_TEMPLATE['view']['item'] = '
</div>
<hr>
<div class="options hidden-print ">
<div class="btn-group">{NEWSCOMMENTLINK: glyph=comments&class=btn btn-default}{PRINTICON: class=btn btn-default}{ADMINOPTIONS: class=btn btn-default}{SOCIALSHARE}</div>
</div>
</div>
<hr />
@ -214,28 +215,8 @@ $NEWS_TEMPLATE['view']['item'] = '
//$NEWS_MENU_TEMPLATE['view']['separator'] = '<br />';
###### news_categories.sc
$NEWS_TEMPLATE['category']['body'] = '
<div style="padding:5px"><div style="border-bottom:1px inset black; padding-bottom:1px;margin-bottom:5px">
{NEWSCATICON}&nbsp;{NEWSCATEGORY}
</div>
{NEWSCAT_ITEM}
</div>
';
$NEWS_TEMPLATE['category']['item'] = '
<div style="width:100%;padding-bottom:2px">
<table style="width:100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="width:2px;vertical-align:top">&#8226;
</td>
<td style="text-align:left;vertical-align:top;padding-left:3px">
{NEWSTITLELINK}
<br />
</td></tr>
</table>
</div>
';
### Related 'start' - Options: Core 'single' shortcodes including {SETIMAGE}
### Related 'item' - Options: {RELATED_URL} {RELATED_IMAGE} {RELATED_TITLE} {RELATED_SUMMARY}