Jump to content

22.Уникальный шаблон через $GET_


Александр

Recommended Posts

Александр

в шаблоне index.html

делаем примерно так:

{config_load file="$language/lang_$language.conf" section="index"}
{include file="`$smarty.const.DIR_FS_CATALOG``$tpl_path`inc/header.tpl"}

{php}
if ($GET_['cat'] !=0) {
{/php}
<div id="wrap">
{php}
}
else {
{/php}
<div id="cleanwrap">
{php}
}
{/php}
		<div id="content">	
			{$main_content}	
		</div>
	</div>
{include file="`$smarty.const.DIR_FS_CATALOG``$tpl_path`inc/footer.tpl"}

Это заинклюдили шапку, подвал, а в середине у нас класс для мест, где есть категории в $GET_ присваивается индивидуально.

Пофантазировав можно довольно гибко настроить через css и такие условия вывод любой страницы.

 

Если кто знает как обойтись без {php} - приведите пример.

 

Link to post
Share on other sites
Александр

да, уже нашёл, как раз хотел дописать тут:

{config_load file="$language/lang_$language.conf" section="index"}
{include file="`$smarty.const.DIR_FS_CATALOG``$tpl_path`inc/header.tpl"}

{if $smarty.get.cat != 0}
<div id="cleanwrap">
{else}
<div id="wrap">
{/if}
		<div id="content">	
			{$main_content}	
		</div>
	</div>
{include file="`$smarty.const.DIR_FS_CATALOG``$tpl_path`inc/footer.tpl"}

благодарю за оперативность.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...