Zemanta is currently only available when adding a new node. It would be great to be able to use it when editing nodes as well.

Comments

JureCuhalev’s picture

This makes sense. We'll include this for our next release.

JureCuhalev’s picture

Assigned: Unassigned » JureCuhalev
ddyrr’s picture

Status: Active » Needs review

I was able to make this work by simply changing the zemanta_show() function in zemanta.module to the following:


function zemanta_show($op = 'add') {
  $node_types = variable_get('zemanta_node_types', array());

  if (arg(2) == 'edit' && is_numeric(arg(1))) {
	  $type = db_result(db_query("SELECT type FROM {node} WHERE nid=%d",arg(1)));
  } else {
	  $type = arg(2);
  }

  if ($op == 'add') {
	if (arg(0) == 'node' && ((arg(1) == 'add') || (arg(2) == 'edit')) && in_array($type, $node_types, TRUE)) {
      return TRUE;
    }
  }
  else if ($op == 'view') {
    return TRUE;
  }
  return FALSE;
}

Rok Žlender’s picture

Status: Needs review » Fixed

Thanks ddyrr I committed your fix to D5 and D6 version.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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