Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-02-04 03:36:44

placenamehere
Plugin Author
Registered: 2004-11-21
Posts: 88
Website

reference to form comments_display hardcoded with no override

In an attempt to create a theme that could be dropped in without the need for changing any of the default/existing page tempaltes or forms I hit a bit of a snag — there currently is no way to override the form used to dsplay the comments block.

In 4.0.3 the value for the form use is currently hard coded inside of publish.php, at line 720 inside the doArticle function.

Instead, like most other forms it should be a parameter that could be fed, along with a default value — something like a commentdisplayform=”“ on the article tag

Unless I’m missing some reason for this not to have been done already it seems like a bug/oversight and a quick fix.

All other forms i’ve looked at so far (comments, comment_form, default, Links, files) can have alternatives specified from the txp tag that calls it.


Site: placenamehere.com
Microformat Plugin: pnh_mf

Offline

#2 2006-02-14 00:38:59

zem
Developer emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579
Website

Re: reference to form comments_display hardcoded with no override

It’s only hard coded if you use the “auto append comments” setting, which is a back-compatibility feature. See the FAQ.


Alex
tstate

Offline

#3 2006-02-14 01:39:13

placenamehere
Plugin Author
Registered: 2004-11-21
Posts: 88
Website

Re: reference to form comments_display hardcoded with no override

thanks. I’ll have to look at that entry and see if it gets me closer to nirvana


Site: placenamehere.com
Microformat Plugin: pnh_mf

Offline

#4 2006-02-14 16:31:08

placenamehere
Plugin Author
Registered: 2004-11-21
Posts: 88
Website

Re: reference to form comments_display hardcoded with no override

Maybe its early and I haven’t had enough coffee but I seem to be missing something here…

I don’t want to bypass the comments_display form and the logic that only calls that code at the right times.

I want to change the form used when the app calls it, not change when the app calls it.

If I turn the auto append off and move the calls to txp:comments, txp:comments_form into the article form then I get stuff on the home page and elsewhere where I don’t want it. And I don’t see a direct if_whatever tag to mimic the auto append functionality… it is simply a matter of coming up with a combination of <code><else /></code> cases that only print this stuff when you’re in the right place or am I missing something more fundamental?


Site: placenamehere.com
Microformat Plugin: pnh_mf

Offline

#5 2006-02-14 16:34:45

placenamehere
Plugin Author
Registered: 2004-11-21
Posts: 88
Website

Re: reference to form comments_display hardcoded with no override

of note.. .my form looks something like the following, so there is a wrapper of markup beyond just the if_comments statements and the logic behind txp:comments

<code>
<div class=“comments”>
<h2>Comments</h2>
<div>
<txp:comments />
<txp:if_comments_allowed>
<txp:comments_form />
<txp:else />
<p><txp:text item=“comments_closed” /></p>
</txp:if_comments_allowed>
</div>
</div> <!— /comments —>
</code>


Site: placenamehere.com
Microformat Plugin: pnh_mf

Offline

#6 2006-02-14 16:40:47

maniqui
Moderator
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: reference to form comments_display hardcoded with no override

> placenamehere wrote:

And I don’t see a direct if_whatever tag to mimic the auto append functionality… it is simply a matter of coming up with a combination of <code><else /></code> cases that only print this stuff when you’re in the right place or am I missing something more fundamental?

Hi placenamehere,

I’m not totally sure if I understand… but some simple use of if_article_list or if_individual_article should mimic the autoappend functionality.

something like:

txp:if_individual_article
…all your comment snippet here…
txp:else
…your comment invite here…
/txp:if_individual_article

or

txp:if_article_list
…your comment invite here…
txp:else
…all your comment snippet here…
/txp:if_article_list

Because, you are always in an article_list context or in an individual_article context.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#7 2006-02-14 16:55:39

placenamehere
Plugin Author
Registered: 2004-11-21
Posts: 88
Website

Re: reference to form comments_display hardcoded with no override

yeah.. maybe i’m overthinking things and overlooked that tag… was looking for something in the specific context of the article form/comments appending scenario

but I think i have it sorted now, thx

Last edited by placenamehere (2006-02-14 16:56:35)


Site: placenamehere.com
Microformat Plugin: pnh_mf

Offline

#8 2006-02-14 17:00:42

placenamehere
Plugin Author
Registered: 2004-11-21
Posts: 88
Website

Re: reference to form comments_display hardcoded with no override

yup.. moving my old wrapping my old comments_display form to the end of my article form and wrapping it in a txp:if_individual_article block was what i needed…

now to tackle the search_results form

Last edited by placenamehere (2006-02-14 17:01:25)


Site: placenamehere.com
Microformat Plugin: pnh_mf

Offline

Board footer

Powered by FluxBB