Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-01-05 19:12:50

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

Breadcrumbs on 4.8 beta

The breadcrumbs tag on 4.8 beta does not produce the expected results when using the /section/category/ schema. They are pointing to /section/category/cat1/ urls.


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

Offline

#2 2020-01-06 10:24:44

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

Re: Breadcrumbs on 4.8 beta

Yiannis, under which circumstances do you get it?

Offline

#3 2020-01-06 12:03:58

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

Re: Breadcrumbs on 4.8 beta

etc wrote #320868:

Yiannis, under which circumstances do you get it?

Hi Oleg,
I get it when visiting /section/cat1/cat2/title. I’m yet to test it on /section/cat1/cat2/


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

Offline

#4 2020-01-06 12:14:42

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

Re: Breadcrumbs on 4.8 beta

I’m testing on Pete’s site and it looks ok?

Offline

#5 2020-01-06 14:38:30

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

Re: Breadcrumbs on 4.8 beta

It does not list the categories though. Removing the tag from there and placing it in the default form (in three places), it seems that it is not parsed at all.

The expected result would be My site » articles » Hope for the future » Meaningful labor


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

Offline

#6 2020-01-06 16:12:40

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

Re: Breadcrumbs on 4.8 beta

colak wrote #320875:

It does not list the categories though. … The expected result would be My site » articles » Hope for the future » Meaningful labor

It never worked this way, <txp:breadcrumb /> produces home » section » path » to » category links, which becomes just home » section on individual article pages. You need to mimic URL manually if that’s what you need (split for readability sake):

<txp:breadcrumb title wraptag="" /> » 
<txp:category1 title link this_section wraptag="<+> » " />
<txp:category2 title link this_section wraptag="<+> » " />
<txp:permlink><txp:title /></txp:permlink>

Offline

#7 2020-01-06 16:59:59

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

Re: Breadcrumbs on 4.8 beta

I’ve done it like this but yours is more sanitised:

/ <txp:section link="1" />
<txp:if_article_category number="1"> / <a href="/<txp:section />/<txp:category1 />/"><txp:category1 /></a> /</txp:if_article_category>
<txp:if_article_category number="2"> <a href="/<txp:section />/<txp:category1 />/<txp:category2 />/"><txp:category2 /></a> /</txp:if_article_category>

Edit: I tested your suggestion, and <txp:category2 title link this_section wraptag="<+> » " /> returns /section/cat2/ links.

Last edited by colak (2020-01-06 17:48:00)


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

Offline

#8 2020-01-06 19:13:42

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

Re: Breadcrumbs on 4.8 beta

colak wrote #320878:

Edit: I tested yours, and <txp:category2 title link this_section wraptag="<+> » " /> returns /section/cat2/ links.

Yes, these are canonical category links in section_category mode. I don’t quite get why you are looking for /section/cat1/cat2/ links? Txp would interpret it as ?c=cat2 anyway, totally ignoring cat1, unless you extract it yourself.

Offline

#9 2020-01-07 06:42:55

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

Re: Breadcrumbs on 4.8 beta

etc wrote #320885:

Yes, these are canonical category links in section_category mode. I don’t quite get why you are looking for /section/cat1/cat2/ links? Txp would interpret it as ?c=cat2 anyway, totally ignoring cat1, unless you extract it yourself.

Hi Oleg I’m trying to create this kind of structure

  • /section/
    • /section/title
    • /section/title2
    • /section/cat1a/
    • /section/cat1a/cat2a/
      • /section/cat1a/cat2a/title
      • /section/cat1a/cat2a/title
    • /section/title3
    • /section/cat1b/

etc

To explain. The example below corresponds to
Home > section > cat1 > cat2 > title
and url structure
domain.tld/section/cat1/cat2/title

University home page > Departments > Physics > Staff > person

So, the category staff, could be used for all departments but if it is preceded by cat1=physics, the staff category only lists the people working in the physics department.

sample url would be domain.tld/departments/physics/staff/person

If somebody is on a page of a person I would like them to be able to go one step back and see the list with all the staff of that department.

As a uni will have other departments another url could be
domain.tld/departments/chemistry/staff/person
Which again uses the same category (staff) but the people are different because they belong to the chemistry department.

This is basically what I am trying to achieve both on the other thread and here. Is it doable?


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

Offline

#10 2020-01-07 09:41:09

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

Re: Breadcrumbs on 4.8 beta

Hi Yiannis,

thanks for the explanation. The cumbersome part is to reflect this structure in URL. You have to construct the links and extract cat1/cat2 values by hand. I have just committed a tweak for the latter:

<txp:page_url type="2" />

outputs chemistry on /departments/chemistry/staff/person page. But this does not provide an ‘automatic’ solution. Needs some thinking…

Offline

#11 2020-01-07 15:07:38

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

Re: Breadcrumbs on 4.8 beta

I guess, that the breadcrumbs solution above, is sufficient for this thread but I’m still trying to solve the issue here.

There is another little thing I noticed after changing the files containing your updates. 4.8 beta diagnostics does not issue alerts containing file modifications. Would this be because these alerts are not built into beta versions, or did something go stray?


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

Offline

#12 2020-01-07 15:46:23

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

Re: Breadcrumbs on 4.8 beta

colak wrote #320896:

4.8 beta diagnostics does not issue alerts containing file modifications.

It won’t. Only non-dev (stable) releases check file version stamps.


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