Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-03-19 15:37:03

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Need ideas: How to catenate articles into one display

Hi!

I’m working on a site with an extensive knowledge base section. Most articles consist of a heading and a paragraph that is meant to be collected into a single view with other articles on the same fact sheet/FAQ, with a table of contents at the top of each page linking to each heading.

All the articles were entered with the view of having Textpattern catenating them into a single fact sheet and automatically generating the TOC, but I can’t figure out the best way to do that. All of these articles belong to the “resources” section, and each is tagged with one or two categories. The idea is that each “category1” will have its own page, with the TOC followed by the articles presented in order, with no links to the individual articles.

I thought that something like soo_multidoc would be useful, but what I need to do is almost the opposite. Any suggestions would be appreciated. I’ll keep working at it.

Offline

#2 2011-03-19 17:36:48

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: Need ideas: How to catenate articles into one display

Not sure how helpful this is, but . . .

if you were to switch to a single article for all your faqs, you could use basic formating and soo_toc I think it comes close to creating the effect you are describing.

Last edited by maverick (2011-03-19 17:37:20)

Offline

#3 2011-03-19 17:43:08

maruchan
Member
From: Ukiah, California
Registered: 2010-06-12
Posts: 596
Website

Re: Need ideas: How to catenate articles into one display

Maybe I misread, but can you not do http://www.example.com/resources?c=category1#article-title-in-url-form and then list the articles using a form that adds a named anchor for each article called “article-title-in-url-form”?

Then for the TOC, well, seems like there are a few options, but I’m not sure how they would work with pagination.

Offline

#4 2011-03-19 17:57:12

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Need ideas: How to catenate articles into one display

How about you use txp:article(_custom) twice on the page, the first with custom #anchor link based on the article_url_title, the second with the article and a corresponding id with the article_url_title? Something like this.

<ul id="faq_toc">
<txp:article_custom section="resources" category='<txp:category />' >
   <li><a href="#faq_<txp:article_url_title />" title="click to read answer"><txp:title /></a></li>
</txp:article_custom>
</ul>

<ul id="faq_answers">
<txp:article_custom section="resources" category='<txp:category />' >
   <li id="faq_<txp:article_url_title />" class="faq_answer_block">
      <h3><txp:title /></h3>
      <txp:body />
   </li>
</txp:article_custom>
</ul>

EDIT: multiple articles without a permlink in sight work well with txp, you just need to remember to disable other ways of reaching the individual article behind it, for example by excluding that section (or category) from feeds and rah_sitemap…

Last edited by jakob (2011-03-19 18:00:25)


TXP Builders – finely-crafted code, design and txp

Offline

#5 2011-03-23 16:08:39

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 1,000
Website

Re: Need ideas: How to catenate articles into one display

Thank you, thank you, thank you!

After I posted this, I turned off the internet to hack it together and what I came up with was virtually identical to what Jakob & Maruchan proposed. I had some lingering problems, but worked it out after seeing Jakob’s example. Thanks again.

Offline

Board footer

Powered by FluxBB