Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#21 2020-06-08 12:52:21

gaekwad
Admin
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 2,983

Re: Complex glossary index output... possible?

Bloke wrote #323615:

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

It appears to be 2400 seconds (40 minutes), I’ve just tweaked it up to 3600 seconds (1 hour). If bad stuff happens, we can flip it back.

Offline

#22 2020-06-08 13:05:41

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

Re: Complex glossary index output... possible?

gaekwad wrote #323626:

It appears to be 2400 seconds (40 minutes), I’ve just tweaked it up to 3600 seconds (1 hour).

Thank you. That’ll please long-formers like me.


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

#23 2020-06-08 14:01:57

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

Re: Complex glossary index output... possible?

Destry wrote #323622:

In relation to the original example

That’s a nice looking site. In terms of navigability, I’d be tempted to dim letters such as Q, Z and K in the alphabetic list at the top as they contain no terms. Maybe even make them unclickable, rather than click to find there are no terms. Oh, and I’d remove the duplicate ‘O’ :)

Either way, I intend on using the /titles only URL pattern

Remember, from 4.8.x you can use different permlink schemes for any section so you’re no longer limited to just one site-wide. If the glossary section suits /section/title or /breadcrumb/title better, use that. You can’t (yet) use custom schemes though, so inserting the letter as an extra navigable chunk is not possible.

[well, it is possible but you have to add any stuff after any content that Txp expects – this is what things like smd_access_keys does: adds crud after the URL for its own use. You can then use <txp:page_url> to get at these additional URL components and use them in your page.]

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…. The logic built into [Txp] tags now is profound and, in my opinion, often quite abstract. Too abstract for me, anyway.

The very programmery nature of Oleg’s solution and the need to understand XSLT a bit is the reason I suggested that core might be bale to help now in a more readily-understandable form.

Yes, things like <txp:evaluate> and the escape attribute need a bit of brain power but for this project I was more thinking of using shortcodes to output various chunks and plugging those into a regular <txp:article_custom> tags. Sorting the data in the second pass might be something that remains a plugin, as is iterating over comma-separated values. Txp can find and match on custom field lists but can’t (yet) iterate over them natively without a bit of trickery.

[side note: perhaps introduce container support such as the following. We’d need to factor in trimming internal values somehow, and how to grab the current value similar to the way <txp:yield> does for output_forms:

<txp:custom_field name="synonyms" separator=",">
    do some stuff here with 'current' value set to the iterable content item
</txp:custom_field>

]

With the ability to now filter by custom field directly from the URL you might even be able to turn this project on its head. Maybe write your articles and use a custom field to list the terms mentioned. Then use those to offer links back to the content from glossary items so it functions more like a combined glossary/index.

Dunno. That might be tricky, but it’s something I’d be keen to explore and see how far we can get with native tags. Building tables of contents is fairly easy. Building automated indexes is harder and would be something that would certainly set Txp apart if we could demonstrate a way of doing it!


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

#24 2020-06-15 06:45:35

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

Re: Complex glossary index output... possible?

Thank you, Bloke. I’m still working on getting some representative content together. Everything will probably be local for a while. But I will undoubtedly need to get back to this thread and some questions eventually.

Offline

Board footer

Powered by FluxBB