Plugin

Archived
Forum
(read-only)

AJAX Pagination

ExpressionEngine 1.x, ExpressionEngine 2

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

     

No Response From Server

Support Request

areichert
areichert

I just purchased this add-on in hopes that it would solve my pagination issue. I tried to implement it and I’m getting an error message stating “no response from server” when clicking a pagination link. Go to http://test.gofinancialaid.com/blog/ to see this error.

The reason that I purchased this to begin with is because I use Structure to manage this Blog and I have one template that pulls up the multiple entries vs. single entry listing (as well as the filtered listings) based on what is in the URL segment. However, the current template code does not process P5, P10, P15, etc. in the URL segment, due to the nature of the if/then statements. Is that required for this add-on to work? If so, I may need to take another route…

Here is the code:

Primary Template

{if:else}
      
                      {exp
:channel:entries}
                      
<h2>{subtitle}</h2>
                      
{page_body}
                      {
/exp:channel:entries}
                                            
   {embed
="blog/ajax_pagination"}
                    
                    {
/if} 

Note: The if:else above is parsed when segment_2 is blank (i.e. http://test.gofinancialaid.com/blog/).

Embed

{exp:ajax_pagination:wrapper 
ajax_container
="ajax_container" 
embed_template_url="{site_url}/blog/ajax_pagination" 
process_indicator="process_indicator" 
process_indicator_scroll="yes" 
parse="inward"
}

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

<div class="process_indicator">
Loading…
</div>
                     
{exp:channel:entries limit="10" paginate="bottom" dynamic="off" channel="blog" parse="inward" {triggers:entries}}                 

                      
<h4><a href="{page_uri}">{title}</a></h4>            
                      <
p>{if page_image}{exp:imgsizer:size src="{page_image}" width="100" base_path="/home/gofinanc/public_html/test/" base_cache="/home/gofinanc/public_html/test/images/sized/" cache="no"<img src="{sized}" width="{width}" height="{height}" class="img-circle pull-left" /> {/exp:imgsizer:size}{exp:word_limit total="100"}{/if}{page_body text_only="yes"}{/exp:word_limit}<a href="{page_uri}">Read more here!</a></p>
                      <
p><strong>Categories:</strong{categories backspace="3"}<a href="{path=blog}">{category_name}</a> | {/categories}<br>
                      <
strong>Tags:</strong{exp:tag:tags entry_id="{entry_id}" backspace="3" orderby="tag_name" limit="5" websafe_separator="-"}<a href="{path=blog/tag/{websafe_tag}}">{tag}</a> | {/exp:tag:tags}</p>  
                          
{paginate}
    {exp
:ajax_pagination:links}
                          {if 
"{total_pages}" !=1}
                            
<hr />
                            <
p>Page {current_page} of {total_pages} pages {pagination_links}</p
                          
{/if}
    {
/exp:ajax_pagination:links}
                          {
/paginate}            
                      {
/exp:channel:entries}

{ajax_pagination_container_bottom}
</div>
{/ajax_pagination_container_bottom}

{
/exp:ajax_pagination:wrapper} 

Thanks in advance.

Laisvunas
# 1
Developer
Laisvunas

Hi,

The issue here is this:

The URL of the main template is http://test.gofinancialaid.com/blog/ Notice, that it is accessed through HTTP

But your code in embed template

embed_template_url="{site_url}/blog/ajax_pagination" 

outputs this URL of the embedded template: https://test.gofinancialaid.com/blog/ajax_pagination/  Notice, that it is accessed through HTTPS

So, there is mismatch between domain in which Javascript exists and the domain from which AJAX fetches data. Both should be accessed either through HTTPS or through HTTP.

 

areichert
# 2
areichert

Thanks! I hard-coded in the site_url without the HTTPS (http://test.gofinancialaid.com/blog/ajax_pagination) and it works.

Another quick question, is there any reason that the mouse pointer does not turn into a pointer hand when hovering over the pagination links? This seems to happen with your demo, and happens with other links on that page, so I was curious as to why…

Also, does this add-on require that the code be embedded? I assume so, based on the documentation, but would love to just keep it in the same template if possible.

Laisvunas
# 3
Developer
Laisvunas

Mouse pointer is just styling. Simply add the CSS rule

cursorpointer

for the pagination links.

Embedded template is a required feature. The code will not work otherwise.

 

areichert
# 4
areichert

Okay, great. Thanks for the quick support!