Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-03 20:19:07

Nathan Smith
Member
Registered: 2005-01-14
Posts: 66
Website

Textile + Comments Plugin Request

If you’re like me, you learned to work with the comments in their pre 4.0.2 days, with the funky BR BR syntax to simulate paragraphs, etc.

There were those who wanted more control over styling, as well as allowing their commenters to quote each other with Blockquote. That makes sense, this seems like a nice thing to do. Plus, P is more semantically correct than double BR anyways.

However, I feel we may have opened a flood-gate here, allowing commenters full, unrestricted access to Textile. For instance, it is now possible to insert H1, H2, … H7, and even tables within a comment. Example…

http://www.jaredigital.com/article/130/textpattern-clean-rss-feeds-feed-updates#c000509

I still use the old-school OL.Comments to style everything, so for a code purist, having a P (or any other block level element) within an LI just seems a bit off-kilter. I, for one, would prefer to have the lighter version of Textile restored in comments.

I don’t see this as being too difficult to do, for people who are familiar with writing Textpattern plugins (I’m not). So, Rob, Zem, if you guys are reading this, I plead you Princess Lea style – “Help me, you’re our only hope.” Heck, you could even be cruel and dangle the carrot in front of us, making us ransom it. I just wish someone would write a plugin that restores old functionality back to comments the way they were (or explain to me how to hack the PHP myself).

Thanks, that’s all I wanted to say, go back to your drinks.

Last edited by Nathan Smith (2005-11-03 20:25:00)


Are we all figments of God’s imagination?

Offline

#2 2005-11-03 20:28:46

SHARK
New Member
Registered: 2005-06-16
Posts: 2

Re: Textile + Comments Plugin Request

Hi, I was experiencing the same problem. This is my solution:

Change this line (textpattern/lib/txplib_misc.php) in the markup_comment function:

$msg = trim($textile->blockLite($textile->TextileThis(strip_tags(deEntBrackets( $msg ))),1,’‘,$im,’‘,(@$comment_nofollow ? ‘nofollow’ : ‘’)));

Replace it with this (copied from 4.0.1)

$msg = trim(nl2br($textile->TextileThis(strip_tags(deEntBrackets( $msg )),1,’‘,$im,’‘,(@$comment_nofollow ? ‘nofollow’ : ‘’))));

Offline

#3 2005-11-03 20:33:13

Nathan Smith
Member
Registered: 2005-01-14
Posts: 66
Website

Re: Textile + Comments Plugin Request

Shark, that’s awesome, thanks. It worked great. Thanks for sharing that info so quickly, I would’ve paid to hear it. :)

Note to others: Make sure you change the curly quotes to straight, or it won’t work. By the way, it’s on line 1194 (turn word-wrapping off).

Last edited by Nathan Smith (2005-11-03 20:47:22)


Are we all figments of God’s imagination?

Offline

#4 2005-11-03 20:48:08

axle_foley00
Member
From: Jamaica
Registered: 2004-07-29
Posts: 42
Website

Re: Textile + Comments Plugin Request

Thanks Shark, this will come in handy. Thanks for pointing this out Nathan and Jared, I never knew this happened with the update.

Offline

#5 2005-11-03 20:54:39

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

Re: Textile + Comments Plugin Request

<blockquote>so for a code purist, having a P (or any other block level element) within an LI just seems a bit off-kilter</blockquote>

I dont see any code impurity when using <code><p></code> (or any other block level element) within a <code><li></code>.
From the point of view of validation, it’s valid code.
Or am I wrong again?

Last edited by maniqui (2005-11-03 20:55:23)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2005-11-03 21:04:36

ramanan
Plugin Author
From: Toronto
Registered: 2004-03-12
Posts: 323
Website

Re: Textile + Comments Plugin Request

Anyone know how to go back and retroactively update the older comments so they are wrapped in paragraph tags? That would be the bestest.

Offline

#7 2005-11-03 21:15:42

Nathan Smith
Member
Registered: 2005-01-14
Posts: 66
Website

Re: Textile + Comments Plugin Request

Maniqui: I should have said semantics, sorry.

Ramanan: I’m not sure how to do that, but if anyone wants to just download a replacement file rather than hack their PHP, go here…

http://sonspring.com/journal/textile-comments-fix

Last edited by Nathan Smith (2005-11-03 21:16:30)


Are we all figments of God’s imagination?

Offline

#8 2005-11-03 21:20:29

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Textile + Comments Plugin Request

Ohmy, hacks, replacement files… I know you guys can do better than this. So you really want to keep messing with your files with each update? It’s easier to install and easier to update if the necessary functionality would be provided by a plugin…

Offline

#9 2005-11-03 21:35:39

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

Re: Textile + Comments Plugin Request

<blockquote>Maniqui: I should have said semantics, sorry.</blockquote>

@Nathan, can you explain me why do you think it is impure to use P, or H1 tags inside LIs from a semantic point of view? I dont want to initiate a full bizantine debate around this.

How do you want comments to be coded in your site?
Like this.. ? :

<code> <li>….content…. <br /><br /> …. content… ….<a href=”“>a link</a>… <br /><br />…more content…</li> </code>

I ask because I want to know. I’m a bit new to the use of comments and I would like to know some good practices about how to output comments.
Thanks!


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#10 2005-11-03 22:51:13

jaredigital
Member
From: Texas
Registered: 2004-10-26
Posts: 26
Website

Re: Textile + Comments Plugin Request

I think, technically, no other tags are supposed to be nested inside an <li> tag (http://www.cs.tut.fi/~jkorpela/html/nesting.html). Realistically, I think lists have a lot of leeway validation-wise because they are able to be used for such varied purposes — such as presenting comments in Textpattern, for example.

Offline

#11 2005-11-03 23:47:52

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

Re: Textile + Comments Plugin Request

<blockquote>I think, technically, no other tags are supposed to be nested inside an <li> tag (http://www.cs.tut.fi/~jkorpela/html/nesting.html).</blockquote>

@jaredigital, I have follow the link, and for LI (as child of UL or OL), it says flow. As far as I interpret the content of that page, when it says flow, it means that it can contain any element from the flow list, so block elements are allowed.
And, technically, lot of tags are supposed to be nested inside a LI. First: inline tags, like A, STRONG, EM, etc.
And also, block level tags, like UL/OL for nested list, etc.

A common example: nested lists: UL/OL inside a LI are allowed for creating nested list.

And if not, how would you semantically explain what kind of content is in a comment?
I mean, for those who dont want any block element inside LI, sure you have comments like this:

<code><li>hi, this is my comment and blabla
<br />
<br />
this is another paragraph of my comment, nice site! check <a href=”“>this link</a>
<br />
<br />
this is the third paragraph, and your article is <del>bullshit</del><ins>great</ins>
</li>
</code>

There, you are using <code><br /></code> to mark up paragraph.

But, dont you the the following comment is more semantically valid and also cleanest?

<code><li>
<p>hi, this is my comment and blabla</p>
<p>this is another paragraph of my comment, nice site! check <a href=”“>this link</a></p>
<p>this is the third paragraph, and your article is <del>bullshit</del><ins>great</ins></p>
</li>
</code>

Here, paragraphs inside comment are marked-up with semantically correct P tags.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#12 2005-11-04 00:42:17

Nathan Smith
Member
Registered: 2005-01-14
Posts: 66
Website

Re: Textile + Comments Plugin Request

maniqui: You’re right, things can be nested in LI. My main issue I suppose is that H1, H2, things like this, I’ve styled very specifically already, and I would like them not to show up in my comments. I agree that <br /> <br /> is ugly. If it were only P tags that were allowed, or Blockquote, things of that nature, I wouldn’t mind so much. As it is though, since I’ve got a couple hundred comments already with <br />, I’d just assume keep it that way, for ease of re-design in the future.

Last edited by Nathan Smith (2005-11-04 00:42:45)


Are we all figments of God’s imagination?

Offline

Board footer

Powered by FluxBB