[personal profile] kaigou posting in [community profile] style_system
I'm trying to get an entry's management & interaction links to repeat at the end of a post. In the S2 code, those show up at the start of the style & then I've duplicated them to repeat as the footer of the post.


function Page::print_entry (Entry e)
{
   $e->print_wrapper_start();


        print "<div class=\"header\">";
$e->print_subject();
        println "<div class=\"datetime-container\">";
$e->print_metatypes();
        $e->print_time("long_day", "");
        println "</div>";
        println "</div>";

        
        println "<div class=\"metabar\">";
            println "<div class=\"inner\">";        
    $e->print_tags();
    $e->print_management_links();
    if ($this isa EntryPage) {
        """<hr class="above-entry-interaction-links" />""";
        $e->print_interaction_links("topcomment");
    }
    else {
        $e->print_interaction_links();
    }
        println "</div>";
        println "</div>";  
        println "<div class=\"userpic-set\">";
            println "<div class=\"inner\">";            
            $e->print_userpic();
            $e->print_poster();             
        println "</div>";
        println "</div>";  
        println "<div class=\"contents\">";
            println "<div class=\"inner\">";        

                $e->print_text();
           println "</div>";  
               println "<div class=\"footer\">";
                  println "<div class=\"inner\">";  
        $e->print_interaction_links();
                        $e->print_management_links();
                  println "</div>";
               println "</div>";
  $e->print_metadata();
        println "</div>";
            
$e->print_wrapper_end();
        println "<div class=\"reply-box\">";
            println "<div class=\"inner\">";  
     $this->print_reply_container({ "target" => "topcomment" });
        println "</div>";
        println "</div>";    
}



But nothing's showing up in the footer. What am I missing? Any ideas are greatly appreciated, because I'm stumped.

Date: 2009-11-15 07:16 pm (UTC)
ninetydegrees: Art: self-portrait (Default)
From: [personal profile] ninetydegrees
I'm not sure what you're trying to achieve here since, in the Core, these links are printed in the footer already:
    """<div class="footer">\n""";
    """<div class="inner">\n""";
    $e->print_tags();
    $e->print_management_links();
    if ($this isa EntryPage) {
        """<hr class="above-entry-interaction-links" />""";
        $e->print_interaction_links("topcomment");
        $this->print_reply_container({ "target" => "topcomment" });
        """<hr class="below-reply-container" />""";
    }
    else {
        $e->print_interaction_links();
    }
    "</div>\n</div>\n";
    $e->print_wrapper_end();

}

Also, would you post your whole print_entry function or make your layer viewable? I tried to see if these could be repeated - in header and footer - and it worked fine for me.

Date: 2009-11-15 08:23 pm (UTC)
ninetydegrees: Art: self-portrait (Default)
From: [personal profile] ninetydegrees
Your code works for me with a plain layout: http://900degrees.dreamwidth.org/?s2id=97423

Could it be your CSS giving you trouble actually?

Date: 2009-11-15 08:17 pm (UTC)
av8rmike: Neo from Matrix, text: I know S2 (I know s2)
From: [personal profile] av8rmike
The Page::print_entry() function in your theme layer is not the code that you've posted, and is overriding the function that's in your layout layer.

Date: 2009-11-15 08:29 pm (UTC)
av8rmike: Neo from Matrix, text: I know S2 (I know s2)
From: [personal profile] av8rmike
You have a layout layer and a theme layer that both have a print_entry() function. The theme layer's one is overriding, and it doesn't contain the code that you've posted. So, either delete the version in your theme layer or remove the one from your layout layer and edit the theme layer to add the extra link bars (you probably want the former).

Profile

Dreamwidth style system discussion

July 2025

S M T W T F S
  123 45
6789101112
13141516171819
20212223242526
2728293031  

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 27th, 2025 02:19 pm
Powered by Dreamwidth Studios