Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-01-13 15:08:36

roelof
Member
Registered: 2005-03-27
Posts: 647

horizontal link list

Hello,

I know you can make a horizontal list for navagational purposes.

How can i make in TPX a linklist of the categories and can i then use css for making a horizontal list for navigation.

Roelof

Offline

#2 2006-01-13 16:33:36

Thirteen
Member
Registered: 2006-01-09
Posts: 40

Re: horizontal link list

If I’m understanding you correctly, you just want to list the links via txp:linklist for a category and then style it? If so, then just use category=“categoryname” and then class=“classname” in the tag and you’re all set. That’s how I have it done for mine. :)

Offline

#3 2006-01-13 16:40:42

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: horizontal link list

What i want is to be seen at http://www.tamarawobben.nl

The text “zwangerschap, bevalling”“ and so on will be categories.
And with css i have turned them on to a naviagtional list.

But know i have made it all in html and i want to use the posibilities that TPX offers.

Roelof

Offline

#4 2006-01-13 16:56:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: horizontal link list

<txp:category_list wraptag="ul" break="li" />

But this doesn’t give you the &raquo;, and it will output the categories in alphabetical order, which is probably not what you want. There are several plugins though that handle section and category navigation with more flexibility.

Offline

#5 2006-01-13 17:55:45

Thirteen
Member
Registered: 2006-01-09
Posts: 40

Re: horizontal link list

I had something like that done- and what I did was basically create the set of links I want under the links tab and have them grouped under the same category- say “navigation”. I called the list of links via the txp:linklist in a page template I’m using with the class, category, and form specified. Then in the form, I just threw in the txp:link tag along with any other customizations.

If you wanted to use this set of links on all pages, you could always do the output_form and include it in. The downside of this is of course the fact that you’d have to create the links first…but at least it’s something you’d only have to do once.

Oh and like doggiez said, it won’t give you the » between links…

But if the » is important to you, you could go the output_form route for the include and do it in html- but at least you’d only have to do it once.

Offline

#6 2006-01-13 19:02:28

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: horizontal link list

And the links are not sorted but will be the same order as i typ it.

And how do you mean by go for the output-form for the incluse and do it in html ??

Offline

#7 2006-01-13 20:06:27

Thirteen
Member
Registered: 2006-01-09
Posts: 40

Re: horizontal link list

By using the output_form as an include, I meant you could create a new form to input all your links the way you want it to appear on your site in html with the style, etc. Then on your page template where you want to call those links, you’ll just this in to display the links:

< txp:output_form form=“yourformname” / >

That way, at least whenever you want to edit your links- you’d only have to do it once in your form. Along the same lines, if you have the same layout throughout many pages or your site and you use a header include…you can also do it this way.

Would that be something that would work for you?

Offline

#8 2006-01-14 10:50:10

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: horizontal link list

Oke,

I made the links in a category “hoofdmenu”
I have used the form Links.
Then on the page-section there is :

<div id=“hoofdmenu”> <txp:output_form form=“Links” / >
</div>

If a look now at the site there is a message :

tag_error <txp:link/> -> Warning: Wrong parameter count for link() on line 909
tag_error <txp:link_description/> -> Textpattern Warning: unknown_tag

What went wrong ?

Roelof

Offline

#9 2006-01-14 12:16:18

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: horizontal link list

roelof wrote:

<code><div id=“hoofdmenu”>
<txp:output_form form=“Links” / >
</div></code>

I think what went wrong is that Thirteen was talking about links, and you are talking about categories ;)
There is a default ‘Links’ form in Textpattern, that outputs a list of links (as entered in Content > Links). What you want is a list of links to your categories. So it’s better to name your form something like ‘category_menu’ and hardcode the category links in there:
<code>
<ul>
<li> &raquo; <a href=”/category/bevalling”>Bevalling</a></li>
<li> &raquo; <a href=”/category/zwangerschap”>Zwangerschap</a></li>
etcetera
</ul>
</code>
Then on the page where you want it:
<code>
<txp:output_form form=“category_menu” />
</code>
Edit: Roelof, you can display code on this forum with the < code> < /code> tags (without the spaces).

Last edited by doggiez (2006-01-14 12:17:21)

Offline

#10 2006-01-14 12:33:40

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: horizontal link list

there is a misunderstanding i think,

I made the links with content – links.
All these links are in a category.

Im not talking about category but im talking about links.

Roelof

Offline

#11 2006-01-14 13:42:09

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: horizontal link list

Ah, I see. Misunderstood you indeed ;)

What’s in your form ‘Links’ then?

Offline

#12 2006-01-14 13:45:04

roelof
Member
Registered: 2005-03-27
Posts: 647

Re: horizontal link list

on this moment the form links:
<code>
<p><txp:link /><br />
<txp:link_description /></p>
</code>

Offline

Board footer

Powered by FluxBB