Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-18 01:10:35

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

Setup: surround form contents with (X)HTML comments

Another, “before I forget”:

At the beginning of each form:

<!-- Start form_name (form_type) -->

and at the end of each form:

<!-- End form_name (form_type) -->

Not only would this be helpful for beginners (“how do I change…?”), but even for advanced users that have long-forgotten what’s in each form (stop having to trace through your page to find the form in question).

I was thinking this could be a preference you could turn off and on (on by default). In most cases it should be easy to implement, since we use a function to automate fetching forms in most instances. Even plugins could make use of it because of that.

If not a preference, then at least manually add them to the defaults shipped.

(This would go in crockery, btw.)

Offline

#2 2007-07-18 01:54:40

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Setup: surround form contents with (X)HTML comments

This is a good idea. I frequently use comments within the code to keep things straight. I do think the ability to turn them off is important. I’m in the middle of making a site look right within IE and I ran into a bug caused by (X)HTML comments. I thought I was just keeping my code tidy but it turns out the comments were causing another IE display bug.

Offline

#3 2007-07-18 03:49:56

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Setup: surround form contents with (X)HTML comments

Maybe only turn the comments on in Testing and debug mode? I agree it would be very helpful.


Shoving is the answer – pusher robot

Offline

#4 2007-07-18 07:31:46

mourner
Member
From: Kiev, Ukraine
Registered: 2005-02-19
Posts: 57
Website

Re: Setup: surround form contents with (X)HTML comments

Great idea, I’d like it for sure. Currently I’m used to writing in manually in every form. :)

The best option would be to turn it on in testing/debug mode, I agree with Patrick.

Offline

#5 2007-07-18 17:11:03

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Setup: surround form contents with (X)HTML comments

Having it on while in testing/debug mode is good but hopefully there will still be the option of turning the comments off (or on) while in any mode. Speaking for myself, the site that I’m currently fixing is running in testing mode while I get all the CSS bugs taken care of. If it wasn’t possible to turn the comments off, working through the bug I mentioned earlier would be a real pain.

If I had to cast a vote (as if anyone’s asking) I’d say the comments should be controlled simply by an attribute within the TXP tag. That way the TXP devs (or other people submitting code) don’t have to worry about a default setting for testing/debug and another for a live site. It seems it would be a bit easier for the devs and just as effective for those who are building sites.

Offline

#6 2007-07-18 17:46:36

hakjoon
Member
From: Arlington, VA
Registered: 2004-07-29
Posts: 1,634
Website

Re: Setup: surround form contents with (X)HTML comments

If you are working solely on CSS bugs does TXP really need to be in Testing or debug mode? Not that I have an issue with it being a separate option.

I really vote against it being a tag parameter though. That would make it a huge pain to narrow down which tag is spitting out what markup.

Symphony has a url parameter that will put the page in debug mode and let you see the xml and the xslt its is using. Maybe we could adopt something like that? If in debug || testing modes and url parameter debug is true show the comments.

It would alleviate a trip to the admin tab to turn things on and off and would make it near impossible to push out to a live site with the comments enabled.


Shoving is the answer – pusher robot

Offline

#7 2007-07-19 02:43:32

jdykast
Member
From: Tennessee
Registered: 2004-12-30
Posts: 119
Website

Re: Setup: surround form contents with (X)HTML comments

There is no reason for TXP to be in testing or debug just to work through CSS issues—I’ve just got it set up this way because I’m still making sure that all the other parts are working as well. I realize by re-reading Mary’s post that I have read it incorrectly. I was thinking about (X)HTML forms rather than TXP forms and my mind went down the path of having various TXP tags spit out comments to identify themselves. Even as I write that out I’m not sure what I was thinking.

Since we’re dealing with TXP forms the strength (and value) of my opinion goes way down. I use forms but most of my boilerplate code is spit out by homecooked plugins for flexibility’s sake. Can I retract my vote? I hope I haven’t muddied the water too much.

Offline

#8 2007-08-09 23:34:48

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Setup: surround form contents with (X)HTML comments

I really like the idea. And agreed that a universal setting to turn the feature on and off would be a must have.

Offline

#9 2007-08-11 23:08:47

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

Re: Setup: surround form contents with (X)HTML comments

Patch for 4.0.5

I submitted to dev list, but I figured I’d post here for those that would like to try it out and comment.

Offline

#10 2008-01-03 01:24:08

iblastoff
Plugin Author
From: Toronto
Registered: 2006-06-11
Posts: 1,197
Website

Re: Setup: surround form contents with (X)HTML comments

just curious did this patch make it in for upcoming 4.0.6? this would definitely be helpful now as i’m not holding my breath for crockery :)

Offline

#11 2008-01-03 01:33:22

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

Re: Setup: surround form contents with (X)HTML comments

To my knowledge, it was not added to 4.0 dev.

Offline

Board footer

Powered by FluxBB