Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-07-09 11:22:07

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,259
GitHub

Topping and tailing pages, forms, etc

Hi.
Over the years I’ve developed a template to use with all my pages, forms and other chunks of admin-side code. I want to balance code readability on the admin-side with as much minifying on the front-end as is feasible. I use rah_replace to zap tab stops and line breaks, hide to annotate the file for easier offline searching in both SQL dumps and CodeBox, and to reduce the chance of my over-writing a chunk of code with an errant copy+paste I have the same text at the beginning and end of the file so I can quickly check my paste has gone into the correct pane. Here’s an example:

<txp:rah_replace from="
" to="">
<txp:hide>
*******************************************************
Site: example.com
Name: links_foo
Type: form, links
Info: used to populate content of woo
*******************************************************
</txp:hide>
CODE GOES IN HERE
<txp:hide>
*******************************************************
Site: example.com
Name: links_foo
Type: form, links
Info: used to populate content of woo
*******************************************************
</txp:hide>
</txp:rah_replace>

I’m posting here in case you might find it useful; please have it with my best wishes.

Offline

Board footer

Powered by FluxBB