Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-10-21 07:35:04

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

extra spaces in category_list break tag - minor bug

I have this code using txp v4.5.1

<txp:category_list parent="artists" exclude="artists" sort="name" section="artists" wraptag="p" break=", ">
<txp:category title="1" link="1" />
</txp:category_list>

which returns:

<p>artist 1 , artist 2 , artist 3 , etc</p>

Can anybody advice me why there is a space after the artists’ names and before the comma?

It is a behaviour I don’t remember in previous txp versions and breaks the layout of the page as sometimes the comma is moved to the next line.


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

Offline

#2 2012-10-21 08:05:26

CeBe
Plugin Author
From: Caen - Fr
Registered: 2010-06-25
Posts: 345
Website

Re: extra spaces in category_list break tag - minor bug

Try the single tag, like this :

<txp:category_list parent="artists" exclude="artists" sort="name" section="artists" wraptag="p" break=", " />

Offline

#3 2012-10-21 08:58:13

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

Re: extra spaces in category_list break tag - minor bug

Hi Claire, the single tag does indeed work as expected. Any ideas why the container tag doesn’t?


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 2012-10-21 09:25:19

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: extra spaces in category_list break tag - minor bug

colak wrote:

Hi Claire, the single tag does indeed work as expected. Any ideas why the container tag doesn’t?

Because you have two newlines before and after the category title. Anything that is wrapped in the tags, is included in the list output, including any whitespace. This as intended. If you do not want any whitespace, then you should write that without those newlines.

Moving this to How Do I…? & Other Questions.

Last edited by Gocom (2012-10-21 09:27:56)

Offline

#5 2012-10-21 10:21:10

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

Re: extra spaces in category_list break tag - minor bug

Hi Jukka, that makes sense. Thanks


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

Offline

#6 2012-10-22 06:17:26

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: extra spaces in category_list break tag - minor bug

If that fact isn’t already there, it should be mentioned in the wiki.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB