Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#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
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
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
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
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
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
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
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
Re: Setup: surround form contents with (X)HTML comments
I submitted to dev list, but I figured I’d post here for those that would like to try it out and comment.
Offline
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
Re: Setup: surround form contents with (X)HTML comments
To my knowledge, it was not added to 4.0 dev.
Offline