Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2010-10-25 21:49:41

gooberboy
Member
From: Seattle
Registered: 2008-02-15
Posts: 25
Website

Creating Unique Section Landing Page -- How?

Hello,

I have a section that displays a list of articles normally, but I would like to transform this page into a page that serves up a grid of latest article titles, categories, and author images. I would like to be able to still display article lists based on category and author that are in this specific section, but I don’t want anything other than the browse grid on the landing page.

For the life of me, I can’t figure out how to prevent the article list from displaying, while showing the grid I’ve designed. I know I need to use an if/else statement, but which one? There is no “if_section_landing_page” tag!

Any help is most appreciated!

Offline

#2 2010-10-25 22:07:58

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

Re: Creating Unique Section Landing Page -- How?

soo_if_frontpage if you want a single conditional for this.


Code is topiary

Offline

#3 2010-10-25 22:11:33

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

Re: Creating Unique Section Landing Page -- How?

If you want to do it without plugin:

<txp:if_section>
   <txp:if_article_list>
      <txp:if_category>
          // category page
      <txp:else />
         <txp:if_author>
            // author page
         <txp:else />
            <txp:if_search>
               // search results page
            <txp:else />
               // section landing page
            </txp:if_search>
         </txp:if_author>
      </txp:if_category>
   <txp:else />
      // individual article page
   </txp:if_article_list>
</txp:if_section>

Offline

#4 2010-10-25 22:14:07

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

Re: Creating Unique Section Landing Page -- How?

Hi gooberboy,

I’m not sure if I follow, but you could try something like:

<txp:if_article_list>

  <!-- we are on an article list, this could be the section landing page (aka "frontpage"), a category/ or an author/ page -->

  <txp:if_category>

    <!-- we are on a category page -->

  <txp:else />

    <txp:if_author>

      <!-- we are on a author page -->

    <txp:else />

      <!-- we are on a section front page (hopefully!)

    </txp:if_author>

  </txp:if_category>

<txp:else />

  <!-- we are on an individual article page -->

</txp:if_article_list>

If that doesn’t work, then you could try the soo_if_frontpage plugin. :)
Hope that helps.


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#5 2010-10-25 22:14:43

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

Re: Creating Unique Section Landing Page -- How?

Ops, Els was faster and more accurate. :)


La música ideas portará y siempre continuará

TXP Builders – finely-crafted code, design and txp

Offline

#6 2010-10-26 03:13:53

gooberboy
Member
From: Seattle
Registered: 2008-02-15
Posts: 25
Website

Re: Creating Unique Section Landing Page -- How?

Thanks folks. I will likely just use the plugin :)

Offline

#7 2010-10-26 06:34:06

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

Re: Creating Unique Section Landing Page -- How?

gooberboy For a better TXP understanding aka use TXP core tags first:

For the life of me, I can’t figure out how to prevent the article list from displaying, while showing the grid I’ve designed.

Look for the TXP code/tag txp:article in your section template (page) or in the form fetched via txp:output_form in your section template (page). Most likely txp:article is responsible for the the article list. In some cases designers use txp:article_custom.

Read:


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

Offline

#8 2010-10-26 13:03:24

gooberboy
Member
From: Seattle
Registered: 2008-02-15
Posts: 25
Website

Re: Creating Unique Section Landing Page -- How?

merzi, I have a pretty good understanding of those tags, but as you can see from the guidance above, doing the operation I want without a plugin requires a pretty complicated series of nested tags. TXP should have the functionality of soo’s plugin by default, IMHO.

Offline

#9 2010-10-26 15:48:17

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

Re: Creating Unique Section Landing Page -- How?

gooberboy OK

  • Those nested tags cover a whole set of situations (and not only one (1)). Els and maniqui handed you a ready made solution/snippet for multiple if/else situations.
  • Main point: The article list you complain about must be defined somewhere. Look for the code and delete the unnecessary code or have a fitting if/else decision in place.

There is no “if_section_landing_page” tag!

  • Sure there is. TXP doesn’t need such a specific tag because all those if/else situations can/do cover multiple landing pages.
  • Last not least your original post wasn’t specific enough to recommend a specific plug-in. Instead your question was a call for a classic TXP core situation/solution.

PS: I am a anti-plug-in fanboy if some brain activity will deliver a fine solution through core tags. In most cases the core solution is straight forward and more performant.

Last edited by merz1 (2010-10-26 15:49:06)


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

Offline

#10 2010-10-26 15:54:43

gooberboy
Member
From: Seattle
Registered: 2008-02-15
Posts: 25
Website

Re: Creating Unique Section Landing Page -- How?

Plug-in is working great. Moving on.

Last edited by gooberboy (2010-10-26 17:07:46)

Offline

#11 2010-10-26 17:05:01

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

Re: Creating Unique Section Landing Page -- How?

merz1 wrote:

In most cases the core solution is straight forward and more performant.

Yes, but what about this case? If all that is needed is the single “is this the landing page” conditional check, using the plugin is by far the more straightforward solution and is probably faster as well (a large stack of nested tags exacts a toll from the tag parser).


Code is topiary

Offline

#12 2010-10-26 17:08:25

gooberboy
Member
From: Seattle
Registered: 2008-02-15
Posts: 25
Website

Re: Creating Unique Section Landing Page -- How?

I agree with jsoo.

Offline

Board footer

Powered by FluxBB