C (virtualcourtney) wrote in component_help,
C
virtualcourtney
component_help

tag woe

Hi there. I'm what you might call a tinkerer and a lurker.

Well...my tinkering abilities have fallen short. I'm having a problem printing my tags.
(My layer is here: http://www.livejournal.com/customize/advanced/layersource.bml?id=649128&fmt=html )

What's happening is that if I have specify a mood or music, the tags do print where they're supposed to (in a little box). When I don't, the tags fail to appear. I've done the basic checks, like making sure I've actually tagged the entries. It wouldn't be the first time I've made that kind of mistake... ;) Thank goodness for the bright, shining, brilliant brains collected here. All fixed. :)

The particular block of code I'm talking about is this:


if ($e.metadata{"mood"}!="")

   {

      """<div><span style="font-weight:bold">$*text_meta_mood: </span>""";

      if (defined $e.mood_icon) { """$e.mood_icon """; }

      print $e.metadata{"mood"};

      """</div>""";

   }

   else

   {

   """ """;

   }



   if ($e.metadata{"music"}!="")

   {

      """<div><span style="font-weight:bold">$*text_meta_music: </span>""";

      print $e.metadata{"music"};

      """</div>""";

   }

   else

   {

   """ """;

   }



   if ($e.tags)

   {

      var int tcount = 0;

      """<b>tags : </b> """;

      foreach var Tag t ($e.tags)

      {

         """<a rel="tag" href="$t.url">$t.name</a>""";

         $tcount++;

         if ($tcount != size $e.tags) { """, """; }

      }

   }


You can see the code in its larger context in my layer, of course. But I figured with the sheer amount of brain power consolidated here, someone might pick up on something within this particular block that I'm just too dense to see. :)

Gurus: please don't laugh at some of the uglier hacks in various other unrelated chunks of code. I really am trying to make it prettier, I promise!
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 3 comments