Hi,

I'd like to know how to theme the loading.
I saw views_infinite_scroll_theme.inc but i don't know how to ad my own html code.
Can this module have a tpl?
Through the function theme_views_infinite_scroll_pager i don't know how to theme using template.php

thanks in advance

Comments

carvalhar’s picture

i found this at views_plugin_pager_infinite_scroll.inc:
$img_path = $base_url . '/' . drupal_get_path('module', 'views_infinite_scroll') . '/images/ajax-loader.gif';

I could change the image hacking the module, but how can i add a text with

there?

7immy’s picture

Showing something like..

~~~Loading~~~
20 of 250 posts

..would be brilliant!

Anyone know how I could at least get the current number of posts and total?
Thanks

Josephnewyork’s picture

I wanted to shange the location of the ajax-loader gif to one that I liked. Here what I did:

/template.php

function MY_THEME_views_infinite_scroll_pager($vars) {
	global $base_url;
	$vars['img_path'] = $base_url . '/' . drupal_get_path('theme', 'MY_THEME') . '/images/ajax-loader.gif';
	return theme_views_infinite_scroll_pager($vars);
}

I wrote this similar to if this mod had a _preprocess_ hook on its settings. Would be nice if it did it, but this works all the same.

Remon’s picture

Category: support » feature
mwesthof’s picture

Or with a preprocess implementation.
You can add this to your template.php:

<?php
function YOURTHEME_preprocess_views_infinite_scroll_pager(&$variables) {
  global $base_url;
  $variables['img_path'] = $base_url . '/' . drupal_get_path('theme', 'YOURTHEME') . '/images/ajax-loader.gif';
}
?>
flinth’s picture

#3 worked for me, thanks !

fearlsgroove’s picture

Issue summary: View changes
Status: Active » Closed (duplicate)