Aug. 30th, 2007

[info]carriep63

[paid] Moving mood icon to the left

Using the following code in a theme layer will float your mood icon over to the left of the mood and music (see example). If you do not want a mood icon at all, remove everything in red.

function Entry::print_metadata() {
    if (size $.metadata) {
        """<div class="metadata">\n""";

        if(($.mood_icon)) {
            """<div style="float:left; padding-right:10px;">""";
             print "$.mood_icon";
            "</div>";
        }

        foreach var string m ($.metadata) {
            "<div><strong>"; print lang_metadata_title($m); "</strong>: ";
            print $.metadata{$m}; "</div>\n";
        }
        "</div>\n";
    }
}

[info]carriep63

[paid] Changing "Mood / music / location" labels.

An interesting oversight (?) in the layer prevents you from using the "normal" method to change the mood/music/location labels in Bloggish. [info]kunzite1 posted the solution in [info]s2bloggish. I am reposting it here before it gets buried.


-------------------------------------------

Use this code in your layer. Replace the words in green with your own.

set text_meta_mood = "Schmood";
set text_meta_music = "Schmusic";
set text_meta_location = "Schmocal";

function Entry::print_metadata() {
    if (size $.metadata) {
        """<div class="metadata">\n""";
        foreach var string m ($.metadata) {
            "<div><strong>"; print lang_metadata_title($m); "</strong>: ";
            if ($m == "mood") {
                " $.mood_icon ";
            }
            print $.metadata{$m}; "</div>\n";
        }
        "</div>\n";
    }
}

[info]carriep63

[paid] Changing "mood", "music" and "location" to images.

This is in response to a post in another community. You can change your mood, music and location words into images if you want to.



In the example pic, I've also moved the mood icon over to the left. That is reflected in the code as well.

function Entry::print_metadata() {
    if (size $.metadata) {
        """<div class="metadata">""";
                            
####### mood icon here.  delete if you don't want this.######

"""<div style="float:left; padding-right:10px;">""";
if(($.mood_icon)) {
print "$.mood_icon";
                }
"</div>";

#############################################################


        foreach var string m ($.metadata) {
            var string val  = $.metadata{$m};
            var string moodimg = "<img src='http://pics.livejournal.com/carriep63/pic/0009f257'>";
            var string musicimg = "<img src='http://pics.livejournal.com/carriep63/pic/0009gxyz'>";
            var string locimg = "<img src='http://pics.livejournal.com/carriep63/pic/0009e5dd'>";

    if ($m == "mood") {
             print """<div>${moodimg} $val</div>""";
            }

    if ($m == "music") {
             print """<div>${musicimg} $val</div>""";
            }

    if ($m == "location") {
             print """<div>${locimg} $val</div>""";
            }

        }
            """<div style="clear:both;"></div></div>""";
    }

}