Не нравятся результаты поиска? Попробуйте другой поиск!
DLE FAQ » Все вопросы » MySQL » Different Template For Each news

Different Template For Each news


     15.09.2012    templates, news, shortstory    Все вопросы » MySQL    2603

вопрос
Hi,
I'm trying to make a small hack for news. with this hack i can use separate template for each news.
in show.short.php after this code:
$row['category'] = intval( $row['category'] );

we add this code:
if ($row["ntemp"] == 1) {
$tpl->load_template( 'mini_download.tpl' );
} else {
$tpl->load_template( 'shortstory.tpl' );}

this is some part of hack.
now everything is fine and working well, but just in main page!
my problem is, this code is working just in main page, in category page all news will loading with default template "shortstory.tpl", how i can fix this hack to show news with different template in main and category's page?
could u please help me for this hack?

Ответа пока нет


2 комментария

averin-kostya
Юзер

averin-kostya - 15 сентября 2012 20:12 -

Why don't you use standard functions of cms? In category settings you can assign a template for each category.
Item: Set the other template for this category.

ShoMpeT
Юзер

ShoMpeT - 15 сентября 2012 21:50 -

cuz i need to change template for each news, not all news for category

Чтобы комментировать - войдите или зарегистрируйтесь на сайте

Похожие вопросы

 18.09.2012 ShoMpeT  MySQL
наверх