Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

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

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

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.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-07 15:46:23

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

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

#13 2020-01-07 16:33:15

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,933
Website

Re: Breadcrumbs on 4.8 beta

I know this doesn’t answer your (interesting) question but I wonder if you can simplify your task by making /departments/chemistry/ the section, i.e. both parts. You might need departments-chemistry for that in the backend. That might be tolerable if departments/ on its own has very few pages – for example just an overview. You’d them have:

tld.com/departments_» a section (or even a title-only article)_
tld.com/departments-physics _» a section_
tld.com/departments-physics/staff _» a section + category filter on list page_
tld.com/departments-physics/staff/person _» an individual article_
tld.com/departments-chemistry _» a section_
tld.com/departments-chemistry/staff _» a section + category filter on list page_
tld.com/departments-chemistry/staff/person _» an individual article_
…

As you’d have the department name in the section name, you’d also know where you are on any given page and therefore be able to derive the backlink to the next level above. At the individual article level you should be able to derive the backlink anyway from the categories assigned to it?

Of course, this whole suggestion depends on the departments section not requiring much in the way of sub-pages. If the minus sign is a problem, you could always use htaccess to rewrite it from a slash to a minus behind the scenes. Also there may be a way of using a mini-plugin that hooks into the url handling to consider /department/department-name as one section. There’s a callback for that which Oleg showed me once for manipulating the incoming url parts when experimenting with a language component in the url.


TXP Builders – finely-crafted code, design and txp

Offline

#14 2020-01-07 16:45:42

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

Re: Breadcrumbs on 4.8 beta

colak wrote #320896:

I guess, that the breadcrumbs solution above, is sufficient for this thread

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

<body>
    <header>
        <txp:section link title />
        <txp:if_individual_article>
            <txp:category1 link title this_section wraptag="/ <+>" />
            <txp:if_article_category number="2">/
                <a href="<txp:section url /><txp:category1 wraptag="<+>/" /><txp:category2 wraptag="<+>/" />"><txp:category2 title /></a>
            </txp:if_article_category>
        <txp:else />
            <txp:variable name="c1" value='<txp:page_url type="2" />' />
            <txp:variable name="c2" value='<txp:page_url type="3" />' />

            <txp:if_variable name="c1" value>/
                <a href="<txp:section url /><txp:variable name="c1" />/"><txp:category name='<txp:variable name="c1" />' title /></a>
            </txp:if_variable>
            <txp:if_variable name="c2" value>/
                <a href="<txp:section url /><txp:variable name="c1" />/<txp:variable name="c2" />/"><txp:category title /></a>
            </txp:if_variable>
        </txp:if_individual_article>
    </header>

    <!-- Main content -->
    <main>
        <txp:if_individual_article>
            <txp:article />
        <txp:else />
            <txp:article match="Category1=2, Category2=3" form="article_listing" />
        </txp:if_individual_article>
    </main>
</body>

I’m still trying to solve the issue here.

one thing at a time :-)

Offline

#15 2020-01-07 16:57:09

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

Re: Breadcrumbs on 4.8 beta

jakob wrote #320902:

I know this doesn’t answer your (interesting) question but I wonder if you can simplify your task by making /departments/chemistry/ the section, i.e. both parts. You might need departments-chemistry for that in the backend. That might be tolerable if departments/ on its own has very few pages – for example just an overview. You’d them have:

Well that was just an example. In the case for my site it would mean creating a new section for every new project which will make the sustainability suffer. For uni sites, there are normally dedicated teams working on them. At NeMe, we are three part time people doing everything, and the site is just on me:(

The deeper type urls are very exciting and once we crack how they work, they will become indispensable!


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-07 17:05:47

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 3,933
Website

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: 8,269
Website

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.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

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

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

Re: Breadcrumbs on 4.8 beta

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


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-07 22:05:17

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

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: 8,269
Website

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.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

Board footer

Powered by FluxBB