[pmwiki-users] Divisions, IDs and Styles

Patrick R. Michaud pmichaud at pobox.com
Thu Aug 10 15:17:21 CDT 2006


On Thu, Aug 10, 2006 at 08:59:29PM +0100, Hans wrote:
> I will try to answer some points myself here, but still would like
> your comments,
> especially about point 2.
> 
> On 10/08/06, Hans <hans.bracker at googlemail.com> wrote:
> > 1. Do the new (:div1:)  (:div1end:) etc directives also apply to
> > >>div1<< >>div1end<< or not?
> 
> It seems not ot apply to >>div<< type divisions.
> 
> > 2. As div1 div2 etc gets used as a div identifier internally for
> > pmwiki, can it please be extended to be used as the div's id, if no id
> > is provided?
> > So (:div3:) is the same as (:div3 id=div3:), but (:div3 id=somediv:)
> > has id=somediv, not div3.

>   } else {
>       if (!strstr($attr, "id=")) $out .= "<div id='$name' $attr>";
>       else $out .= "<div $attr>";
>     $cf[$key] = '</div>';
>   }
>   return $out;
> }
> 
> Anyone who supports such a change to make ids easier in (:div:) markup?

This produces invalid HTML.  Consider the markup:

    (:div1:)
    Here's my top-level division.
    (:div1:)
    Here's another top-level division
    (:div1end:)

which produces two <div id='div1'> tags, which won't validate,
since id= attributes have to be unique within any given HTML document.

> > 3. Can I mix freely (:div1:) and >>div<< type divisions?
> 
> I guess not with nested divs.

Sure you can:

    (:div1:) %bgcolor=yellow div%
    Black text on a yellow background.
    >>blue<<
    Nested div with blue text on a yellow background.
    >>red<<
    Nested div with red text on a yellow background.
    (:div1:) %bgcolor=green div%
    Black text on a green background.
    >>blue<<
    Nested div with blue text on a green background.

Pm




More information about the pmwiki-users mailing list