meta data

Feb 11, 2006 17:06

Hey all, I'd like some help changing the order of the meta data on my posts so that they go like this:

mood
music
tags

And, while we're messing around in the meta, could you tell me how to switch stuff around so that the mood line has the mood icon first and then the mood text with an actual space between the two, since right now they're all ( Read more... )

Leave a comment

Comments 9

masterslacker February 12 2006, 02:10:51 UTC
Add this function to your theme layer. It will override the default implementation. I've changed it to print tags last, and to add a space between the mood and mood icon.

Mike.

function Entry::print_metadata() {
if (($.metadata{"mood"}!="" or $.metadata{"music"}!="" or ((size $.tags>0)and($*layout_position_entrytags=="metadata"))) and ($.itemid!=int($*layout_guestbook_entryid))) {
"""
    """;
    if ($.metadata{"mood"}!="") { """
  • $*text_meta_mood:"""; print $.metadata{"mood"}+" "+$.mood_icon; """
  • """; }
    if ($.metadata{"music"}!="") { """
  • $*text_meta_music:"""; print $.metadata{"music"}; """
  • """; }
    if ((size $.tags>0)and($*layout_position_entrytags=="metadata")) {
    """
  • $*text_meta_tags:
    $.tags[0].name""";
    foreach var int i (1 .. (size $.tags - 1)) {
    """, $.tags[$i].name""";
    }
    """
  • """;
    }
    """
""";
}
}

Reply

runpunkrun February 12 2006, 02:27:34 UTC
Oh, that's fantastic! Thank you. Though, is it possible to swap the placement of the mood icon and the mood text so that the icon comes first?

Like so:

Mood: [happy.jpg] happy

Reply

kunzite1 February 12 2006, 03:03:44 UTC
here's how i'd do it:
function Entry::print_metadata() {
var string tags_header = $*text_meta_tags;
var string tags_joiner = ":";
var Link edit_tags = $this->get_link("edit_tags");
var string text = "";
var string val = "";
if ((size $.metadata > 0) or ($*tags_aware and (size $.tags > 0))){
var string currents = "";
foreach var string k ($.metadata){
$val = $.metadata{$k};
if ($k == "mood"){
$text = $*text_meta_mood;
}
elseif ($k == "music") {
$text = $*text_meta_music;
}
if ($k == "mood" and defined $.mood_icon){
var Image i = $.mood_icon;
$val = "
... )

Reply

runpunkrun February 12 2006, 03:24:22 UTC
I like everything about that! Especially how the mood icons are middle aligned now, very nice. But I do want colons in my mood and music lines, and I've tried putting them everywhere that seems likely (like to the end of $*text_meta_mood), but I'm only getting errors so obviously I've got the wrong idea. Where exactly do I add the colons?

Reply


Leave a comment

Up