Issue when enabling ajax

cameronp - May 26, 2009 - 11:23
Project:Paging
Version:6.x-1.x-dev
Component:User interface
Category:bug report
Priority:critical
Assigned:Unassigned
Status:active
Description

Hi There, Im having issues when enabling ajax loading - The newly loaded page appears below the original page, underneath the pager? (the orginal page still stays there)

The pager is outputing this html:

In pageing.js, line 123
its searching for paging-pager-contents (the pager at the bottom) and on line 142, its replacing this with the new content loaded.

So not sure what the go is to make it work...

Thanks,
Cameron

#1

cameronp - May 26, 2009 - 11:24

oops, souldnt have pasted in html

<div id="paging-pager-633" class="paging-pager-contents"><div class="links"><div class="item-list"><ul class="pager"><li class="pager-current first">1</li>
<li class="pager-item"><a href="/spiritual-dimensions/articles/qas-ndes?page=0,1" title="Go to page 2" class="active">2</a></li>
<li class="pager-item"><a href="/spiritual-dimensions/articles/qas-ndes?page=0,2" title="Go to page 3" class="active">3</a></li>
<li class="pager-item"><a href="/spiritual-dimensions/articles/qas-ndes?page=0,3" title="Go to page 4" class="active">4</a></li>
<li class="pager-next"><a href="/spiritual-dimensions/articles/qas-ndes?page=0,1" title="Go to next page" class="active">next ›</a></li>
<li class="pager-last last"><a href="/spiritual-dimensions/articles/qas-ndes?page=0,3" title="Go to last page" class="active">last »</a></li>
</ul></div></div>  </div>

#2

cameronp - May 26, 2009 - 11:38

FAIL on my part...

So basically I had pager set to bottom in the settings..

But I was manually printing the pager in my node.tpl.php, as i was doing some other funky stuff in there.

I was printing out the pager like print $node->content['paging']['#value'];

BAD MOVE ;)

In the settings, I set the pager location to none, and as the nice little description said there, just use $node->paging, so put that in my node.tpl.php, and viola... all working as expected...

Thanks again.

Cameron

#3

cameronp - May 26, 2009 - 12:40

Actually sorry, its still not working ;(

#4

Gurpartap Singh - May 26, 2009 - 13:03
Category:bug report» support request
Status:active» fixed

:)

#5

cameronp - May 27, 2009 - 16:58
Status:fixed» active

#6

cameronp - May 27, 2009 - 17:06

I think I was imagining it was working the other night - It was late ;9

Here is an example of the issue
http://testing2.belzebuub.com/ancient-gnosis/articles/-gospel-judas?page...

It is putting the wrapper div around the content now, but the ajaxifieng isnt working

here is my node.tpl.php

<?php
// $Id: node.tpl.php,v 1.5 2007/10/11 09:51:29 goba Exp $
?>

<div id="node-<?php print $node->nid; ?>" class="node<?php if ($sticky) { print ' sticky'; } ?><?php if (!$status) { print ' node-unpublished'; } ?>">
<?php print $picture ?>

<?php if (/*$page == 0 */ true): ?>
  <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2>
<?php endif; ?>   <?php if ($submitted): ?>
<span class="submitted"><?php print $submitted; ?></span>
  <?php endif; ?>
<div class="content clear-block">
      <?php 
                    drupal_add_js
('$(document).ready(function(){ $(".imagecache > img").wrap("<div class=\'img-wrapper\'></div>");});','inline');
                    if (
$teaser) {
                                    
                        print
$field_publishertheme_rendered;
                        print
$field_summary_rendered;
                    }
                    else {
                   
                   
                           
//We need to check if our node content contains a [banner] keyword.
                           
$bContainsBanner = true;
                            if (
strpos($node->content['body']['#value'], '[banner]') === false) {   
                               
$bContainsBanner = false;
                            }
                           
                           
drupal_add_js('$(document).ready(function(){ $(".dropshadow").wrap("<div class=\'img-wrapper\'></div>");});','inline');
                           
drupal_add_js('$(document).ready(function(){ $(".dropshadowright").wrap("<div class=\'img-wrapper-right\'></div>");});','inline');
                           
                           
$bannerHTML = '<div class="header-wrapper">';
                            if (
$node->field_publishertheme[0]["data"]["description"] != '') {
                               
$bannerHTML.= theme('imagecache',$node->field_publishertheme[0]["data"]["description"], base_path() . $node->field_publishertheme[0]["filepath"]);
                            }
                            else {
                                    if (
$node->field_publishertheme[0]["filepath"] != '') {
                                       
$bannerHTML.= theme('imagecache',"banner",$node->field_publishertheme[0]["filepath"]);
                                    }
                            }
                           
$bannerHTML .= '</div>';
                           
                            if (
$bContainsBanner) {
                                print
str_replace('[banner]',$bannerHTML,$node->content['body']['#value']);
                            }
                            else {
                               
//Print banner first by default.
                               
                               
print $bannerHTML;
                                print
$node->content['body']['#value'];
                            }
                            print
$node->content['nodehierarchy_children']['#value'];
                            print
$node->paging;
                           
/*var_dump($node->content['paging']); */
                           
print $node->content['book_navigation']['#value'];
                           
                    } 
?>

</div> <div class="clear-block">
    <?php if ($links): ?>
      <div class="links"><?php print $links; ?></div>
    <?php endif; ?>
</div>
</div>

#7

cameronp - May 27, 2009 - 17:04
Category:support request» bug report

#8

Gurpartap Singh - May 27, 2009 - 21:40

Try this change to paging.js:

<?php
-    .find('ul.pager > li > a, table.paging-drop-down a')
+    .
parent().find('ul.pager > li > a, table.paging-drop-down a')
?>

#9

cameronp - May 28, 2009 - 13:07

Great thanks for that its looking better,its sort of working now - main issue is the pager is now not changing to show which page its on after it ajaxify loads it, and the next and last pagers dont work with it...

I'm guessing there is probably some more jquery selects that I would need to change?

 
 

Drupal is a registered trademark of Dries Buytaert.