Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-10-18 02:00:24

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Section-aware category lists

Something I was doing with RC3, but haven’t got working yet in 4.0.1: When displaying an individual article, I have a “See Also” sidebar containing four links to category lists:

  1. all articles in current section, category1
  2. all articles in current section, category2
  3. all category1 articles
  4. all category2 articles

To get the first link I would use something like this:
<a href="/<txp:section />/?c=<txp:category1 />"><txp:section /> - <txp:category1 /></a>

However, since upgrading to 4.0.1 I’m no longer getting any output from <txp:section /> etc, in this context. Maybe the problem is that this sidebar is not part of the article form itself, but is contained in a separate miscellaneous form called directly from the page template. (This follows naturally from the way I’ve laid out the templates and CSS.) I don’t know if the new behavior is a bug (or, for that matter, if the old behavior was a bug); at the moment I’d just like to get the links working again.

Any clues much appreciated.


Code is topiary

Offline

#2 2005-10-18 11:33:30

andreas
Member
Registered: 2004-02-28
Posts: 453
Website

Re: Section-aware category lists

What happens when you change the form’s status to “article”? Alternatively, try using <txp:s /> instead of <txp:section />. Don’t know if that helps but it might.

Offline

#3 2005-10-18 13:57:31

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Section-aware category lists

Thanks andreas—changing the form’s type to “article” didn’t do it. <txp:s /> does generate the section name (not the title, which I would also like), but <txp:c /> doesn’t produce anything here, and I need the categories too.

Later: I updated my dev installation to r1036 (thanks to The Bomb Site for the handy download link) and now <txp:section /> works in my sidebar; still need to get the categories.

Later still: I redid the relevant page templates and forms to have the sidebar created directly within the article form—everything works now, and works under r888 (the current stable release). I’m not so crazy about the ensuing slight loss of modularity in my template structure, but at least the process wasn’t as difficult as I feared.

Last edited by jsoo (2005-10-19 15:41:46)


Code is topiary

Offline

Board footer

Powered by FluxBB