Calling to url /ajaxify/div.content/node/9 does work when node/9 has a div element with class=content:
<div class="content">
But it unable to find the requested content when the class of div element written like this:
<div class="node content">

So I modified this function:

function ajaxify_find_element($xml, $attr, $val) {
  // Loop through all element's children
  foreach ($xml->children() as $element) {
    // Check if the first child matches
    
    // find attribute, and if the attribute is class, we need to read it as 
    // array with spaces as delimiter
    $attrvalue = ajaxify_find_attribute($element, $attr);    
    if ($attr == 'class')
      $found = in_array((string)$val, explode(' ', $attrvalue));
    else
      $found = $attrvalue == (string)$val;
    
    if ($found) {
      return $element;
    }
    else {
      // Else, iterate to deeper level in XML
      $element = ajaxify_find_element($element, $attr, $val);
      if (is_object($element)) {
        // Return the found element from the previous iteration
        return $element;
      }
    }
  }
}

Comments

arhip’s picture

Status: Active » Needs review

This is a patch...

owahab’s picture

Status: Needs review » Reviewed & tested by the community

works fine for me.

owahab’s picture

Status: Reviewed & tested by the community » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.