[pmwiki-users] Nested divs needed for blog styling...

Patrick R. Michaud pmichaud at pobox.com
Sun Dec 11 20:18:10 CST 2005


On Sun, Dec 11, 2005 at 11:33:27PM +0100, Mikael Nilsson wrote:
> For the KindOfBlog recipe, I wanted to put a box around each blog post
> in the digest.
> 
> I managed to add the right directive in the inner loop of the digest
> algorithm in kob.php (line ~482):
> 
>         $digest  .= "\n(:div class='blogitem':)\n";
>         $digest  .= $stuffing;  // The actual post.
>         $digest  .= "\n(:divend:)\n";
> 
> However, every blog post contains divs in itself, so if I
> make .blogitem, say, green, only the title becomes green because the div
> is "prematurely" closed. I know this is by design of the (:div:)
> directive, but is there a sane way around it?

Perhaps don't use the div markup for the box -- just use a normal 
HTML <div> tag:

         $digest  .= "\n<div class='blogitem'>\n";
         $digest  .= $stuffing;  // The actual post.
         $digest  .= "\n</div>\n";

There is a possibility that someone will write (:div:) markup
in a post that will prevent the <div>'s from closing properly,
but supporting nested (:div:)'s wouldn't solve that problem
anyway.  

Pm





More information about the pmwiki-users mailing list