Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-08-25 19:36:05

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

How can I remove line-break elements from txp:linklist?

Hi!

I have the following code:

<txp:linklist
	break="li"
	class="myClass"
	wraptag="ul"/>

I was expecting output like this:

<ul class="myClass">
	<li><a href="http://example.com/?link=1">Link 1 Title</a></li>
	<li><a href="http://example.com/?link=2">Link 2 Title</a></li>
</ul>

But Textpattern seems to be inserting br elements before the close of each li element:

<ul class="myClass">
	<li><a href="http://example.com/?link=1">Link 1 Title</a><br /></li>
	<li><a href="http://example.com/?link=2">Link 2 Title</a><br /></li>
</ul>

Usually, declaring a break attribute in a TXP tag gets rid of any default breaks, but in this case I’m seeing both.

I could easily filter out the line-break elements with rah_replace or pax_grep, but I was wondering if there’s a toggler in the tag or in the preferences that I don’t know about.

Thank you!

Edit: Fix textile. D’oh!

Last edited by johnstephens (2011-08-25 19:36:34)

Offline

#2 2011-08-25 19:50:00

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: How can I remove line-break elements from txp:linklist?

You didn’t specify a form, so could it be that there is a <br/> in the default form it is using, for example it seems that the default plainlinks form has one.


TXP Builders – finely-crafted code, design and txp

Offline

#3 2011-08-25 19:54:06

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

Re: How can I remove line-break elements from txp:linklist?

Linklist uses forms to format the list markup. I would look to the form your linklist is using. By default (when undefined) the form is plainlinks (which by default contains a <br />).

Edit. slowpoke Jukka. Gotta catch them all.

Last edited by Gocom (2011-08-25 19:55:21)

Offline

#4 2011-08-25 19:57:30

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

Re: How can I remove line-break elements from txp:linklist?

Aha, thank you both! I knew that, but I forgot.

Offline

#5 2011-08-25 20:01:39

net-carver
Archived Plugin Author
Registered: 2006-03-08
Posts: 1,648

Re: How can I remove line-break elements from txp:linklist?

johnstephens wrote:

Edit: Fix textile. D’oh!

Err, is that textile that needs something fixing, or something you wrote in textile that needs fixing? If it is the first, let me know.


Steve

Offline

#6 2011-08-25 20:36:50

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

Re: How can I remove line-break elements from txp:linklist?

It was me. Having br elements on my mind, I marked up the code blocks with br.. instead of bc.. . Don’t mind me. ;)

Offline

Board footer

Powered by FluxBB