Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2018-01-16 10:23:54

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,540
Website

Re: section front page

the ability to easily separate the front to the rest of the pages in sections would be warmly welcomed from all I think.

Oleg’s suggestion does look very promising!!!!


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Online

#12 2018-01-16 10:25:11

etc
Developer
Registered: 2010-11-11
Posts: 2,648
Website

Re: section front page

Thanks, Stef. The names are often the less evident part :-) I’m ok with offset (that was actually the birth name of shift), just note that it has two purposes:

  1. offsetting, as you say
  2. appending pg=1

I also still hesitate to make <txp:older shift /> output /landing/?pg=1 (and not /landing/?pg=2 as without shift) on a /landing/ page, making the latter a “zero” page (useful?). Not sure offset reflects all this functionality.

Same with type attribute of <txp:if_article_list />. Generally, type means article, file and so on, is this confusing?


etc_[ query | search | pagination | date | tree | cache ]

Offline

#13 2018-01-16 13:07:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,293
Website

Re: section front page

Mmmm yeah, it is slightly different to offset. Not sure. My gut feeling is that shift isn’t super intuitive to non programmers, but I might be wrong. In most case, people will use it to offset the pg parameter by an amount when building next/prev URLs. The fact you can also use it as a boolean to trigger adding pg=1 is a by-product, imo. In other words, at the moment if you don’t specify an offset value, it forces the page to 1 and adds it to the URL.

Whatever we name it, the parameter will have this ‘dual’ functionality at present. Is it consistent with our other boolean attributes? i.e. does specifying ‘true’ in other tags do something different to specifying a value? If it’s broadly consistent, fine. If it’s inconsistent, then maybe we should use offset for the true addition/subtraction of page number, and a different attribute (showalways?? Mmm, maybe not) to trigger the pg=1 behaviour, if we deem that useful.

I’m not too bothered about type as it’s generic enough that we can get away with it. And we’ve used it in <txp:image_info /> and <txp:page_url /> (among others) slightly differently from just “type context” anyway.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

#14 2018-01-17 13:11:20

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,540
Website

Re: section front page

Why not use the glx paradigm?

ie.

<txp:if_article_list>
<txp:if_section_frontpage name="section_name">
<txp:article id="##" status="sticky" />
<txp:else />
<txp:article />
</txp:if_section_frontpage>
</txp:if_article_list>

Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Online

#15 2018-01-17 22:51:38

etc
Developer
Registered: 2010-11-11
Posts: 2,648
Website

Re: section front page

colak wrote #308705:

Why not use the glx paradigm?

Then we’d need to create also <txp:if_author_frontpage /> and so on, for consistency. And not win much, this does more or less the same:

<txp:if_section name="section_name">
  <txp:if_article_list type="author, c, month, pg, q">
    <txp:article />
  <txp:else />
    <txp:article status="sticky" />
  </txp:if_article_list>
</txp:if_section>

etc_[ query | search | pagination | date | tree | cache ]

Offline

#16 2018-01-18 08:17:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 6,540
Website

Re: section front page

etc wrote #308710:

Then we’d need to create also <txp:if_author_frontpage /> and so on, for consistency. And not win much, this does more or less the same:

<txp:if_section name="section_name">...

Fair enough.

I guess I am thinking in a non programmer way. The front page comes before the rest. I could nevertheless live easily with that solution.


Yiannis
——————————
neme.org | hblack.net | LABS | State Machines | NeMe @ github

Online

#17 2018-01-18 13:35:48

etc
Developer
Registered: 2010-11-11
Posts: 2,648
Website

Re: section front page

I think the main problem is that there is no universal frontpage definition. Clearly, /some_section/ URL is section frontpage, but what about /some_section/?author=me? Sometimes you want to consider it as section+author frontpage, sometimes not.


etc_[ query | search | pagination | date | tree | cache ]

Offline

#18 2018-01-18 13:50:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 8,293
Website

Re: section front page

etc wrote #308719:

the main problem is that there is no universal frontpage definition.

Exactly this. I refer to Section front pages as “landing pages” when explaining it to people. I’d call the author list an “author landing page” or category list a “category landing page”, but I wouldn’t call the site front page the site’s landing page, even though they’re all traditionally served by the same default Page template.

The way Oleg has this set up now allows you to decide what you deem “front” or “home” or “landing” or whatever you want, without our enforced naming convention getting in the way. You can serve them all from the same Page template if you like and differentiate easily, or assign a template for each use case, or a suite of templates to handle a subset of them. Nice and flexible, no plugin required.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB