Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-08-04 17:59:29

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Help with Article / Category / Section Implementation

Here’s the site I’m trying to rebuild in TextPattern:

http://centerfest.durhamarts.org/performances.html

Some thoughts:
  • I’d like each ‘act / performer’ to be an article
  • I can set their show time in a custom field
  • I can set their ‘day’ and ‘stage’ in a category

The real question is i’d want to sort it like the page above…

Day 1
-Stage 1
—Time 1
—Time 2
—Time 3
-Stage 2
—Time 1
—Time 2
—Time 3
-Stage 3
—Time 1
—Time 2
—Time 3

Day 2
-Stage 1
—Time 1
—Time 2
—Time 3
-Stage 2
—Time 1
—Time 2
—Time 3
-Stage 3
—Time 1
—Time 2
—Time 3

  • Forget the anchor tags, I’ll just have the performer links open up the individual article’s page

THANKS FOR YOUR HELP

Offline

#2 2010-08-04 23:49:55

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Help with Article / Category / Section Implementation

  • Section: You only need one section
    • For multiple events you can use multiple sections of course
  • Publish: Each ‘act / performer’ as an article plus the necessary field contents
  • Navigation: Link to txp:category1 name=“day n”
    • You site navigation can simply link to single articles
  • Stages: Show article list differentiated by txp:if_different.
  • Showtime: Sort txp:article list by custom field ‘showtime’ eg sort=“custom_1”. Only show article title (performer) and wrap in txp:permlink to full article.

Read more in the Textpattern tag reference

PS: You can recycle your whole content by copying the existing HTML into the article. But take care to turn off textile for those articles!
PPS: You can even simply keep the old navigation links and the HTML pages.

Last edited by merz1 (2010-08-05 00:04:03)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#3 2010-08-05 11:25:33

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: Help with Article / Category / Section Implementation

brilliant. thanks so much. if i’d known about (or read about) if_different before, i’d have saved myself a TON of time.

THANKS!

Offline

#4 2010-08-05 13:35:03

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Help with Article / Category / Section Implementation

OK. Fine. Let’s hear about how you did the details when your page works properly.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#5 2010-08-05 18:20:25

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: Help with Article / Category / Section Implementation

Sure. I ended up using this form for articles in the ‘performances’ section:

<txp:if_different><h2><txp:custom_field name="Performance_Day" /></h2></txp:if_different>
<txp:if_different><h3><txp:category1 title="1" /></h3></txp:if_different>
<li><txp:posted format="%l:%M %p" /> - <txp:permlink><txp:title /></txp:permlink></li>

i used the posted time as the show time so I could parse and sort it correctly and get 1PM rather than 13PM, which is what I would have needed to do if I put time in a custom field (i think)

here’s the article tag in the section:

<txp:article_custom sort="custom_6 ASC, Category1 ASC, Posted ASC" form="performances" section="performances"  />

so it first sorts by day (custom_6), then by stage name (category1), and then by posted time. and i end up with this

which is exactly what i wanted.

thanks again for your help.

Offline

#6 2010-08-05 22:08:46

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Help with Article / Category / Section Implementation

OK. It’s late already but I see:

  • Missing <ul>...</ul> wrapping. Seeing your design I am not even sure if you need an unordered list format.
  • CSS: Use a CSS table eg class="class name" for proper formatting of txp:posted

My very fast proposal for a page template using your code (no form used) and trying to implement a proper unordered list:
(Edited the code twice but I am still unsure/confused about the ul/li logic in combination with txp:if_different)

<txp:article_custom sort="custom_6 ASC, Category1 ASC, Posted ASC" wraptag="ul" break="li" section="performances">
<txp:if_different><h2><txp:custom_field name="Performance_Day" /></h2></txp:if_different>
<txp:if_different><txp:category1 title="1" wraptag="h3" /></txp:if_different>
<txp:posted format="%l:%M %p" class="CSS class name" /> - <txp:permlink><txp:title /></txp:permlink>
</txp:article_custom>
  • Note: Use attributes like wraptag="ul" break="li" where available.
  • PS: Loads of &nbsp; in your HTML.

Last edited by merz1 (2010-08-05 22:32:25)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#7 2010-08-06 19:01:49

claywso
Member
From: Durham, NC USA
Registered: 2004-12-20
Posts: 57
Website

Re: Help with Article / Category / Section Implementation

thanks! i’ll definitely take that advice and clean up / simplify my implementation.

any advice on this one? http://forum.textpattern.com/viewtopic.php?id=34362

Offline

#8 2010-08-07 13:24:02

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: Help with Article / Category / Section Implementation

Advice: Welcome to the world of tagging

Last edited by merz1 (2010-08-07 13:24:53)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB