[pmwiki-users] Commentbox + Toggle Div: the saga continues!

Hans design5 at softflow.co.uk
Sat Jun 2 02:06:00 CDT 2007


Saturday, June 2, 2007, 12:15:09 AM, isherr at fes.uwaterloo.ca wrote:

> In a nutshell, i have a commentbox form placed in a toggle div section
> in a group footer. the toggle div is created by the show/hide script.

Note: showhide does not create any divs. You create the div with some
div markup, give it an id=somedivname, which you use in the showhide
markup, so the script can act on the div thus named.

> what i would like to do is have the commentbox form AND all the  
> comments automatically placed inside this toggled div after they are
> created.

This markup code can do that:

(:showhide init=hide div=commentdiv lshow='Add Comment' lhide='Close':)
(:div1 id=commentdiv:)
(:commentbox:)

[[#comments]]

(:div1end:)


and set in a local config file:

$MPAnchorFmt = "[[#comments]]";

This will place comments above the anchor [[#coments]], the latest
comment appears first or top. all will be inside the (:div1
id=commentdiv:). Note the use of div1 and div1end, which allows
nesting of other divs inside it. We need the nesting capability as
comments are posted inside their own divs.

> instead, the comments are posted outside the group footer entirely.

> the code for my group footer is this:

> (:toggle div=labelwhore-comments init=hide lshow='show comments'  
> lhide='hide comments':)
>>> id=labelwhore-comments border='1px solid #33ffcc' padding=5px  
>>> bgcolor=#333333<<
> (:commentbox LabelWhore.GroupFooter:)
> [[#comments]]
>>> <<

> i have enabled posting comments to other pages, as suggested by a user.
> i'm wondering if there is something i am missing in my config file?
> perhaps some things aren't playing nicely together?

If I understand you correctly you want the comments posted in the
GroupFooter page, not on other pages, nor on the page which contains
the GroupFooter. Using the anchor as I written above should make this
possible. A simple (:commentbox:) markup is sufficient as well, as you
are not posting to another page. Enabling posting to other pages is
not needed, and you may turn this off for security reasons.
Note that your commentbox AND comments will be visible on
all pages in the group, even though they are initially hidden with
the showhide toggle switch.

Hope this helps! I answered your question yesterday on the
Cookbook.CommentBoxPlus-Comments page, but you must have missed it.

  ~Hans




More information about the pmwiki-users mailing list