Перейти к содержанию
Официальный форум поддержки Simpla

Рекомендуемые сообщения

  • 4 месяца спустя...

 

 

Поставил. Не работает....

 

<div id="page_title">
    <p><a href="./">Главная</a>
    {if $category}
        {foreach from=$category->path item=cat} » <a class='link_2' href="catalog/{$cat->url}">{$cat->name|escape}</a>{/foreach}
        {if $brand}» <a class='link_2' href="catalog/{$cat->url}/{$brand->url}">{$brand->name|escape}</a>{/if}
    {elseif $brand}» <a class='link_2' href="brands/{$brand->url}">{$brand->name|escape}</a>
    {elseif $keyword}» Поиск
    {/if}
    </p>    
    <h1>
    {if $keyword}Поиск {$keyword|escape}
    {elseif $page}{$page->name|escape}
    {else}{$category->name|escape} {$brand->name|escape} {$keyword|escape}
    {/if}
    </h1>    
</div>


{if $current_page_num==1 && $category->description}<div id="category_description">{if $page->body}<p>{$page->body}</p>{/if}{$category->description}</div>{/if}
{if $brand->description && $current_page_num==1}<div id="category_description"><h2>{$brand->name}</h2>{$brand->description}</div>{/if}
{if $features || $category->brands}
    <div id="features">
    <ul>
    {if $category->brands}
        <li>
        <p class="name">Бренды</p>
        <p class="values">
        <a href="catalog/{$category->url}" class='hover_mouse{if !$brand->id} selected{/if}'>Все</a>
        {foreach name=brands item=b from=$category->brands}
        <a href="catalog/{$category->url}/{$b->url}" class='hover_mouse{if $b->id == $brand->id} selected{/if}' data-brand="{$b->id}">{$b->name|escape}</a>
        {/foreach}
        </p>
        </li>
    {/if}


    {if $features}
        {foreach $features as $f}
        <li>
        <p class="name" data-feature="{$f->id}">{$f->name}:</p>
        <p class="values">
        <a href="{url params=[$f->id=>null, page=>null]}" class='hover_mouse{if !$smarty.get.$f@key} selected{/if}'>Все</a>
        {foreach $f->options as $o}<a href="{url params=[$f->id=>$o->value, page=>null]}" class='hover_mouse{if $smarty.get.$f@key == $o->value} selected{/if}'>{$o->value|escape}</a>{/foreach}
        </p>
        </li>
        {/foreach}
    {/if}
    </ul>
    </div>
{/if}


{if $products}
    {include file='pagination.tpl'}
    <ul class="tiny_products">
    {foreach $products as $product}
    <li class="product">{include file='tpl_products_blocks.tpl'}</li>
    {/foreach}    Просмотров: {$product->views}
    </ul>
    {include file='pagination.tpl'}
{else}<h4 style='padding:50px 0;'>Сейчас здесь нет предложений<br />Попробуйте зайти позже</h4>{/if}


{literal}
<script>
$(function() {
    // Раскраска строк характеристик
    $("#features li:even").addClass('even');
    // Выбор вариантов
    $('select[name=variant]').change(function() {
        price = $(this).find('option:selected').attr('price');
        compare_price = '';
        if(typeof $(this).find('option:selected').attr('compare_price') == 'string')
            compare_price = $(this).find('option:selected').attr('compare_price');
        $(this).find('option:selected').attr('compare_price');
        $(this).closest('form').find('span').html(price);
        $(this).closest('form').find('strike').html(compare_price);
        return false;
    });
});
</script>


<script>window.jQuery || document.write("<script src='jquery-1.7.2.js'>\x3C/script>")</script>
    
    <script src="design/{$settings->theme}/js/jquery.infinitescroll.js"></script>
    
    <script>
    $('.products').infinitescroll({
        navSelector      : ".pagination",
        nextSelector     : ".next_page_link",
        itemSelector     : ".products li",
    });
        </script>


{/literal}
 

 

 

Ты заключил весь код в литералы, соотвественно у тебя часть кода понимается как текст, а оно должно отрабатываться php. У тебя есть строчка <script src="design/{$settings->theme}/js/jquery.infinitescroll.js"></script>. Она в коде html у тебя так и будет отображаться. А надо чтобы вместо {$settings->theme} подставлялось название твоей темы оформления.

 

Если не менять на название темы, то должно выглядеть вот так вот так:

{literal}
<script>
$(function() {
    // Раскраска строк характеристик
    $("#features li:even").addClass('even');
    // Выбор вариантов
    $('select[name=variant]').change(function() {
        price = $(this).find('option:selected').attr('price');
        compare_price = '';
        if(typeof $(this).find('option:selected').attr('compare_price') == 'string')
            compare_price = $(this).find('option:selected').attr('compare_price');
        $(this).find('option:selected').attr('compare_price');
        $(this).closest('form').find('span').html(price);
        $(this).closest('form').find('strike').html(compare_price);
        return false;
    });
});
</script>
{/literal}

<script>window.jQuery || document.write("<script src='jquery-1.7.2.js'>\x3C/script>")</script>
    
    <script src="design/{$settings->theme}/js/jquery.infinitescroll.js"></script>
{literal}
    <script>
    $('.products').infinitescroll({
        navSelector      : ".pagination",
        nextSelector     : ".next_page_link",
        itemSelector     : ".products li",
    });
        </script>


{/literal}

 

Или оставь как есть в тво>м варианте, но только вместо {$settings->theme} вставь имя темы оформления!

Ссылка на сообщение
Поделиться на другие сайты
  • 3 месяца спустя...

Все получилось. Спасибо!

 

Добавляем:

 

{include file='pagination.tpl'}	

<script src="design/{$settings->theme|escape}/js/jquery.infinitescroll.js"></script>
{literal}
    <script>
    $('.tiny_products').infinitescroll({
        navSelector      : ".pagination",
        nextSelector     : ".next_page_link",
        itemSelector     : ".tiny_products li",
    });
        </script>
 {/literal}

 

Строка: $('.tiny_products').infinitescroll({ 

Тут .tiny_products может быть заменен на .products 

-

Строка: itemSelector : ".tiny_products li",

Тут .tiny_products li может быть заменен на .products li

В разных шаблонах по разному. 

 

 

Изменено пользователем larenso
Ссылка на сообщение
Поделиться на другие сайты
  • 1 месяц спустя...

Подскажите, как прописать для .products li и .tiny_products li одновременно

 

сделал так - работает )

 

{literal}

<script>
$('.tiny_products, .products').infinitescroll({
navSelector : ".pagination",
nextSelector : ".next_page_link",
itemSelector : ".tiny_products li, .products li",
});
</script>
{/
literal}

Изменено пользователем Gendalf
Ссылка на сообщение
Поделиться на другие сайты
// usage:
// $(elem).infinitescroll(options,[callback]);
 
// infinitescroll() is called on the element that surrounds 
// the items you will be loading more of
$('#content').infinitescroll({
 
  navSelector  : "div.navigation",            
                 // selector for the paged navigation (it will be hidden)
 
  nextSelector : "div.navigation a:first",    
                 // selector for the NEXT link (to page 2)
 
  itemSelector : "#content div.post",          
                 // selector for all items you'll retrieve
 
  debug        : true,                        
                 // enable debug messaging ( to console.log )
 
  loadingImg   : "/img/loading.gif",          
                 // loading image.
                 // default: "http://www.infinite-scroll.com/loading.gif"
 
  loadingText  : "Loading new posts...",      
                 // text accompanying loading image
                 // default: "<em>Loading the next set of posts...</em>"
 
  animate      : true,      
                 // boolean, if the page will do an animated scroll when new content loads
                 // default: false
 
  extraScrollPx: 50,      
                 // number of additonal pixels that the page will scroll 
                 // (in addition to the height of the loading div)
                 // animate must be true for this to matter
                 // default: 150
 
  donetext     : "I think we've hit the end, Jim" ,
                 // text displayed when all items have been retrieved
                 // default: "<em>Congratulations, you've reached the end of the internet.</em>"
 
  bufferPx     : 40,
                 // increase this number if you want infscroll to fire quicker
                 // (a high number means a user will not see the loading message)
                 // new in 1.2
                 // default: 40
 
  errorCallback: function(){},
                 // called when a requested page 404's or when there is no more content
                 // new in 1.2                   
 
  localMode    : true
                 // enable an overflow:auto box to have the same functionality
                 // demo: http://paulirish.com/demo/infscr
                 // instead of watching the entire window scrolling the element this plugin
                 //   was called on will be watched
                 // new in 1.2
                 // default: false
 
    },function(arrayOfNewElems){
 
     // optional callback when new content is successfully loaded in.
 
     // keyword `this` will refer to the new DOM content that was just added.
     // as of 1.5, `this` matches the element you called the plugin on (e.g. #content)
     //                   all the new elements that were found are passed in as an array
 
});

полные настройки, может кому пригодится... тема хороша...

Ссылка на сообщение
Поделиться на другие сайты
  • 2 года спустя...

Присоединяйтесь к обсуждению

Вы можете написать сейчас и зарегистрироваться позже. Если у вас есть аккаунт, авторизуйтесь, чтобы опубликовать от имени своего аккаунта.

Гость
Ответить в этой теме...

×   Вставлено с форматированием.   Вставить как обычный текст

  Разрешено использовать не более 75 эмодзи.

×   Ваша ссылка была автоматически встроена.   Отображать как обычную ссылку

×   Ваш предыдущий контент был восстановлен.   Очистить редактор

×   Вы не можете вставлять изображения напрямую. Загружайте или вставляйте изображения по ссылке.

Загрузка...
×
×
  • Создать...