Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-04-19 15:40:12

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

How to remove whitespace in section_list output

Hi all, I would like to remove the whitespace that is generated between each li in a list generated by section_list. Anybody know how to do this?

Cheers…

Tom


The Design Works – Freelance website designer

Offline

#2 2011-04-19 16:01:28

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: How to remove whitespace in section_list output

Hi, Tom! Depending on your purpose and the specific patterns you want to remove, you could use pax_grep to do something like this:

<txp:pax_grep from="'\t|\r|\n'" to=""><txp:section_list br="li" wraptag="ul"/></txp:pax_grep>

You could also use rah_function or even pat_speeder, depending on your exact needs.

Last edited by johnstephens (2011-04-19 16:02:26)

Offline

#3 2011-04-19 16:02:00

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,257
Website GitHub Mastodon Twitter

Re: How to remove whitespace in section_list output

Hi Tom

aks_header strips white space but also does much more… Probably not what you are looking for…

Edit: John’s post is more relevant. Also google check

Last edited by colak (2011-04-19 16:05:23)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2011-04-19 16:06:56

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: How to remove whitespace in section_list output

colak wrote:

aks_header strips white space but also does much more…

Aha! I knew I was forgetting something.

Offline

#5 2011-04-19 20:33:20

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

Re: How to remove whitespace in section_list output

Thanks guys. Pax_grep looks promising but the download link doesn’t seem to be working?


The Design Works – Freelance website designer

Offline

#6 2011-04-19 22:35:17

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: How to remove whitespace in section_list output

Oops! I’ll fix it after I feed my baby.

Offline

#7 2011-04-19 23:09:47

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: How to remove whitespace in section_list output

There! I apologize for the mishap.

Offline

#8 2011-04-20 08:31:51

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

Re: How to remove whitespace in section_list output

No problem. Thank you, I’ll give it a go today when I’ve finished feeding my three! :D


The Design Works – Freelance website designer

Offline

#9 2011-04-20 12:49:51

inkywillow
Member
From: France
Registered: 2009-12-22
Posts: 37

Re: How to remove whitespace in section_list output

Works like a charm John. Many thanks.


The Design Works – Freelance website designer

Offline

#10 2011-04-20 14:32:45

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: How to remove whitespace in section_list output

You’re very welcome, Tom! I use the same code whenever I need to output a bunch of variables.

Offline

Board footer

Powered by FluxBB