Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-10-03 18:07:33

emehrkay
New Member
Registered: 2006-10-03
Posts: 4

echo a catagory

based on what catagory the article is in?

Offline

#2 2006-10-03 18:25:22

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: echo a catagory

Is this what you’re looking for: <a href=“http://textbook.textpattern.net/wiki/index.php?title=Txp:category1_/”>txp:category1</a> and <a href=“http://textbook.textpattern.net/wiki/index.php?title=Txp:category2_/”>txp:category2</a> ?

Offline

#3 2006-10-03 18:43:25

emehrkay
New Member
Registered: 2006-10-03
Posts: 4

Re: echo a catagory

testing it out using

“cat: txp: category1 “ //removed foward slash and brackets

is just returing cat: and i put all the articles under a catagory

Last edited by emehrkay (2006-10-03 18:45:23)

Offline

#4 2006-10-03 21:01:45

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: echo a catagory

Can you post an URL for the page that demonstrates your problem?

Offline

#5 2006-10-04 16:32:05

jordi
Member
From: Barcelona
Registered: 2005-09-14
Posts: 94
Website

Re: echo a catagory

testing it out using
“cat: txp: category1 “

I don’t know if this may be the problem, but you have a whitespace inside the tag that should not be there: <code><txp:category1 /></code>

Offline

#6 2006-10-04 18:07:35

emehrkay
New Member
Registered: 2006-10-03
Posts: 4

Re: echo a catagory

jordi wrote:

bq. testing it out using
“cat: txp: category1 “

I don’t know if this may be the problem, but you have a whitespace inside the tag that should not be there: <code><txp:category1 /></code>
i am doing exactly that (im still playing around with the default stuff – tyring to get used to the system)

<code>
<!— head —>
<div id=“head”>
<h1><txp:link_to_home><txp:sitename /></txp:link_to_home></h1>
<h2><txp:site_slogan /></h2>
cat: <txp:category1 />
</div>
</code>

and still just “cat:”

Offline

#7 2006-10-04 20:14:16

marios
Archived Plugin Author
Registered: 2005-03-12
Posts: 1,253

Re: echo a catagory

The category tag doesn’t output anything, if it’s not in an article form, since it doesn’t have anything to filter out.

regards


⌃ ⇧ < ⌃ ⇧ >

Offline

#8 2006-10-04 20:35:40

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

Re: echo a catagory

You can put this in an article form (lets call it ‘cat1’):
<code>
Cat: <txp:category1 />
</code>
And this on the page:
<code>
<!— head —>
<div id=“head”>
<h1><txp:link_to_home><txp:sitename /></txp:link_to_home></h1>
<h2><txp:site_slogan /></h2>
<txp:if_individual_article>
<txp:article form=“cat1” />
</txp:if_individual_article>
</div>
</code>
It will only work on an individual article page, and you’ll have to set ‘Automatically append comments to articles’ to ‘no’ if you do this, otherwise your comments will show up in the head also.

Offline

Board footer

Powered by FluxBB