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: 7,764
Website

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.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
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: 3,580
Website

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: 7,764
Website

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.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
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: 3,580
Website

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: 7,764
Website

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.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
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: 3,580
Website

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: 7,764
Website

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.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
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: 3,580
Website

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: 7,764
Website

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.org | hblack.net | LABS | State Machines | NeMe @ github | Covid-19; a resource
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: 3,580
Website

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

Board footer

Powered by FluxBB