I think this is what I need to combine with cluetip. Right now it pulls the whole page and I only want it to pull certain content.

How do you specify the link for AJZAify?

Thanks

CommentFileSizeAuthor
#10 ajaxify.module.patch430 byteszeta ζ
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

baja_tz’s picture

subscribe

scroogie’s picture

From reading the code I understand you choose this field (Node Title (Ajax Load)) in a view and specify the source element to be retrieved and the sink element in which to put the content. It then rewrites the link to retrieve the content with this module, which mimicks index.php behaviour and then parses the output to find the right element. It uses SimpleXMLElement though, which means its PHP5 only.

wolfraem’s picture

ditto

Vacilando’s picture

Priority: Normal » Critical

Subscribe...

tanc’s picture

Would be extremely useful to have some documentation. Can the developer or someone else provide it?

zeta ζ’s picture

Title: How to use? » How to use? (with a solution)
Assigned: Unassigned » zeta ζ
Status: Active » Needs review

Define a link on your page with the following property;-onclick="return ajaxify('target', 'ajaxify/source'); — It’s a good idea to have href="source" too.

target
this should take the form «tag»#«id» eg. div#ajax_node. This element should be on the same page as the link you are defining.
source
this should take the form {«tag»# or +«id»|«tag».«class»}/path eg. div.node/node/2. This element should exist on the page returned when you look at example.com/«path». (not sure about # or +)

You should now have something similar to <a onclick="return ajaxify('div#ajax_node', 'ajaxify/div.node/node/2'); href="example.com/node/2">...</a>

If there are other possibilities, or If this doesn’t work for you, please post here. Someone might eventually put this in some official documentation.

Teebo’s picture

Hi,

I'm getting a hard time trying to make this work... and I really need it!

This is what I'm implementing: onclick="return ajaxify('div#column2Content', 'ajaxify/div#column2Content/node/12');"

Where the column2Content layer has all teh content variables ($title, $content...) in page.tpl.php .

I'm getting a fatal error.

Any clues why?

zeta ζ’s picture

Can you confirm that you have;
<a onclick="return ajaxify('div#column2Content', 'ajaxify/div#column2Content/node/12');">...</a>

and

<div id="column2Content">...</div> in the same page as the link above, and in node 12?

If yes, only thing I can think of is that if your link is inside <div id="column2Content">...</div>, that might cause confusion to the script.

What is the error returned?

Teebo’s picture

Thanks for answering so fast.

Yes, I confirm. My div with id="column2Content" is my content container. So every node (actually, page.tpl.php) has it.

I even installed a dummy Drupal (v.5.7) with nothing else but AJAXify and JQuery update (all three with the latest versions).

To make it work, I had to apply every ~"patch" from the issues ( http://drupal.org/project/issues/ajaxify ). And even then, it's not 100% reliable. UNFORTUNATELY because I really want to get this module working.

I even tried with different JQuery files (from 1.1.4 to 1.2.3).

Do you have an example / site where AJAXify is completely functional?

Here is the Fatal error:

Fatal error: Uncaught exception 'Exception' with message 'String could not be parsed as XML' in 
/Library/WebServer/Documents/Site1Drupal/Drupal/sites/all/modules/ajaxify/ajaxify.module:72 Stack trace: #0 
/Library/WebServer/Documents/Site1Drupal/Drupal/sites/all/modules/ajaxify/ajaxify.module(72): SimpleXMLElement->__construct('<!DOCTYPE html ...') #1 
[internal function]: ajaxify_init() #2 
/Library/WebServer/Documents/Site1Drupal/Drupal/includes/module.inc(406): call_user_func_array('ajaxify_init', Array) #3 
/Library/WebServer/Documents/Site1Drupal/Drupal/includes/common.inc(1866): module_invoke_all('init') #4 
/Library/WebServer/Documents/Site1Drupal/Drupal/includes/bootstrap.inc(922): _drupal_bootstrap_full() #5 
/Library/WebServer/Documents/Site1Drupal/Drupal/includes/bootstrap.inc(862): _drupal_bootstrap(7) #6 
/Library/WebServer/Documents/Site1Drupal/Drupal/index.php(13): drupal_bootstrap(7) #7 
{main} thrown in /Library/WebServer/Documents/Site1Drupal/Drupal/sites/all/modules/ajaxify/ajaxify.module on line 72

I also often get this error simply by browsing a node (not called initially via AJAXify):

warning: SimpleXMLElement::__construct() [function.SimpleXMLElement---construct]: ^ in /Library/WebServer/Documents/Site1Drupal/Drupal/sites/all/modules/ajaxify/ajaxify.module on line 72.

This is my configuration:
MySQL database 5.0.45
PHP 5.2.5
PHP register globals Disabled
Unicode library PHP Mbstring Extension
Web server Apache/2.2.8 (Unix) mod_ssl/2.2.8 OpenSSL/0.9.7l DAV/2 PHP/5.2.5

Thanks again for your input.

zeta ζ’s picture

FileSize
430 bytes

You’re welcome to have a look at http://www.scymi.org/bif/ there is not much data in there, and it is only phase I. But click on a link like Reuters, and it will populate the upper box with a node.

The only change I’ve made is in the patch: Not sure, but I think it was specific to what I was doing; shouldn’t hurt though.

Teebo’s picture

Best solution is Javascript tools Dynamicload with Page Array.

ogharib’s picture

Hi teebo,

You have to make sure that the output of your "ajaxify/div#column2Content/node/12" page has an XML structure.

I had the same problem, but the error message disappeared when I found a <br> that I replaced with <br />.

Note that: if you are using TinyMCE module, you would need to set (in "Cleanup and output" section in the module's settings page):
"Verify HTML" to "true" (this will make TinyMCE use <br /> instead of <br>)

Do not forget to update your old nodes to apply the "Verify HTML" option on them.

I hope that would help.

ogharib’s picture

Hi zeta ζ,

Your submitted patch in #10 solved a "too much recursion" problem that I had faced a few days ago.

Thanks.