Обсуждение CMS Made Simple в России.
Moderators: iturbay , wdwp
alex-b
Forum Members
Posts: 69 Joined: Fri Jun 05, 2009 3:19 am
Post
by alex-b » Thu Feb 20, 2014 3:08 pm
Здравствуйте!
Подскажите как сделать ЧПУ в модуле Products на детальной странице продукта, вот пациент
http://stroydomov.ru/catalog-1.html
В конфиге ЧПУ включено, модуль вызывается так
Code: Select all
{Products category='Дома из бруса' action='default' sortby="product_name" sortorder="asc" detailtemplate="new_tpl"}
guro
Power Poster
Posts: 985 Joined: Thu Apr 26, 2012 8:38 pm
Post
by guro » Thu Feb 20, 2014 3:18 pm
Шаблон покажите.
alex-b
Forum Members
Posts: 69 Joined: Fri Jun 05, 2009 3:19 am
Post
by alex-b » Thu Feb 20, 2014 3:23 pm
Вот суммарный шаблон
Code: Select all
{foreach from=$items item=entry}
{* accessing all of the fields in a list *}
{if count($entry->fields)}
<li onclick="location.href='{$entry->detail_url}';">
<div class="cat-li-box1">
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_1' && isset($field->thumbnail)}
<div class="cat-li-box2"><img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}"/></div>
{/if}
{/foreach}
<div class="cat-li-box3">
<span class="cat-li-text1">
{$entry->product_name}
</span>
<span class="cat-li-text2">
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'opt_1' && isset($field->value)}
{$field->value}
{/if}
{/foreach}
</span>
</div>
</div>
</li>
{/if}
{/foreach}
и детальный
Code: Select all
<div id="gallery-box">
<ul class="thumbnails">
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_1' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_2' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_3' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_4' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_5' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_6' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_7' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
<li>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_8' && isset($field->thumbnail)}
<a class="thumb" href="{$entry->file_location}/{$field->value}" title="{$entry->product_name}">
<img src="{$entry->file_location}/{$field->thumbnail}" alt="{$entry->product_name}" width="100" border="0" />
</a>
{/if}
{/foreach}
</li>
</ul>
<table cellpadding="0" cellspacing="0" width="100%" border="0">
<tr>
<td width="640">
<div class="main-image">
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'img_1' && isset($field->value)}
<img class="custom" src="{$entry->file_location}/{$field->value}" alt="{$entry->product_name}" />
{/if}
{/foreach}
</div>
</td>
<td valign="top">
<div class="options">Проект:
<span>
{$entry->product_name}
</span>
</div>
<div class="options">Общая площадь:
<span>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'opt_1' && isset($field->value)}
{$field->value}
{/if}
{/foreach}
</span>
</div>
<div class="options">Стены и перегородки:
<span>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'opt_2' && isset($field->value)}
{$field->value}
{/if}
{/foreach}
</span>
</div>
<div class="options">Объем бревна:
<span>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'opt_3' && isset($field->value)}
{$field->value}
{/if}
{/foreach}
</span>
</div>
<div class="options">S кровли:
<span>
{foreach from=$entry->fields key='name' item='field'}
{if $field->name == 'opt_4' && isset($field->value)}
{$field->value}
{/if}
{/foreach}
</span>
</div>
</td>
</tr>
</table>
</div>
guro
Power Poster
Posts: 985 Joined: Thu Apr 26, 2012 8:38 pm
Post
by guro » Thu Feb 20, 2014 3:33 pm
В "Контент" => "Управление продуктами" => "Настройки" => "Product Detail Settings:" => "Use Hierarchy Path in Product Detail URLS:" что стоит?
alex-b
Forum Members
Posts: 69 Joined: Fri Jun 05, 2009 3:19 am
Post
by alex-b » Thu Feb 20, 2014 3:37 pm
Вот скриншот
Attachments
guro
Power Poster
Posts: 985 Joined: Thu Apr 26, 2012 8:38 pm
Post
by guro » Thu Feb 20, 2014 3:49 pm
Версии CMS и Products?
alex-b
Forum Members
Posts: 69 Joined: Fri Jun 05, 2009 3:19 am
Post
by alex-b » Thu Feb 20, 2014 3:51 pm
Все последнее 1.11.10 "Pinzon" и Products 2.20.1