How to use? (with a solution)

NathanRAFT - January 5, 2008 - 21:32
Project:AJAXify
Version:5.x-1.x-dev
Component:Documentation
Category:support request
Priority:critical
Assigned:zeta ζ
Status:patch (code needs review)
Description

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

#1

baja_tz - January 8, 2008 - 22:15

subscribe

#2

scroogie - January 8, 2008 - 22:37

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.

#3

wolfraem - January 9, 2008 - 12:38

ditto

#4

vacilando - February 11, 2008 - 20:27
Priority:normal» critical

Subscribe...

#5

Tanc - February 16, 2008 - 13:20

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

#6

zeta ζ - March 25, 2008 - 18:05
Title:How to use?» How to use? (with a solution)
Assigned to:Anonymous» zeta ζ
Status:active» patch (code 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.

#7

teebo - April 29, 2008 - 11:59

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?

#8

zeta ζ - April 29, 2008 - 16:26

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?

#9

teebo - April 29, 2008 - 20:47

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.

#10

zeta ζ - April 29, 2008 - 22:23

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.

AttachmentSize
ajaxify.module.patch430 bytes

#11

teebo - April 30, 2008 - 12:28

Best solution is Javascript tools Dynamicload with Page Array.

#12

ogharib - May 15, 2008 - 09:02

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.

#13

ogharib - May 29, 2008 - 12:31

Hi zeta ζ,

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

Thanks.

 
 

Drupal is a registered trademark of Dries Buytaert.