Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-07-23 09:00:58

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

open comment form with shadowbox

my aim is to great guestbook with guest comments and link below which opens the comment form with shadowbox.

did this:

created an empty article. inserted this code into default template:

<txp:article_custom section="kuelalisteraamat" limit="1" form="guestbook" />

guestbook form:

<h2><txp:comments_invite textonly="1" showalways="1" showcount="1" /></h2>
<txp:comments wraptag="ul" break="li" />
<a href="http://www.meegaste.ee/lisa-kommentaar" rel="shadowbox;height=540;width=520">Add a comment</a>

created a new template called “lisa-kommentaar” where i putted the whole comment form code and nothing more and assossiated it with a new section “lisa kommentaar”.

result is that it opens the comment form with shadowbox but it’s almost empty – no input fields there only labels

here is my nonworking guestbook

i think i miss those tags:

<txp:if_comments_allowed>
<txp:comments_form isize="25" msgcols="45" msgrows="15" />
<txp:else />
</txp:if_comments_allowed>

but i can’t figure out where i should insert them…?
any ideas? or maybe there is more elegant solution?

Offline

#2 2010-07-24 08:01:26

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: open comment form with shadowbox

no ideas where i make mistake?

Offline

#3 2010-07-24 08:21:43

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: open comment form with shadowbox

I’m not sure, but shouldn’t you put this:

<txp:comments_form isize="25" msgcols="45" msgrows="15" />

on your page lisa-kommentaar, instead of the comments_form content?

If it doesn’t work, look at the tag trace of your page http://www.meegaste.ee/lisa-kommentaar.

Offline

#4 2010-07-24 09:09:46

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: open comment form with shadowbox

Els wrote:


<txp:comments_form isize=“25” msgcols=“45” msgrows=“15” />
on your page lisa-kommentaar, instead of the comments_form content?

tryed this way as well, but then it outputs totally empty page – no comments_form form content there

i’ll try tag trace

Offline

#5 2010-07-24 09:21:38

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: open comment form with shadowbox

That won’t work. The comment form should be used on individual article page, and after all the preview step will still open on individual article page.

Instead keep the comment form on the indivual article page, and make the individual article page open in your light/shadowbox. You can style the individual article page so that there is nothing else visible than the comment form.

Offline

#6 2010-07-24 10:35:18

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: open comment form with shadowbox

Els wrote:

look at tag trace of your page http://www.meegaste.ee/lisa-kommentaar.

just for information, tag trace output:

Tag error:  <txp:comments_form isize="25" msgcols="45" msgrows="15" /> ->  Textpattern Notice: Article tags cannot be used outside an article context  on line 2175
.....
Tag error:  <txp:comments_form isize="25" msgcols="45" msgrows="15" /> ->  Warning: extract() [function.extract]: First argument should be an array  on line 1684
...
Tag error:  <txp:comments_form isize="25" msgcols="45" msgrows="15" /> ->  Notice: Undefined variable: thisid  on line 1690
...

Last edited by Gallex (2010-07-24 10:39:32)

Offline

#7 2010-07-24 11:33:29

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: open comment form with shadowbox

Gocom wrote:

That won’t work. The comment form should be used on individual article page, and after all the preview step will still open on individual article page.
Instead keep the comment form on the indivual article page, and make the individual article page open in your light/shadowbox. You can style the individual article page so that there is nothing else visible than the comment form.

did so. putted all comment form into article #8
and this <txp:article_custom id="8" form="untitled" limit="1" /> into template “lisa-kommentaar” (which i made to open in shadowbox)
form untitled: <txp:body />

but where i should put this one:? because it still doesn’t display form without it

<txp:if_comments_preview>
<div id="cpreview">
<txp:comments_preview />
</div>
</txp:if_comments_preview>

<txp:if_comments_allowed>
<txp:comments_form isize="25" msgcols="45" msgrows="15" />
<txp:else />
</txp:if_comments_allowed>

Offline

#8 2010-07-24 11:48:48

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: open comment form with shadowbox

Gallex wrote:

did so. putted all comment form into article #8

You can’t call the comment form with article_custom from custom location. The comment form needs to be within individual article’s scope, meaning on the individual article page. Not in article list, nor inside the listed article’s body text. The comment form can be anywhere on the individual article page, the location on the page doesn’t matter, as long as it is in the correct context.

Offline

#9 2010-07-24 11:53:03

monkeyninja
Plugin Author
From: Sheffield, UK
Registered: 2008-10-14
Posts: 239
Website

Re: open comment form with shadowbox

Not 100% sure of this, but my understanding is that the comments form needs to be used with <txp:article /> not <txp:article_custom />. <txp:article_custom /> is not context-sensitive like <txp:article /> which would explain your first error in your tag trace. See the notes on article_custom on the Textbook website.

Also, I’m not sure if I’ve misunderstood your comments, but the comments form needs to be in the templates and not the article content (use the templates under the presentation tab, not the write tab under content). It belongs in either a page or form template.

Offline

#10 2010-07-24 13:27:41

Gallex
Member
Registered: 2006-10-08
Posts: 1,315

Re: open comment form with shadowbox

putted this (same article id as article for comments but different form): <txp:article_custom id="7" form="lisa" limit="1" /> into template “lisa-kommentaar” (which i made to open in shadowbox)

form lisa:

<txp:if_comments_preview>
<div id="cpreview">
<txp:comments_preview />
</div>
</txp:if_comments_preview>

<txp:if_comments_allowed>
<txp:comments_form isize="25" msgcols="45" msgrows="15" />
<txp:else />
</txp:if_comments_allowed>

i don’t know how correct this is, but it’s working now. thank’s for your patience and help

Last edited by Gallex (2010-07-24 13:43:01)

Offline

Board footer

Powered by FluxBB