Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#11 2016-04-07 14:50:28

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,332
Website

Re: [revised aim] Glossary output with synonymous terms

jakob wrote #298541:

There are, of course, several solutions that do already exist:

I could probably think of a couple more if really hard pressed. But I think the goal would be to do this in the most simple way. We already have an explainer How do I manage static pages?

Bloke wrote #298530:

How do you envision this from a workflow perspective?

I think there are two use cases:

1) A Section where you want a page display like About where you don’t want or need individual articles beneath

2) A Section where you want to store something which you don’t want or need a section to appear at all

So that makes the wording tricky – and trickier still if you want them to default to Yes.

Section appears in site navigation? No Yes

Create individual article pages for articles in this section? No Yes

Something along those lines.

Offline

#12 2016-04-07 16:10:10

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

Re: [revised aim] Glossary output with synonymous terms

Hi Julian and Michael, I am using a slightly different method for section pages with just one article which works for me. The method described in the FAQ is slightly incomplete as it does not explain how to avoid duplicate urls caused by search results.

Face value I like Michael’s method in your second point but the search results page will again produce the url of the individual article.

The reason I wrote my thoughts above was not so much that I did not have it worked out but because I think that the current methodologies are confusing for some new users who are yet to fully familiarise themselves with the tags.

I also want to apologise to Destry here as I did not mean to highjack his thread.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#13 2020-04-02 13:05:24

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,537
Website

Re: [revised aim] Glossary output with synonymous terms

etc wrote #298509:

I don’t say it’s better, but you can

The CSF glossary was never realized (just as well), but I have a new personal glossary project for traditional woodworking, and I look forward to finally putting your solution to work. 👍

Offline

#14 2020-06-07 18:02:51

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,537
Website

Re: [revised aim] Glossary output with synonymous terms

etc wrote #298509:

I don’t say it’s better, but you can

Hi Oleg. I’m finally setting up the dev install for the glossary project and having another look at your tutorial. I have three questions before digging in.

First, you mention you used the ‘keywords’ field in your example. I will probably use a custom field labeled ‘synonyms’ as you also suggested. Do I need to change anything in the code examples you give if I’m not using the keywords field? It doesn’t appear to me that I do, but it might not be jumping out at me. I’m not familiar with this kind of syntax.

Second, I’m not sure what to do with (where to put) the second block of code that reorders the li items. Does that go in the page template where the index will be as a different header type? A form? Other?

Finally, your resulting list example does not separate terms by alphabetical sections, which I might want to do. I presume that’s possible by just repeating the list blocks somehow?

For example:

A

  • Article (see Automatic links)
  • Auto (see Automatic links)
  • Automatic links

B

  • Before/after 4.7 primer

C

  • Calendar (see Year 4.7)

Etc.

Offline

#15 2020-06-07 18:31:46

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,537
Website

Re: [revised aim] Glossary output with synonymous terms

Destry wrote #323594:

Second, I’m not sure what to do with (where to put) the second block of code that reorders the li items. Does that go in the page template where the index will be as a different header type? A form? Other?

Looking at this closer, I guess it just goes where the ul would be in each case.

I’ll see if I can get anywhere with it tomorrow.

Offline

#16 2020-06-07 18:57:01

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

Re: [revised aim] Glossary output with synonymous terms

Destry wrote #323594:

your resulting list example does not separate terms by alphabetical sections, which I might want to do.

If it was a native Txp solution, you would do that with <txp:if_different> comparing the first character of the term. If the xsl stylesheet can be teased into returning the first letter of the term, you may be able to do something similar there. I’m not an XSLT guru, unfortunately, but it does have a substring function.

That said, things have moved on a lot since 2016. I wonder if this can be realised in a core solution now with some <txp:article_custom> cleverness, iterating over the synonyms to build up the variable containing the entire list. Then maybe a custom shortcode to reorder the list and stuff it on the page wherever you need it: <txp::glossary />.

Not sure how easy that would be. I’d have to grok your setup a little better to figure out if we could do this more simply nowadays.


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

Online

#17 2020-06-08 10:22:49

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,537
Website

Re: [revised aim] Glossary output with synonymous terms

Fawk. Just wrote a detailed response. Session timed out. Browser didnt’ recover it. Nothing pisses me off more than having to rewrite detailed writing lost to web technology.

Is it really necessary to have such short session times? Or do I really have to use an external editor just to ensure forum post drafts are not lost?

/back to the editor/

Offline

#18 2020-06-08 10:41:37

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

Re: [revised aim] Glossary output with synonymous terms

Have a look at this thread too which discusses another way of alphabetising a list of articles using more core tags.


TXP Builders – finely-crafted code, design and txp

Offline

#19 2020-06-08 10:48:09

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

Re: [revised aim] Glossary output with synonymous terms

Destry wrote #323610:

Just wrote a detailed response. Session timed out… Is it really necessary to have such short session times?

Feel for you. I’ve stepped on that rake more than a few times. Now, before hitting Submit/Preview, I’ve actually taken to opening a fresh forum tab to see if I’m still logged in and, if not, logging in again then posting straight away. Annoying, but saves rage.

I think the session time’s something like 30-45 mins (a guess). Which is fine for short posts but if, like me, you start writing a post then go off and collect some more background info, get distracted by something shiny and come back to it, that time can easily be eaten.


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

Online

#20 2020-06-08 11:48:28

Destry
Member
From: Haut-Rhin
Registered: 2004-08-04
Posts: 4,537
Website

Re: [revised aim] Glossary output with synonymous terms

Bloke wrote #323615:

I think the session time’s something like 30-45 mins (a guess).

Yeah, that should be enough. I’ll have to remember to bump it with a preview click more often, I guess. Or draft in Writer, the always-sensible move.

Anyway, the rewrite, not as eloquent as before…

In relation to the original example, I’m roughly aiming for the home/glossary/article structure (all other design elements aside), and the synonymous terms handling, which I’ll come back to.

In my case, if I use that arrangement, the homepage would be the glossary project’s home and about page combined, with some visual pizazz to help give a sense of the site’s subject at a glance. The homepage would be like a book’s front and back jacket covers in purpose/function.

On the other hand, I’m also tempted to put the glossary on the homepage directly, and either a brief overview para at top of that or, more sensibly, use an article for About content and link to it from the footer, for example. But for the moment, the previous structure is on the table.

Either way, I intend on using the /titles only URL pattern (i.e. glossary.domain.tld/term), so how I handle About info wouldn’t make much difference (glossary.domain.tld/about). And if I can get away with using only the ‘default’ section/page/style for the whole site, and whatever forms, of course, I’d be happy.

I like how that site handles the synonymous terms in relation to primary terms. That was the main reason I pointed the site out as a glossary model. And the glossary terms list(s) also have to be ascending alphabetically (not by date, etc). Oleg seems to have captured both behaviours perfectly in his solution, though I’ve not got any further yet than installing the plugin.

[ADDED] I also like the breadcrumbs, but I’m not sure that would work in a sections-less site. If I did use them, I’d want to add the letter sections between ‘Glossary’ and the active term (e.g. Home/Glossary/A/Arsehole). Though that might not be important if the search and tagging features are strong enough. The example glossary linked above has about 210 entries. I don’t think I’ll have that many, but it’s not clear yet.

I’m happy using Oleg’s solution if it’s still considered contemporary enough for the long term. He has captured the synonyms behaviour and alphabetization of terms perfectly, as far as I can tell. But I am also happy using a native solution if it’s not so logically complex that my brains melt and run out my arse. I can maybe manage Oleg’s solution if I don’t have to do more than plug in the snippets, but their constituent syntax is beyond my level or desire to grock.

(Btw, I’ve checked my PHP extensions, and the ‘DOM’ extension — an etc_query requirement — is not listed in the .ini file(s) at all. Don’t know if it’s there by default in PHP 7 or not, or how I would add it, if needed. Also, the XPath link in the plugin docs is broken. Looks like ‘Schools’ updated it to this)

(Remember, I’m happily moving further away from web tech, not closer. If I retain what little I know in the next five years, it’ll be a wonder.)

Textpattern has really blossomed as of late, and that’s fantastic for a new generation, and the die-hards. The logic built into tags now is profound and, in my opinion, often quite abstract. Too abstract for me, anyway. The increasing number of attributes and values, with their symbolism and nuanced magic, seems increasingly geared to developer wavelengths. Sure, you ‘don’t have to know PHP’, but it’s almost a new kind of tag-based programming language to learn, beyond simple HTML. Combined with ‘yield’ and ‘variable’, I’m often puzzled by what others find fundamental. Either that or you stick with the foundational tags that work by themselves and run simple sites. Nothing wrong with simple sites. I like simple sites, front and back.

Maybe my glossary project turns into a general glossary theme so others like me without a dev gene can manage without having to hire anyone. If we can decide which is the easier path in that respect, I might consider putting that dry- prefix to use, or more appropriately, the pub-.

Last edited by Destry (2020-06-08 11:52:53)

Offline

Board footer

Powered by FluxBB