Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-07-23 22:08:16

aarplane
Member
From: Canada
Registered: 2005-07-29
Posts: 52
Website

Two different sections with two different forms on front page

Hi Textpatterners,

I want to put two different types of posts on the front page (full articles and “tumbles”), just like daringfireball.net or ma.tt.

I was wondering if i can do automatically this without overriding the form for every tumble.

Thanks,
Aaron

Last edited by aarplane (2008-07-23 22:12:01)

Offline

#2 2008-07-23 22:46:20

maniqui
Member
From: Buenos Aires, Argentina
Registered: 2004-10-10
Posts: 3,070
Website

Re: Two different sections with two different forms on front page

Hi Aaron,

You have to do some differentiation between a full article and a tumble.
For that, you could:

  • publish them to different sections (section “articles” and section “tumbles”)
    • then, in your article form, use <txp:if_article_section name="articles">...code for full articles...</txp:if_article_section><txp:if_article_section name="tumbles">...code for tumbles...</txp:if_article_section>
  • similarly, publish them to the same section (“articles”) but apply a different category for tumbles.
    • then, in your article form: <txp:if_article_category name="tumbles">...code for tumbles <txp:else />... code for full articles</txp:if_article_category>
  • similarly, create a custom field and fill it if the post is a tumble.
    • then, in your article form: <txp:if_custom_field name="tumble">...code for tumbles...<txp:else />...code for full articles...</txp:if_custom_field>
  • or use the override form :)

Last edited by maniqui (2008-07-23 22:46:35)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#3 2008-07-23 22:58:37

aarplane
Member
From: Canada
Registered: 2005-07-29
Posts: 52
Website

Re: Two different sections with two different forms on front page

maniqui wrote:

Hi Aaron,

You have to do some differentiation between a full article and a tumble.
For that, you could:

  • publish them to different sections (section “articles” and section “tumbles”)
    • then, in your article form, use <txp:if_article_section name="articles">...code for full articles...</txp:if_article_section><txp:if_article_section name="tumbles">...code for tumbles...</txp:if_article_section>
  • similarly, publish them to the same section (“articles”) but apply a different category for tumbles.
    • then, in your article form: <txp:if_article_category name="tumbles">...code for tumbles <txp:else />... code for full articles</txp:if_article_category>
  • similarly, create a custom field and fill it if the post is a tumble.
    • then, in your article form: <txp:if_custom_field name="tumble">...code for tumbles...<txp:else />...code for full articles...</txp:if_custom_field>
  • or use the override form :)

Thanks maniqui! It was bugging me for a while. The first method with the sections is what I wanted. I was having a brain lapse, and didn’t even think about using conditional tags.

Offline

#4 2008-07-28 20:51:42

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

Re: Two different sections with two different forms on front page

Or use the TXP plug-in asv_tumblelog.

  • Uses its own section for the tumblelog
  • Allows to import RSS feed items as articles
  • Every feed can have its own default category, keywords and form
  • Possibility to write a new tumblelog entry via bookmarklet

A nice alternative!


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

Offline

Board footer

Powered by FluxBB