Mr Seb (azureskies) wrote in component_help,
Mr Seb

Trying to get Page Summary into a scrollbox

Hi there,

I'm having trouble with getting my Page Summary into a scrollbox (because I'd like it to be a handy little component rather than a monstrous big one that takes up most of my page due to my showing 30 friends entries and 20 recent ones). I took the following code and added in the DIV for a scrollbox (which I've bolded) in what I presume to be the right place :

# Change the way RecentPage and FriendsPage summaries print. (FriendsPage inherits from RecentPage)

function RecentPage::lay_print_summary() {

   # print the header of the component and determine the size of the entries array

   print_comp_header("<center>Page Contents</center>");

   var int size = size $.entries - 1;

   if ($size<0) { return; }

   # loop on the entries

   foreach var int pos (0..$size) {

      # Get the Entry and start the summary line

      var Entry e = $.entries[$pos];

      var string subject = ($e.subject!=""?$e->plain_subject():"<i>(no subject)</i>");

      """<div id="Layer1" style="position:relative; width:100%; height:250px; z-index:1; overflow: auto; overflow-x: hidden;">""";

      # On the Friends page print: <poster_name> : <journal_name> : <security_icon> <subject> [+<comment_count>]

      if ($.view=="friends") {

         """$e.poster """;

         if ($e.journal.username!=$e.poster.username) { """: $e.journal : """; }

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

         """<a href="#$e.journal.username$e.itemid">$subject</a>""";

         if ($e.comments.count>0) { """ <a href="$e.comments.read_url">[+$e.comments.count]</a>"""; }

      # On the Recent page print: <date> <time> : <security_icon> <subject> [+<comment_count>]

      }else{ # recent page

         print $e.time->date_format()+" "+$e.time->time_format()+" : ";

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

         """<a href="#item$e.itemid">$subject</a>""";

         if ($e.comments.count>0) { """ <a href="$e.comments.read_url">[+$e.comments.count]</a>"""; }

      # Close if..else loop and end the summary line



      # If it's not the last summary line, print a seperator bar

      if ($size!=$pos) {


        <div class="medLine"><img src="" width="1" height="1" alt="" border="0" /></div>

        <div class="ltLine"><img src="" width="1" height="1" alt="" border="0" /></div>



   # End the loop for entries


   # Print the component footer when done.



However, instead of creating the scrollbox, I get the following effect :

Anyone know how I can get me a scrolling summary? Or is it not possible?

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened