Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2013-05-05 21:33:08

mericson
Member
Registered: 2004-05-24
Posts: 137
Website

Textpattern tag to trim whitespace?

For years with TextPattern there has been lots of gratuitous whitespace (newlines) in my generated HTML as a side-effect of my textpattern tags in pages & forms and my organized those to be easily readable / editable. .

I’m beginning to wish there was a better way… some of my more complex pages are littered with unnecessary whitespace. Does anybody have a solution?

I was wondering perhaps if there could be a tag pair that could trim extra whitespace for anything between the tags (consecutive whitespace characters)?

Offline

#2 2013-05-05 22:13:58

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: Textpattern tag to trim whitespace?

Theres a few ways…. have a read through this thread on removing whitespace

Offline

#3 2013-05-05 23:48:42

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

Re: Textpattern tag to trim whitespace?


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#4 2013-05-09 10:16:39

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: Textpattern tag to trim whitespace?

If you have full access to your web server, you can use mod_pagespeed for trimming whitespace and other speed improvements. I use that, works great.

Offline

#5 2013-05-10 12:56:18

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

Re: Textpattern tag to trim whitespace?

I’ve had great success with rah_replace@ overall. Some inline JavaScript can get a little twitchy and break (jPlayer, in my case), but other than that it’s fantastic.

Offline

Board footer

Powered by FluxBB