Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2020-01-07 17:05:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,205
Website GitHub

Re: Breadcrumbs on 4.8 beta

etc wrote #320903:

Yes, you should be able to solve it with a page like this (latest dev):

<txp:variable name="c1" value='<txp:page_url type="2" />' />
<txp:variable name="c2" value='<txp:page_url type="3" />' />

and …

<txp:article match="Category1=2, Category2=3" …

Woah! That’s cool.

So the first example is get the url parts split by a /? And the second one means, match url-part-2 to Category1 and url-part-3 to Category2?


TXP Builders – finely-crafted code, design and txp

Offline

#17 2020-01-07 17:12:46

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

Re: Breadcrumbs on 4.8 beta

etc wrote #320903:

Yes, you should be able to solve it with a page like this (latest dev):

<txp:article match="Category1=2, Category2=3" form="article_listing" />

Interesting! but I’m not sure that I understand this part: match="Category1=2, Category2=3"

> Edit Julian was faster:)

Last edited by colak (2020-01-07 17:15:01)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#18 2020-01-07 18:55:58

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

Re: Breadcrumbs on 4.8 beta

I’ve split the topic in order to keep this thread focused, for future reference.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#19 2020-01-07 22:05:17

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

Re: Breadcrumbs on 4.8 beta

colak wrote #320909:

Interesting! but I’m not sure that I understand this part: match="Category1=2, Category2=3"

> Edit Julian was faster:)

Yes, what Julian says. Moreover, Category1/2 can be filtered by URL variables: match="Category1=var1, Category2=var2" like other cf.

And if you need to select the articles with, say, not empty Category2, the syntax is

<txp:article_custom category match="Category2" ... />

And to exclude them

<txp:article_custom category match="Category2" exclude="category" ... />

Offline

#20 2020-01-08 07:04:51

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

Re: Breadcrumbs on 4.8 beta

I feel like a total idiot as I still do not get it:(
Could someone post a couple of url examples and how they are represented by the tags?


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#21 2020-01-08 10:29:31

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

Re: Breadcrumbs on 4.8 beta

colak wrote #320921:

Could someone post a couple of url examples and how they are represented by the tags?

It’s quite simple: to retrieve chemistry on this page

/departments/chemistry/staff/arrhenius

use

<txp:page_url type="2" />

since chemistry is the second (ltr) chunk of URL.

Offline

#22 2020-01-08 10:40:17

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

Re: Breadcrumbs on 4.8 beta

And match="Category1=2" syntax on /departments/chemistry/staff/arrhenius means articles with Category1='chemistry'. Alternatively, if your links were of the form

/departments/?name=chemistry&role=staff&person=arrhenius

you could retrieve chemistry with

<txp:page_url type="name" />

and match Category1 against it with match="Category1=name".

Offline

#23 2020-01-08 12:04:50

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

Re: Breadcrumbs on 4.8 beta

In your example is arrhenius corresponding to <txp:page_url type="4" /> or are these types only for sections and categories since we have article_url_title to detect the article titles? Also, Arrhenius should retire and offer his position to younger staff:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#24 2020-01-08 12:47:18

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

Re: Breadcrumbs on 4.8 beta

colak wrote #320926:

In your example is arrhenius corresponding to <txp:page_url type="4" />… ?

Yes, numeric types are agnostic of their txp role.

Also, Arrhenius should retire and offer his position to younger staff:)

The government has decided he must work a little more (local retirement reform actuality).

Offline

Board footer

Powered by FluxBB