Skip to content

Commit

Permalink
fix for news category template option
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmi08 committed Aug 27, 2023
1 parent c8e2c6b commit df84ef0
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
7 changes: 6 additions & 1 deletion e107_plugins/news/shortcodes/batch/news_shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1202,7 +1202,12 @@ function sc_news_related($array=array())
$array['types'] = 'news,page';
}

$template = e107::getTemplate('news', 'news', 'related');
$template = e107::getTemplate('news', 'news_view', 'related');

/* just callback for older themes */
if(empty($template)) {
$template = e107::getTemplate('news', 'news', 'related');
}

return e107::getForm()->renderRelated($array, $this->news_item['news_meta_keywords'], array('news'=>$this->news_item['news_id']),$template);
}
Expand Down
12 changes: 0 additions & 12 deletions e107_plugins/news/templates/news_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,15 +164,3 @@
$NEWS_TEMPLATE['2-column']['end'] = '</div>';


### Related 'start' - Options: Core 'single' shortcodes including {SETIMAGE}
### Related 'item' - Options: {RELATED_URL} {RELATED_IMAGE} {RELATED_TITLE} {RELATED_SUMMARY}
### Related 'end' - Options: Options: Core 'single' shortcodes including {SETIMAGE}
/*
$NEWS_TEMPLATE['related']['start'] = "<hr><h4>".defset('LAN_RELATED', 'Related')."</h4><ul class='e-related'>";
$NEWS_TEMPLATE['related']['item'] = "<li><a href='{RELATED_URL}'>{RELATED_TITLE}</a></li>";
$NEWS_TEMPLATE['related']['end'] = "</ul>";*/

$NEWS_TEMPLATE['related']['caption'] = '{LAN=RELATED}';
$NEWS_TEMPLATE['related']['start'] = '{SETIMAGE: w=350&h=350&crop=1}<div class="row">';
$NEWS_TEMPLATE['related']['item'] = '<div class="col-md-4"><a href="{RELATED_URL}">{RELATED_IMAGE}</a><h3><a href="{RELATED_URL}">{RELATED_TITLE}</a></h3></div>';
$NEWS_TEMPLATE['related']['end'] = '</div>';
17 changes: 16 additions & 1 deletion e107_plugins/news/templates/news_view_template.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
</div>
{NEWSRELATED}
{NEWS_RELATED}
<ul class="pagination justify-content-between my-5 news-view-pagination">
<li class="page-item col-md-4">{NEWS_NAV_PREVIOUS}</li>
Expand Down Expand Up @@ -113,3 +113,18 @@
$NEWS_VIEW_TEMPLATE['nav']['previous'] = '<a rel="prev" href="{NEWS_URL}">{GLYPH=fa-chevron-left}<span class="mx-1">{NEWS_TITLE}</span></a>';
$NEWS_VIEW_TEMPLATE['nav']['current'] = '<a class="text-center" href="{NEWS_NAV_URL}">{LAN=BACK}</a>';
$NEWS_VIEW_TEMPLATE['nav']['next'] = '<a rel="next" class="text-right" href="{NEWS_URL}"><span class="mx-1">{NEWS_TITLE}</span>{GLYPH=fa-chevron-right}</a> ';



### Related 'start' - Options: Core 'single' shortcodes including {SETIMAGE}
### Related 'item' - Options: {RELATED_URL} {RELATED_IMAGE} {RELATED_TITLE} {RELATED_SUMMARY}
### Related 'end' - Options: Options: Core 'single' shortcodes including {SETIMAGE}
/*
$NEWS_TEMPLATE['related']['start'] = "<hr><h4>".defset('LAN_RELATED', 'Related')."</h4><ul class='e-related'>";
$NEWS_TEMPLATE['related']['item'] = "<li><a href='{RELATED_URL}'>{RELATED_TITLE}</a></li>";
$NEWS_TEMPLATE['related']['end'] = "</ul>";*/

$NEWS_VIEW_TEMPLATE['related']['caption'] = '{LAN=RELATED}';
$NEWS_VIEW_TEMPLATE['related']['start'] = '{SETIMAGE: w=350&h=350&crop=1}<div class="row">';
$NEWS_VIEW_TEMPLATE['related']['item'] = '<div class="col-md-4"><a href="{RELATED_URL}">{RELATED_IMAGE}</a><h3><a href="{RELATED_URL}">{RELATED_TITLE}</a></h3></div>';
$NEWS_VIEW_TEMPLATE['related']['end'] = '</div>';

0 comments on commit df84ef0

Please sign in to comment.