I have a view block that loads jplayer playlist in a region of all my pages. I have enabled ajax_pages module so that default configuration is running. I play the audio then navigate to another page but the player is not persistant. Audio quits and does not return to point in song where it was when the page was reloaded. What am I doing wrong?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

avillanueva-npr’s picture

Follow the readme that comes with the module

Your html.tpl.php should follow this general, overall, structure:

  <div id="page-wrapper">
    <?php print $page_top; ?>
    <?php print $page; ?>
    <?php print $page_bottom; ?>
  </div>

That ID is important. It can be whatever you want but I'm using page-wrapper.

Then in the settings under "/admin/config/user-interface/ajax-pages"

It should look similar to the attached image:
screenie

Anonymous’s picture

Hi avillanueva-npr,

Thanks for the reply. I did eventually find the readme. And I followed the instruction thoroughly(several times). However, I am getting this error now and don't know how to fix it.

Notice: Undefined variable: persistent in include() (line 19 of /Users/banghouse/Sites/banghouse/sites/all/themes/studio/templates/html.tpl.php).

My ajax_pages module configuration is exactly what you have shown attached.

I have this in my html.tpl.php:

  <?php print $persistent; ?>
  <div id="page-wrapper">
  <?php print $page_top; ?>
  <?php print $page; ?>
  <?php print $page_bottom; ?>
  </div>

I have this is my template.php which is in my omega subtheme named "studio":

function studio_preprocess_html(&$vars) {
 $variables['persistent'] = render($variables['page']['#excluded']['persistent']);
}

I have this in my studio.info:

regions[persistent] = 'Persistent'

And my view block that is loading a jplayer playlist is placed into my new persistent region which is in the footer zone.

jamix’s picture

You should be getting a PHP notice with that, too, because you're passing $vars to studio_preprocess_html() but refer to it as $variables in the function. This should fix it:

function studio_preprocess_html(&$variables) {
  $variables['persistent'] = render($variables['page']['#excluded']['persistent']);
}
Stathes’s picture

Issue summary: View changes

Hey I have tried the following implemtation but not with "persistent" - I have a scroll area which is getting refreshed each Ajax load and its reset to the top. Since this data doesn't change I do not want to reload and would be nice to keep scroll position. I would assume what was mentioned here would apply because your module reloads the page top, page, and page bottom.

After trying what you have above:

- printing an area "messages" in html.tpl.php.
- created a template.php file and put in your code and changed all instances of "persistent" to "messages". (I didn't have this file before could that be the issue?)

Unfortunately this doesn't seem to be working after clearing the cache. Would you possibly know why this is? I think this module is spectacular much better than drujax and Jquery Ajax load, and if I could just nail down this small issue I would be super stoked!

Thanks for your time and an incredible module!!