Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2007-02-21 20:06:55

azw
Member
Registered: 2007-01-29
Posts: 279

Re: How to a generic page/form to output a linklist of a category

That also does not work.

Looking a the debugging output in the HTML source, the value of "<txp:category1 />" and "<txp:category />" are both empty. That’s also true even if they’re just put in the html outside of any other tags.

If I use this code:
<code>
<h3>Test</h3>
<p><txp:category1 /></p>
<p><txp:category /></p>

<txp:asy_wondertag><txp:linklist category=”<txp:category1 />” sort=“description asc” class=“list_plain” wraptag=“ul” break=“li” /></txp:asy_wondertag>
</code>

I see this in the HTML source:
<code>
<h3>Prueba</h3>
<p></p>
<p></p>

<ul class=“list_plain”> <li><a href=“http://www.LINK” title=“TITLE”>TITLE</a><br /></li> <li><a href=“http://www.LINK” title=“TITLE”>TITLE</a><br /></li> <li><a href=“http://www.LINK” title=“TITLE”>TITLE</a><br /></li> <li><a href=“http://www.LINK” title=“TITLE”>TITLE</a><br /></li> <li><a href=“http://www.LINK” title=“TITLE”>TITLE</a><br /></li> <li><a href=“http://www.LINK” title=“TITLE”>TITLE</a><br /></li>
</ul>
</code>

(Two of those listings are not in the chosen category, which means that the "<txp:category />" trick isn’t working.)

And I see this in the debugging mode listing at the bottom of the HTML source:
<code> <txp:category1/> <txp:category/> <txp:asy_wondertag> <txp:category1/> <txp:linklist category=”“ sort=“description asc” class=“list_plain” wraptag=“ul” break=“li” /> [Form: plainlinks] [SQL (0.000089): select *, unix_timestamp(date) as uDate from txp_link where 1 order by description asc ] <txp:linkdesctitle/> <txp:linkdesctitle/> <txp:linkdesctitle/> <txp:linkdesctitle/> <txp:linkdesctitle/> <txp:linkdesctitle/> </txp:asy_wondertag>
</code>

Offline

#14 2007-02-21 20:34:31

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

Re: How to a generic page/form to output a linklist of a category

Did you create categories for your articles with exactly the same names as your link categories?

Last edited by els (2007-02-21 20:35:33)

Offline

#15 2007-02-21 20:46:06

azw
Member
Registered: 2007-01-29
Posts: 279

Re: How to a generic page/form to output a linklist of a category

OH!! You’ve figured it out!

Yes, that works now, using <txp:category1 /> and the same category for the article.

Thanks, Els!

Offline

#16 2007-02-21 21:46:53

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

Re: How to a generic page/form to output a linklist of a category

My pleasure, glad it works :)

Offline

#17 2007-02-22 08:26:48

azw
Member
Registered: 2007-01-29
Posts: 279

Re: How to a generic page/form to output a linklist of a category

I have a related question.

I have a second linklist, which appears directly below the navigation, in the left column of every page on the site.

The page template contains this:
<txp:output_form form="left_column" />

Then the “left_column” form calls two other forms. One of the calls is this:
<txp:article_custom listform="linklist_column" category="causes" limit="1" />

Finally, the “linklist_column” form contains this:
<h4><txp:category name="CATEGORY_NAME" section="SECTION_NAME" link="1" title="1" /></h4>

<txp:asy_wondertag><txp:linklist category="CATEGORY_NAME" sort="linkname asc" class="list_plain" wraptag="ul" break="li" limit="10" /></txp:asy_wondertag>

That works, except that this line:
<h4><txp:category name="CATEGORY_NAME" section="SECTION_NAME" link="1" title="1" /></h4>
creates a link with a URL that ends with ?c=CATEGORY_NAME , like this:
WWW.SITE.COM/SECTION_NAME?c=CATEGORY_NAME

Is there a way to remove that? so the URL points to the section without the GET info, like this?
WWW.SITE.COM/SECTION_NAME/
This is a static page (sticky) adn there are no other pages in the section.

Last edited by azw (2007-02-22 08:32:01)

Offline

#18 2007-02-22 09:09:39

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

Re: How to a generic page/form to output a linklist of a category

azw wrote:

Is there a way to remove that? so the URL points to the section without the GET info, like this?
WWW.SITE.COM/SECTION_NAME/
This is a static page (sticky) adn there are no other pages in the section.

Then why don’t you use <h4><txp:section="SECTION_NAME" link="1" title="1" /></h4>?

Offline

#19 2007-02-22 09:17:11

azw
Member
Registered: 2007-01-29
Posts: 279

Re: How to a generic page/form to output a linklist of a category

Oh, boy… that would be too easy! Ha! I can’t believe I didn’t think of that. It’s works!

Thanks, again, Els, for your help.

Offline

Board footer

Powered by FluxBB