Plugin

Archived
Forum
(read-only)

Infinite Scroll

ExpressionEngine 1.x, ExpressionEngine 2

Back to this add-on's main page
View Other Add-ons From Laisvunas

     

Getting Started Help

Support Request

Sneed's Feed & Seed
Sneed's Feed & Seed

I’m having a little trouble getting going, can you point me in the right direction? I’m using Infinite Scroll on a Zoo Triggers category listing. Here’s my template code:

Main Template (URL: http://www.mysite.com/products/category/car-seats):

<div class="row">
  <
div class="ten columns">
    
{embed='ajax/products_scroll' category_id='{if triggers:segment_4}{triggers:cat_id_4}{if:else}{triggers:cat_id_3}{/if}' }
  
</div><!--/.ten.columns-->
</
div><!--/.row--> 

Embedded Template:

{exp:infinite_scroll:wrapper 
  ajax_container
='i-scroll'
  
embed_template_url='{site_url}ajax/products_scroll'
  
process_indicator='process_indicator'
  
parse='inward'
}
{infinite_scroll_container_top}
<ul class="block-grid two-up mobile cat-listing" id='i-scroll'>
{/infinite_scroll_container_top}

  {exp
:channel:entries
    channel
='products'
    
dynamic='no'
    
disable='categories|member_data'
    
orderby='my_custom_Field'
    
limit='6'
    
category='{embed:category_id}'
    
paginate='bottom'
    
parse='inward'
  
}
    {
!-- Listing Item Code --}

    {paginate}
    {if next_page}
    
<div class="process_indicator">
    
Loading…
    
</div>
    
{exp:infinite_scroll:next_chunk_data}{auto_path}{/exp:infinite_scroll:next_chunk_data}
    {
/if}
    {
/paginate}

  {
/exp:channel:entries}

{infinite_scroll_container_bottom}
</ul>
{/infinite_scroll_container_bottom}

{
/exp:infinite_scroll:wrapper} 

Right now I’m just getting a blank template.

Also, I’ve never seen ‘parse=“inward”’ used on a module tag before, I thought it only worked on plugins?

Laisvunas
# 1
Developer
Laisvunas

Hi,

parse="inward" 

works both for plugins and modules.

To see if variables triggers:segment_4 and triggers:segment_3 were parsed correctly add this code on the top of embed template:

embed:category_id[{embed:category_id}]<br><br
Sneed's Feed & Seed
# 2
Sneed's Feed & Seed

That was part of my problem, I was using the wrong segment numbers.

I actually realized that I probably don’t need to embed the category id as a variable, since the embedded channel entries tag can access the main page’s segments. So I updated my templates:

Main Page:

<div class="row">
        <
div class="ten columns">
          
{embed='ajax/products_scroll'}
        
</div><!--/.ten.columns-->
      </
div><!--/.row--> 

Embedded Template:

{exp:infinite_scroll:wrapper 
  ajax_container
='i-scroll'
  
embed_template_url='{site_url}ajax/products_scroll'
  
process_indicator='process_indicator'
  
parse='inward'
}
{infinite_scroll_container_top}
<ul class="block-grid two-up mobile cat-listing" id='i-scroll'>
{/infinite_scroll_container_top}

  {exp
:channel:entries
    channel
='products'
    
dynamic='no'
    
disable='categories|member_data'
    
orderby='my_custom_field'
    
limit='6'
    
paginate='bottom'
    
parse='inward'
    
{triggers:entries}
  }
    {
!-- Listing Item Content --}

    {paginate}
    {if next_page}
    
<div class="process_indicator">
    
Loading…
    
</div>
    
{exp:infinite_scroll:next_chunk_data}{auto_path}{/exp:infinite_scroll:next_chunk_data}
    {
/if}
    {
/paginate}

  {
/exp:channel:entries}

{infinite_scroll_container_bottom}
</ul>
{/infinite_scroll_container_bottom}

{
/exp:infinite_scroll:wrapper} 

The first 6 products are displaying, but the “Loading…” indicator is fixed at the bottom and no new entries are being loaded.

 

Laisvunas
# 3
Developer
Laisvunas

Hi Kristen,

What is being outputted by the variable {triggers:entries}?

Sneed's Feed & Seed
# 4
Sneed's Feed & Seed

From the Zoo Triggers docs:

This global variable is used in {exp:channel:entries}, it will generate the necessary code for filtering your entries on categories, year/month and tags.

The point of ZT is to be able to output category listings using Structure URLs rather than EE’s native template-based URLs, which is what I’m doing. So if I didn’t have that {triggers:entries} variable, the {exp:channel:entries} tag would output every entry in the products channel because it wouldn’t recognize the extra URL segments as category filters. It’s really similar to Freebie, it just consolidates those commonly used functions into one module.

Make sense?

Sneed's Feed & Seed
# 5
Sneed's Feed & Seed

One other thing I just noticed in the console:

Uncaught ReferenceError: infiniteScrollData1 is not defined

For the inserted javascript on this line near the bottom:

if (infiniteScrollData1.continuous_scroll_pagination_segment// there are data to scroll 
noop46
# 6
noop46

Getting same thing. Using Solspace Super Search (doesn’t work with my channel entries either). Get first 6 results (from limit 6), with the loading process indicator showing, and that’s all. No results, no errors logged to console. No error messages. I ensured the keywords are being passed properly through the embed.

I also sometimes get the error in console:

Uncaught ReferenceError: infiniteScrollData1 is not defined

Initial template:

<ul id="moreContainer" class="row">

        
{embed="search/search_result_list_item_scroll" keywords="{super_search_keywords}"}
</ul

Embedded Template:

{exp:infinite_scroll:wrapper ajax_container="ajax_container" embed_template_url="{site_url}/search/search_results_list_item_scroll" process_indicator="process_indicator" parse="inward"}

{infinite_scroll_container_top}
<div id="ajax_container">
{/infinite_scroll_container_top}


{embed
:keywords}
{exp
:super_search:results
    paginate
="bottom"
    
keywords="{embed:keywords}"
    
status="Open"
    
limit="6"
    
dynamic="off"
  
}
  
      
 {title} 
<br>


 
{paginate}
  {if next_page}
   
<div class="process_indicator">
   
Loading…
   
</div>

   
{pagination_links}
   {next_page}
   {pagination_url}
   {exp
:infinite_scroll:next_chunk_data}{pagination_url}{/exp:infinite_scroll:next_chunk_data}
   {
/next_page}
   {
/pagination_links}

  {
/if}
 {
/paginate}

{
/exp:super_search:results}

{infinite_scroll_container_bottom}
</div><!-- End of # ajax_container -->
{/infinite_scroll_container_bottom}

{
/exp:infinite_scroll:wrapper} 

Please advise, and thank you.

Laisvunas
# 7
Developer
Laisvunas

Hi Kristen and Anthony,

Please, post URL of your main template here.

noop46
# 8
noop46

I emailed you details to saugos@gmail.com

Sneed's Feed & Seed
# 9
Sneed's Feed & Seed

I also sent you an email via your expressionengine.com profile.

Guy
# 10
Guy

anthonycollini did you ever solve the Super Search/Infinite Scroll issue?  I am trying to get it working with Super Search and not having luck at the moment.

Laisvunas
# 11
Developer
Laisvunas

Hi Guy,

I would like to help you, but I don’t own a licence of Super Search add-on.

Guy
# 12
Guy

Thanks I’m still working through the issue.  I’ve gotten it to work but still have a problem when a search is performed for an exact phrase - the quotes seem to cause an issue for Super Search.  I think the Infinite Scroll portion is working as it should but I think Super Search may be having an issue with an exact phrase when the keywords parameter is used.  Plan to work on it today so hopefully I’ll make some progress.  Not sure if Solspace could grant any kind of testing license but that could be a possibility.  Although I don’t think my issue at this point is an Infinite Scroll issue.

Bryan Lewis
# 13
Bryan Lewis

Was there a solution to this? I’m experiencing exactly the same thing here. Not using solspace’s super-search and not geting console errors, but generally same exact code and same results: “Loading…” on the bottom.

Laisvunas
# 14
Developer
Laisvunas

Hi Bryan,

Please, post here your template code. URL of your page wich outputs this error also would be helpful.

Bryan Lewis
# 15
Bryan Lewis

I switched it to a different library that requires a click to load for now (some alpha test) BUT I will definitely be coming back to this in a week or so and will be able to revert and post my original code that uses your module at that time.

Thanks!