Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2020-01-03 19:07:06

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,258
Website

Re: some ideas needed for txp 4.8 update

Bloke wrote #320781:

You can assign categories to either cat1 or cat2 and they’ll appear in the correct order in the URL depending where they’re used. What am I missing?

After further testing, the only way to get /section/cat1/cat2/... is by having sub categories. Both /breadcrumbs/title and section/category/title schemas return urls like site.tld/section/cat1+cat2/welcome-to-your-site and not the desired site.tld/section/cat1/cat2/welcome-to-your-site which signifies a deeper structure.

A note here that I think that both the schemas’ outputs are semantically correct.

This brings me back to the post above but I’m still hoping that there may be another way.

Rephrased here.

When saving an article which has the same title as another one in our db, we rightly get a warning which we can ignore if the other article’s title belongs to another section. Could this functionality be introduced for sub-categories too or is there a conceptual or technical reason which makes it impossible?

Here is an example based on my descriptions earlier in this post:

/fruits/apples/granny-smith <— /section/cat/title
/recipes/desserts/apples/apple-pie <— /section/ancestors/of/sub-cat/title

As is, there is no way to get our apple-pie as apples are already on the top of the category chain, and they can not also appear under the desserts.

Edited to add that I thought of a technical reason which only occurs in the messy schema where the category urls are so rudely not considering their ancestors: www.site.tld/index.php?s=recipes&c=apples

I would nevertheless still be interested to discuss a solution for this issue.

Last edited by colak (2020-01-03 19:58:36)


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

#12 2020-01-04 00:28:23

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,708
Website

Re: some ideas needed for txp 4.8 update

colak wrote #320801:

Could this functionality be introduced for sub-categories too

We don’t have subcategories in Txp. We just have two categories that are siblings. Category 1 appears “first” in the list because, well, one of them has to! But it has no actual hierarchy so I’m not sure how we could detect if you’ve used it as such when you save. And even if we could, the number of times the same category is used across many articles, you’d be seeing the amber warning most of the time you saved.


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

#13 2020-01-04 08:07:02

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,258
Website

Re: some ideas needed for txp 4.8 update

Bloke wrote #320810:

We don’t have subcategories in Txp.

we do in the categories pane.


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

#14 2020-01-04 09:16:31

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 9,708
Website

Re: some ideas needed for txp 4.8 update

colak wrote #320814:

we do in the categories pane.

Sorry, I wasn’t clear. We offer the administrator a way to apply a hierarchy for Sanity’s sake and to group related categories, but we don’t use it anywhere else. It’s purely for organisational purposes.

If you wanted to, you could assign a “subcat” to category 1 and its parent to category 2. Or the same category to both. Txp would let you.

Last edited by Bloke (2020-01-04 09:18:19)


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

#15 2020-01-04 10:40:46

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,258
Website

Re: some ideas needed for txp 4.8 update

Bloke wrote #320819:

Sorry, I wasn’t clear. We offer the administrator a way to apply a hierarchy for Sanity’s sake and to group related categories, but we don’t use it anywhere else. It’s purely for organisational purposes.

If you wanted to, you could assign a “subcat” to category 1 and its parent to category 2. Or the same category to both. Txp would let you.

Indeed but the problem lies with the url patterns.

breadcrumb/title returns sanitised urls based on the hierarchy set in the categories pane. ie if you set categories like

  • desserts
    • apples

and have an article named apple-pie, the schema will return /section/desserts/apples/apple-pie which is perfect.In cases like this only one category can be used in the write pane.

The problem with sub-cats when used on cat1 and cat2, the + sign is used in the url ie /section/cat1+cat2/welcome-to-your-site and understandably totally ignores the hierarchy, even when there is one.

In reality, although I fully support the latest url schemas, I am finding out that we need slightly more flexibility in order to achieve deeper url structures. This can be achieved in 2 ways

  1. add another schema which can build urls like /section/cat1/cat2/title
  2. as I wrote earlier, allow duplicate category names when using the /breadcrumb/title/ schema. This may be achieved by adding an id to each title which can then be called in order to differentiate between categories sharing the same name.

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

#16 2020-01-04 11:14:11

etc
Developer
Registered: 2010-11-11
Posts: 3,842
Website

Re: some ideas needed for txp 4.8 update

colak wrote #320820:

The problem with sub-cats when used on cat1 and cat2, the + sign is used in the url ie /section/cat1+cat2/welcome-to-your-site and totally ignores the hierarchy, even when there is one.

If cat2 is a descendant of cat1, I get /section/cat1/cat2/welcome-to-your-site as expected. Do you mean we should do it by levels, even if cat1 and cat2 are in different branches?

allow duplicate category names when using the /breadcrumb/title/ schema.

This is difficult for bw compatibility reasons, one of the difficulties being ?c=catname URL pattern (whatever scheme) as you note.

Offline

#17 2020-01-04 13:32:43

etc
Developer
Registered: 2010-11-11
Posts: 3,842
Website

Re: some ideas needed for txp 4.8 update

Okay, unconditional /section/cat1/cat2/title makes sense in section_category mode, changed.

Offline

#18 2020-01-04 18:05:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,258
Website

Re: some ideas needed for txp 4.8 update

etc wrote #320823:

Okay, unconditional /section/cat1/cat2/title makes sense in section_category mode, changed.

Thanks so much Oleg,

I am testing it now!


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

#19 2020-01-04 18:22:18

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,258
Website

Re: some ideas needed for txp 4.8 update

etc wrote #320822:

If cat2 is a descendant of cat1, I get /section/cat1/cat2/welcome-to-your-site as expected.

This is indeed true

Do you mean we should do it by levels, even if cat1 and cat2 are in different branches?

I know it is conceptually problematic but that is what I was implying.

This is difficult for bw compatibility reasons, one of the difficulties being ?c=catname URL pattern (whatever scheme) as you note.

I understand. The reason I kicked a fuss is because I think that although branches can give a deeper structure, the limitation of names can eventually lead to semantic issues in the urls

ie. /journal/physics/issues/paper v /journal/quantum-mechanics/issues/paper.


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

#20 2020-01-04 20:56:39

etc
Developer
Registered: 2010-11-11
Posts: 3,842
Website

Re: some ideas needed for txp 4.8 update

colak wrote #320828:

The reason I kicked a fuss is because I think that although branches can give a deeper structure, the limitation of names can eventually lead to semantic issues in the urls

You are absolutely right, the new implementation is more flexible, thanks for the fuss and don’t stop :-)

Offline

Board footer

Powered by FluxBB