Query connections

   * Set NOWYSIWYG = 1
%STARTSECTION{"js"}%<script>
jQuery(document).ready(function () {
    var d = new Date;
    jQuery('#CritterGraph img').attr('src', jQuery('#CritterGraph img').attr('src') + '?t=' + d.getTime());
  });
</script>%ENDSECTION{"js"}%
%STARTSECTION{"autocomplete"}%<literal>%SEARCH{
  ".*%URLPARAM{"q"}%.*"
  type="regex"
  scope="topic"
  nonoise="on"
  header="["
  format="\"$topic\""
  format2="$topic"
  separator=","
  footer="]"
}%</literal>%ENDSECTION{"autocomplete"}%

%STARTSECTION{"CritterGraph"}%
%URLPARAM{"dotdebug" default="<dot"}% map="on" vectorformats="svg" >
%STARTSECTION{"dotcode"}%
  digraph Properties { 
  rankdir=LR;
  label="Associations Graph";
  labelloc=t;
  labeljust=l;
  dpi=70;
  %FORMAT{
    "%URLPARAM{"Critters" multiple="on" separator=","}%"
    format="  $percntINCLUDE{\"%TOPIC%\" section=\"doproperties\" subject=\"$topic\"}$percnt
  $percntINCLUDE{\"%TOPIC%\" section=\"dobacklinks\" subject=\"$topic\"}$percnt"
  }%
}%%ENDSECTION{"dotcode"}%
%URLPARAM{"dotdebug" default="</dot>"}%
%ENDSECTION{"CritterGraph"}%

%STARTSECTION{"dobacklinks"}%%SEARCH{
  "slvalues[value='%subject%']"
  type="query"
  nonoise="on"
  format="\"$topic\" -> \"%subject%\" [label=\"$percntQUERY{\"'$web.$topic'/slvalues[value='%subject%' AND property!='Cite'].property\"}$percnt\"];
  \"$topic\" [URL=\"%SCRIPTURLPATH{"view"}%/$web/$topic\"];"
}%%ENDSECTION{"dobacklinks"}%

%STARTSECTION{"doproperties"}%%FORMAT{
  "%QUERY{"'%subject%'/slproperties[name!='Cite'].name"}%"
  type="string"
  format="$percntINCLUDE{\"%TOPIC%\" section=\"dovalues\" subject=\"%subject%\" property=\"$item\"}$percnt"
}%%ENDSECTION{"doproperties"}%

%STARTSECTION{"dovalues"}%%FORMAT{
    "%QUERY{"'%subject%'/slvalues[property='%property%'].value"}%"
    type="topic"
    format="\"%subject%\" -> \"$topic\" [label=\"%property%\"];
\"%subject%\" [URL=\"%SCRIPTURLPATH{"view"}%/$web/%subject%\"];
\"$topic\" [URL=\"%SCRIPTURLPATH{"view"}%/$web/$topic\"];"
}%%ENDSECTION{"dovalues"}%

%STARTSECTION{"dot"}%<literal>%INCLUDE{"%TOPIC%" section="dotcode"}%</literal>%ENDSECTION{"dot"}%

%STARTSECTION{"crittersqueried"}%%FORMAT{
  "%URLPARAM{"Critters" multiple="on" separator=","}%"
  header="Relationships immediate to/from the following:
| *Entity* | *Summary* | *Image* |"
  format="| [[$web.$topic][$topic]] | $summary | <img src='%PUBURLPATH%/$web/$topic/$percntQUERY{'$web.$topic'/attachments[0]}$percnt'/> |"
}%%ENDSECTION{"crittersqueried"}%