a real nobody. (mangle) wrote in component_help,
a real nobody.
mangle
component_help

tags not showing up on entries

Is there a specific code that needs to be entered besides the print_metadata one in order to have tags show up in my entries? I have the following in my user layer:



function Entry::print_metadata() {
  var string   tags_header          = "Current Tags"; # text header for tags in metadata
  var string   tags_joiner          = ":";            # text to come after tags header
  var string   tags_seperator       = ", ";           # text for seperating tags in tag list

  # get Entry handle
  var Entry e = $this;

  var string metadata = "";

  # can remote user edit tags?
  var Link edit_tags = $e->get_link("edit_tags");

  # if we have metadata or tags
  if ((size $e.metadata > 0) or ((size $e.tags > 0) and ($*tags_aware))){

    # if we have a mood icon, open table and print icon
    if (defined $.mood_icon) {
      var Image i = $.mood_icon;
      $metadata   = $metadata + """<table border="0"><tr><td><img src="$i.url" width="$i.width" height="$i.height" alt="$.metadata{"mood"}" title="$.metadata{"mood"}" /></td><td>""";
    }

    # if we have metadata, print metadata
    foreach var string k ($e.metadata){
      var string text = $k;
      var string val  = $e.metadata{$k};
      if ($k == "mood"){
        $text = $*text_meta_mood;
      } 
      elseif ($k == "music") {
        $text = $*text_meta_music;
      }
      $metadata = $metadata + """<strong>$text</strong> $val<br />""";
    }

    # if we have tags, print tags
    if ((size $e.tags > 0) and $*tags_aware) {
      var int    tcount               = 0;

      # if remote user can edit tags, let's give them a link
      if($edit_tags.url != "") {
        $tags_header = """<a href="$edit_tags.url">$tags_header</a>""";
      }
      $metadata = $metadata + """<strong>$tags_header$tags_joiner</strong> """;
      foreach var Tag t ($e.tags) {
        $metadata = $metadata + """<a rel="tag" href="$t.url">$t.name</a>""";
        $tcount++;
        if ($tcount != size $e.tags) { $metadata = $metadata + $tags_seperator; }
      }
    }
    # if we have a mood icon, we need to close the table
    if (defined $.mood_icon) {
      $metadata = $metadata + """</td></tr></table>""";
    }
  }
  print $metadata;
}
</tr></td>

I would post my style ID number, but it is of no importance because I can't make my layers visible. When I enter layerinfo "source_viewable" = 1; into my layers, I get an error message.

I would really appreciate any help. Thanks.
Subscribe

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 18 comments