Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-03-15 09:41:47

davidgordon
Member
Registered: 2005-04-10
Posts: 23

Why do my links have <BR /> ?

I’ve set up my section list and a link list

<code> <div id=“sidebarContainerLeft”> <txp:section_list break=“li” wraptag=“ul” /> <txp:linklist list break=“li” wraptag=“ul” label=“Links” class=“section_list” /> </div>

</code>

I’ve given the links the same class as the sections so they look the same. So I should have a list of sections and links all styled exactly the same…

But here’s the code TXP produces

<code> <div id=“sidebarContainerLeft”> <ul class=“section_list”>
<li><a href=“http://127.0.0.1/textpattern/index.php?s=Alpha”>Alpha</a></li>
<li><a href=“http://127.0.0.1/textpattern/index.php?s=Beta”>Beta</a></li>
<li><a href=“http://127.0.0.1/textpattern/index.php?s=Charlie”>Charlie</a></li></ul> Links<br /> <ul class=“section_list”>
<li><li><a href=“http://textpattern.net” title=”“>TextBook</a><br /></li>
<li><a href=“http://textpattern.com” title=”“>Textpattern</a><br /></li>
<li><a href=“http://textpattern.org” title=”“>Txp Resources</a><br /></li></ul> </div>

</code>

So you can see that TXP has added an unexpected <code> <BR /> </code> to my links and this is upsetting me and my design!

Perhaps this is the correct way to deal with link lists? Or there’s another good reason for it. Either way, how do I remove the line breaks?

Thanks!

Offline

#2 2006-03-15 10:23:11

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: Why do my links have <BR /> ?

hi David,
you have:
<txp:linklist list break="li" wraptag="ul" label="Links" class="section_list" />

but there is a fault in the tag. it should be:
<txp:linklist break="li" wraptag="ul" label="Links" class="section_list" />

remove “list” !

see Textbook

Last edited by alexandra (2006-03-15 10:23:40)

Offline

#3 2006-03-15 10:25:44

maarten
Member
From: Netherlands
Registered: 2005-02-19
Posts: 130
Website

Re: Why do my links have <BR /> ?

For one thing the list attribute is not part of the txp:linklist tag

Offline

#4 2006-03-15 10:52:35

davidgordon
Member
Registered: 2005-04-10
Posts: 23

Re: Why do my links have <BR /> ?

Thank, but that’s not the problem. I’ve removed the extra “list” anyway, but I still have the same code returned by TXP.

<code> <txp:linklist break=“li” wraptag=“ul” label=“Links” class=“section_list” />

</code>

produces

<code>
<li><a href=“http://textpattern.net” title=”“>TextBook</a><br /></li>
<li><a href=“http://textpattern.com” title=”“>Textpattern</a><br /></li>
<li><a href=“http://textpattern.org” title=”“>Txp Resources</a><br /></li></ul>

</code>

Any further thoughts?

Thanks!

Offline

#5 2006-03-15 11:20:34

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: Why do my links have <BR /> ?

On TXP Mag (JAPAn)
i use
<txp:linklist form="plainlinks" category="txp_japan" limit="100" sort="rand()" wraptag="ul" />

and get:

<code><ul class=“linklist”>
<li><a href=“http://textocean.com/”>textocean.com</a></li>
<li><a href=“http://www.radiohorse.com/blog/”>radiohorse.com/blog</a></li>
<li><a href=“http://rftb.com/”>rftb.com</a></li>
etc…
</ul></code>

You can try this tag for debugging:
<txp:linklist form="yourForm" wraptag="ul" />

yourForm:
<li><txp:link /></li>

Offline

#6 2006-03-15 12:13:46

davidgordon
Member
Registered: 2005-04-10
Posts: 23

Re: Why do my links have <BR /> ?

alexandra wrote:


You can try this tag for debugging:
<txp:linklist form="yourForm" wraptag="ul" />
yourForm:
<li><txp:link /></li>

Yes, That works for me and when I include my class “section_list” I have perfect formatting.

To of interest, what does this prove? Should TXP behave the way I expected?

Thanks again!

Offline

#7 2006-03-15 12:55:27

alexandra
Member
From: Cologne, Germany
Registered: 2004-04-02
Posts: 1,370

Re: Why do my links have <BR /> ?

On TextBook it says:
form=“form name”
Selected from available link forms. Default is plainlinks.

In other words txp:linklist needs a form. if none is assigned default is plainlinks.

Should TXP behave the way I expected?

I do not think so.

Nice it works now :)

Offline

#8 2006-03-15 14:05:30

davidgordon
Member
Registered: 2005-04-10
Posts: 23

Re: Why do my links have <BR /> ?

alexandra wrote:

On TextBook it says:
form=“form name”
Selected from available link forms. Default is plainlinks.

I get it now! Thanks again for your help.

Offline

Board footer

Powered by FluxBB