Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

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

Online

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

etc
Developer
Registered: 2010-11-11
Posts: 5,187
Website GitHub

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>

Offline

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

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

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 | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

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

etc
Developer
Registered: 2010-11-11
Posts: 5,187
Website GitHub

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.

Offline

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

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,446
Website GitHub

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

Online

Board footer

Powered by FluxBB