Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-08-07 15:19:45

chinesedream
Member
Registered: 2006-09-05
Posts: 22

turn off default <div> for comment when OL is off

Hi, I am using the sed_comment_pack for comment area and had turned off the “preset comments as a numbered list?”. But TXP outputs my code with a <div> wrap. How can I disable this?

Here is my comments tag

<div class=”<txp:sed_get_comment_class author_class=‘author’
/>”>

<h6><txp:comment_permlink><span><txp:sed_comment_number /></span><txp:sed_if_author_comment_string string=’ (Author Comment)’ />
<txp:comment_name />on<span class=“date”><txp:comment_time /></span></txp:comment_permlink>
</h6>

<txp:message />
</div><!— end /sed_get_comment—>

And where the html result, the first ‘div’ and the closing tag sholdn’t be there.

<div><!— extra div generated by TXP—>
<div class=“comment odd commentator-”>

<h6><a href=“http://www.site.com/article/2/first+post#c000005” id=“c000005”><span>1</span>
<a href=“http://xxx.com” rel=“nofollow”>guest</a>on<span class=“date”>07/29/2007 08:50 PM</span></a>
</h6>

<p>comment here</p>

</div><!— end /sed_get_comment—>
</div>

thanks!
tgp

Offline

#2 2007-08-08 03:18:40

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

Re: turn off default <div> for comment when OL is off

Well what is problem there? Because it’s <div>-element, it has no efect to the content, or to the layout. Don’t be worried about it, because it does not efect anything stylin issue or another. But those outputted classes, like comment odd commentator- are wierd and wrongly done, it contains three different classes (“comment” – “odd” – “commentator”).

But if you certainly want these extra <div> out there, edit your taghandlers.php, located in /textpattern/publish/.

Do these steps:

1. Find function comments
2. Find line 1532, which contains 'break' => ($comments_are_ol ? 'li' : 'div'),
3. Edit it to this: 'break' => ($comments_are_ol ? 'li' : ''),

Cheers!

Offline

#3 2007-08-08 15:04:51

chinesedream
Member
Registered: 2006-09-05
Posts: 22

Re: turn off default <div> for comment when OL is off

Hi Jukka, thanks for the help!! That does the trick. The empty div bugs me as I like to make site with clean uncluttered markups, I see that Textpatter is too helpful adding classes, which actually take away some control from web designer who is verses with x(html)/css but not much the PHP. I can get a clean result with and full control with my markup with the CMS like Etomite and Modx.

the “comment odd commentator” is correct output with the sed_comment_pack plugin. Weird thing is, in my page, it added a ‘-’ after the lass class name.

tgp

Offline

#4 2007-08-09 02:49:04

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: turn off default <div> for comment when OL is off

Do not edit the files, you don’t need to. Just look for the “comments” tag and add to it: break="".

Last edited by Mary (2007-08-11 00:49:55)

Offline

#5 2007-08-09 09:00:29

chinesedream
Member
Registered: 2006-09-05
Posts: 22

Re: turn off default <div> for comment when OL is off

Hi Mary, sorry I do not quite follow your instruction.

I put the ‘div’ back to line 1532 in the taghandlers.php, and added break below, immediately the extra ‘div’ tag comes back.

<div class=”<txp:sed_get_comment_class author_class=‘author’ break=”“/>”>

thanks!
tgp

Offline

#6 2007-08-09 14:48:34

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: turn off default <div> for comment when OL is off

Find the form that contains <txp:comments /> and replace that with <txp:comments break="" />. Check the comments_display form.

Offline

#7 2007-08-12 03:44:49

chinesedream
Member
Registered: 2006-09-05
Posts: 22

Re: turn off default <div> for comment when OL is off

Thanks!!!

Offline

#8 2007-09-02 10:35:58

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: turn off default <div> for comment when OL is off

I just ran into this small problem too, and luckily found this thread. The RPC help file is a little misleading on this issue – it says:

“If you set this option to ‘no’, you must edit presentation -> forms -> comments, wrapping the entire comment template in a block tag, such as <div>.”

But if one turns off comments as a numbered list, then the div tag is added.

Perhaps its a good idea to add something to this effect in the RPC help text?

Offline

#9 2007-11-02 00:49:50

mlarino2
Member
Registered: 2007-07-12
Posts: 30

Re: turn off default <div> for comment when OL is off

ok, I am kind of lost here…
I am trying to find the “Present comments as a numbered list” in preferences but is not there… :(
the only 2 options I hsve there are:
Require user’s name? yes/no
Require user’s e-mail address? yes/no

and that´s it…
Is there any problem with my preferences?

Offline

#10 2007-11-02 07:08:41

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,091
Website GitHub Mastodon Twitter

Re: turn off default <div> for comment when OL is off

@mlarino2

You are looking at the ‘Advanced preferences’ not the the ‘basic’ ones which is where the “Present comments as a numbered list” option appears.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB