Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2006-02-28 05:54:15
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Anyone ever made a glossary?
I’m building a site that needs to have a glossary of terms that could potentially become lengthy. Anyone have ideas of how to do this under a “glossary” section with relative ease? The only way I can think of is making 26 articles, one for each letter in the alphabet. But this seems messy to me still for some reason. Any more ideas?
Offline
#2 2006-02-28 06:06:10
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: Anyone ever made a glossary?
One problem of doing it this way (the 26 articles method) is that it would require two separate permalink modes in one site: the “News” section will require /yyyy/mm/dd/title
, while the Glossary would require /section/title
. Since two permanent link modes isn’t possible, 26 categories? {edit: any bets as to how long until some crappy web-2-point-oh company adopts that as its name?}
- News
example.com/yyyy/mm/dd/title-01
example.com/yyyy/mm/dd/title-02
example.com/yyyy/mm/dd/title-03
- …
- Glossary
example.com/glossary/a
example.com/glossary/b
example.com/glossary/c
- …or…
example.com/glossary/?a
example.com/glossary/?b
- etc…
I’m too lazy and it’s too late for me to think this through, so I’m looking for handouts.
Last edited by Andrew (2006-02-28 06:15:02)
Offline
#3 2006-02-28 23:54:00
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: Anyone ever made a glossary?
The nck_olm plugin adds new tab to your Textpattern admin interface and allows you to override permanent link mode for each section. Permanent links to articles of selected sections will be generated (by txp:permlink tag) according to selected modes. Generated URLs will be handled properly without additional plugins.
Offline
#4 2006-02-28 23:59:35
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: Anyone ever made a glossary?
Kick ass.
Offline
#5 2006-03-01 00:01:04
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: Anyone ever made a glossary?
I’ll let you know how it goes.
Offline
Re: Anyone ever made a glossary?
how did it go, andrew? and do you have a working version of nck_olm_v1.4. The textpattern.ru download version produces an error message when I import it (file possibly truncated).
an alternative approach might be to make each glossary term it’s own article and use if_different together with article_custom/chh_article_custom to list the glossary terms alphabetically. Adding a new glossary terms is then just a matter of writing a new article in section glossary.
TXP Builders – finely-crafted code, design and txp
Offline
#7 2006-03-20 16:36:50
- Andrew
- Plugin Author
- Registered: 2004-02-23
- Posts: 730
Re: Anyone ever made a glossary?
It worked well actually. I used a “glossary” section with a different article for each letter, using the letter as the title, in combination with nck_olm for url management.
But after all that I opted for one article titled “Glossary Terms” with a subnav that anchor down to the letter subheaders. For two reasons: 1) the site structure still isn’t solidified and this is less work for now and 2) because I don’t think I’ll have enough terms to fill 26 articles. One really long page is better that 12 empty pages imo.
Oh… and I’m not sure if this’ll work, but here’s nck_olm (v1.4):
<pre>YToxMjp7czo0OiJuYW1lIjtzOjc6Im5ja19vbG0iO3M6Njoic3RhdHVzIjtzOjE6IjEiO3M6NjoiYXV0aG9yIjtzOjU6Im5pY2NrIjtzOjEwOiJhdXRob3JfdXJpIjtzOjI3OiJtYWlsdG86bmljY2sub2xheUBnbWFpbC5jb20iO3M6NzoidmVyc2lvbiI7czozOiIxLjQiO3M6MTE6ImRlc2NyaXB0aW9uIjtzOjQxOiJPdmVycmlkZSBwZXJtYW5lbnQgbGluayBtb2RlIGZvciBzZWN0aW9ucyI7czo0OiJoZWxwIjtzOjQ5NjA6Igo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgpkaXYudmlzIHsgZGlzcGxheTogYmxvY2s7IH0KLmpzIC5pbnYgeyBkaXNwbGF5OiBub25lOyB9Cjwvc3R5bGU+CjxzY3JpcHQgdHlwZT0idGV4dC9qYXZhc2NyaXB0Ij4KZG9jdW1lbnQuYm9keS5jbGFzc05hbWUgPSAnanMnOwpmdW5jdGlvbiBydSgpIHsKICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnZW4nKS5jbGFzc05hbWUgPSAiaW52IjsKICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnZ2V0cnUnKS5jbGFzc05hbWUgPSAiaW52IjsKICBkb2N1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ZXApCnsKICAgIGdsb2JhbCAkcGVybWxpbmtfbW9kZSwgJG5ja19vbG1fcHJlZnMsICRuY2tfb2xtOwoKICAgIGlmICgnbmNrX29sbScgIT0gJGV2ZW50KSByZXR1cm47CgogICAgaWYgKCJzYXZlIiA9PSAkc3RlcCkgLy8gZm9ybSBzdWJtaXRlZCwgc2F2ZSBidXR0b24gcHJlc3NlZAogICAgewogICAgICAgIC8vIGdldCBzZWN0aW9uIG5hbWVzCiAgICAgICAgJHJzID0gc2FmZV9jb2x1bW4oJ25hbWUnLCAndHhwX3NlY3Rpb24nLCAibmFtZSAhPSAnZGVmYXVsdCcgb3JkZXIgYnkgbmFtZSIpOwoKICAgICAgICAvLyByZWRlZmluZSBwcmVyZWZlbmNlcwogICAgICAgIGZvcmVhY2ggKCRycyBhcyAkdmFsKSAvLyBmb3IgZWFjaCBzZWN0aW9uCiAgICAgICAgaWYgKCRyc1skdmFsXT1wcygkdmFsKSAvLyBpZiBtb2RlIHBvc3RlZAogICAgICAgICAgICBhbmQgKCRwZXJtbGlua19tb2RlID09ICRuY2tfb2xtX3ByZWZzWyR2YWxdPSRyc1skdmFsXSkgKSAvLyBzZXQgbW9kZSBhbmQgaWYgaXQgZGVmYXVsdAogICAgICAgICAgICAgICAgdW5zZXQoJG5ja19vbG1fcHJlZnNbJHZhbF0pOyAgICAgICAgICAgICAgICAgICAgICAgICAvLyB1bnNldCBpdCBiYWNrCgogICAgICAgICR2YWwgPSBzZXJpYWxpemUoJG5ja19vbG1fcHJlZnMpOwogICAgICAgICRsZW4gPSBzdHJsZW4oJHZhbCk7CgogICAgICAgIGlmICgkbGVuIDwgMjU2KQogICAgICAgIHsKICAgICAgICAgICAgLy8gc2F2ZSBwcmVmZXJlbmNlcyB0byBkYgogICAgICAgICAgICAkcnMgPSBzYWZlX3VwZGF0ZSgKICAgICAgICAgICAgICAgICJ0eHBfcHJlZnMiLAogICAgICAgICAgICAgICAgInZhbCA9ICckdmFsJyIsCiAgICAgICAgICAgICAgICAibmFtZSA9ICduY2tfb2xtX3ByZWZzJyIKICAgICAgICAgICAgKTsKICAgICAgICAgICAgaWYgKCEkcnMpICRuY2tfb2xtWydlcnInXSA9ICJ1cGRhdGUiOwogICAgICAgICAgICBlbHNlICRzdGF0ID0gdGFnKGdUeHQoJ3ByZWZlcmVuY2VzX3NhdmVkJyksJ3NwYW4nLCIgdGl0bGU9JyRsZW4gYnl0ZXMgc2F2ZWQgfCAiLigyNTUtJGxlbikuIiBhdmFpbGFibGUnIik7CiAgICAgICAgfQogICAgICAgIGVsc2UKICAgICAgICB7CiAgICAgICAgICAgICRuY2tfb2xtWydlcnInXSA9ICJzaXplIjsKICAgICAgICB9CiAgICB9CgogICAgaWYgKGlzc2V0KCRuY2tfb2xtWydlcnInXSkpCiAgICB7CiAgICAgICAgc3dpdGNoICgkbmNrX29sbVsnZXJyJ10pCiAgICAgICAgewogICAgICAgICAgICBjYXNlICgnc2l6ZScpOgogICAgICAgICAgICAgICAgJHRpdGxlID0gIiB0aXRsZT1cIlByZWZlcmVuY2VzIHNpemUgdG9vIGJpZ1wiIjsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICgndXBkYXRlJyk6CiAgICAgICAgICAgICAgICAkdGl0bGUgPSAiIHRpdGxlPVwiQ2FuJ3QgdXBhZHRlIHByZWZlcmVuY2VzXCIiOwogICAgICAgICAgICAgICAgYnJlYWs7CiAgICAgICAgICAgIGNhc2UgKCdpbnNlcnQnKToKICAgICAgICAgICAgICAgICR0aXRsZSA9ICIgdGl0bGU9XCJDYW4ndCBjcmVhdGUgcHJlZmVyZW5jZXNcIiI7CiAgICAgICAgfQogICAgICAgICRzdGF0ID0gdGFnKGdUeHQoJ25vdF9zYXZlZCcpLCdzcGFuJywnIHN0eWxlPSJjb2xvcjpyZWQiJy4kdGl0bGUpOwogICAgfQogICAgZWxzZSBpZiAoIWlzc2V0KCRzdGF0KSkgJHN0YXQgPSAnJzsKCiAgICAvLyBkaXNwbGF5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c2UgLy8gbm90IG92ZXJyaWRlZCBzZWN0aW9ucwogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAkY3VyID0gJHBlcm1saW5rX21vZGU7CiAgICAgICAgICAgICAgICAkYXR0ciA9ICcgc3R5bGU9ImNvbG9yOiNjY2MiJzsgLy8gZ3JleSBvdXQKICAgICAgICAgICAgfQogICAgICAgICAgICAkdGl0bGUgPSAoJHRpdGxlID09ICRuYW1lKSA/ICcnIDogIiB0aXRsZT1cIiR0aXRsZVwiIjsKICAgICAgICAgICAgJGZzW10gPSB0cigKICAgICAgICAgICAgICAgIHRkYSgkbmFtZSwkYXR0ci4kdGl0bGUpLgogICAgICAgICAgICAgICAgdGRhKHBlcm1saW5rbW9kZXMoJG5hbWUsJGN1ciksICRhdHRyKQogICAgICAgICAgICApOwogICAgICAgIH0KICAgICAgICAkZnNbXSA9IHRyKAogICAgICAgICAgICB0ZGEoCiAgICAgICAgICAgICAgICBmSW5wdXQoInN1Ym1pdCIsICJzYXZlX2J1dHRvbl9zdWJtaXQiLCBnVHh0KCdzYXZlX2J1dHRvbicpLCAicHVibGlzaCIpLAogICAgICAgICAgICAgICAgJyBjb2xzcGFuPSIyIiBjbGFzcz0ibm9saW5lIicKICAgICAgICAgICAgKQogICAgICAgICk7CiAgICAgICAgJGZzW10gPSBlbmRUYWJsZSgpOwogICAgfQoKICAgIC8vIFRoZSBlSW5wdXQvc0lucHV0IHBhcnQgb2YgdGhlIGZvcm0gaXMgaW1wb3J0YW50LCBzZXR0aW5nIHRoZSBldmVudCBhbmQgc3RlcCByZXNwZWN0aXZlbHkKICAgIGVjaG8gZm9ybSgKICAgICAgICBqb2luKCJcbiIsICRmcykuCiAgICAgICAgZUlucHV0KCJuY2tfb2xtIikuc0lucHV0KCJzYXZlIikKICAgICAgICAsIiBzdHlsZT0ndGV4dC1hbGlnbjpjZW50ZXInIgogICAgKTsKCiAgICBlY2hvIGdyYWYoIm5ja19vbG0gJiMxODM7ICIuJG5ja19vbG1bInZ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c3RybGVuKCR2YWwpOwoKICAgICAgICBpZiAoJGxlbiA8IDI1NikKICAgICAgICB7CiAgICAgICAgICAgIC8vIHNhdmUgcHJlZmVyZW5jZXMgdG8gZGIKICAgICAgICAgICAgJHJzID0gc2FmZV91cGRhdGUoCiAgICAgICAgICAgICAgICAidHhwX3ByZWZzIiwKICAgICAgICAgICAgICAgICJ2YWwgPSAnJHZhbCciLAogICAgICAgICAgICAgICAgIm5hbWUgPSAnbmNrX29sbV9wcmVmcyciCiAgICAgICAgICAgICk7CiAgICAgICAgICAgIGlmICghJHJzKSAkbmNrX29sbVsnZXJyJ10gPSAidXBkYXRlIjsKICAgICAgICAgICAgZWxzZSAkc3RhdCA9IHRhZyhnVHh0KCdwcmVmZXJlbmNlc19zYXZlZCcpLCdzcGFuJywiIHRpdGxlPSckbGVuIGJ5dGVzIHNhdmVkIHwgIi4oMjU1LSRsZW4pLiIgYXZhaWxhYmxlJyIpOwogICAgICAgIH0KICAgICAgICBlbHNlCiAgICAgICAgewogICAgICAgICAgICAkbmNrX29sbVsnZXJyJ10gPSAic2l6ZSI7CiAgICAgICAgfQogICAgfQoKICAgIGlmIChpc3NldCgkbmNrX29sbVsnZXJyJ10pKQogICAgewogICAgICAgIHN3aXRjaCAoJG5ja19vbG1bJ2VyciddKQogICAgICAgIHsKICAgICAgICAgICAgY2FzZSAoJ3NpemUnKToKICAgICAgICAgICAgICAgICR0aXRsZSA9ICIgdGl0bGU9XCJQcmVmZXJlbmNlcyBzaXplIHRvbyBiaWdcIiI7CiAgICAgICAgICAgICAgICBicmVhazsKICAgICAgICAgICAgY2FzZSAoJ3VwZGF0ZScpOgogICAgICAgICAgICAgICAgJHRpdGxlID0gIiB0aXRsZT1cIkNhbid0IHVwYWR0ZSBwcmVmZXJlbmNlc1wiIjsKICAgICAgICAgICAgICAgIGJyZWFrOwogICAgICAgICAgICBjYXNlICgnaW5zZXJ0Jyk6CiAgICAgICAgICAgICAgICAkdGl0bGUgPSAiIHRpdGxlPVw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AgICAgICAgIGlmIChpc3NldCgkbmNrX29sbV9wcmVmc1skbmFtZV0pKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICAkY3VyID0gJG5ja19vbG1fcHJlZnNbJG5hbWVdOwogICAgICAgICAgICAgICAgJGF0dHIgPSAnIHN0eWxlPSJiYWNrZ3JvdW5kOiNmY2ZjZmMiJzsKICAgICAgICAgICAgfQogICAgICAgICAgICBlbHNlIC8vIG5vdCBvdmVycmlkZWQgc2VjdGlvbnMKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgJGN1ciA9ICRwZXJtbGlua19tb2RlOwogICAgICAgICAgICAgICAgJGF0dHIgPSAnIHN0eWxlPSJjb2xvcjojY2NjIic7IC8vIGdyZXkgb3V0CiAgICAgICAgICAgIH0KICAgICAgICAgICAgJHRpdGxlID0gKCR0aXRsZSA9PSAkbmFtZSkgPyAnJyA6ICIgdGl0bGU9XCIkdGl0bGVcIiI7CiAgICAgICAgICAgICRmc1tdID0gdHIoCiAgICAgICAgICAgICAgICB0ZGEoJG5hbWUsJGF0dHIuJHRpdGxlKS4KICAgICAgICAgICAgICAgIHRkYShwZXJtbGlua21vZGVzKCRuYW1lLCRjdXIpLCAkYXR0cikKICAgICAgICAgICAgKTsKICAgICAgICB9CiAgICAgICAgJGZzW10gPSB0cigKICAgICAgICAgICAgdGRhKAogICAgICAgICAgICAgICAgZklucHV0KCJzdWJtaXQiLCAic2F2ZV9idXR0b25fc3VibWl0IiwgZ1R4dCgnc2F2ZV9idXR0b24nKSwgInB1Ymxpc2giKSwKICAgICAgICAgICAgICAgICcgY29sc3Bhbj0iMiIgY2xhc3M9Im5vbGluZSInCiAgICAgICAgICAgICkKICAgICAgICApOwogICAgICAgICRmc1tdID0gZW5kVGFibGUoKTsKICAgIH0KCiAgICAvLyBUaGUgZUlucHV0L3NJbnB1dCBwYXJ0IG9mIHRoZSBmb3JtIGlzIGltcG9ydGFudCwgc2V0dGluZyB0aGUgZXZlbnQgYW5kIHN0ZXAgcmVzcGVjdGl2ZWx5CiAgICBlY2hvIGZvcm0oCiAgICAgICAgam9pbigiXG4iLCAkZnMpLgogICAgICAgIGVJbnB1dCgibmNrX29sbSIpLnNJbnB1dCgic2F2ZSIpCiAgICAgICAgLCIgc3R5bGU9J3RleHQtYWxpZ246Y2VudGVyJyIKICAgICk7CgogICAgZWNobyBncmFmKCJuY2tfb2xtICYjMTgzOyAiLiRuY2tfb2xtWyJ2ZXIiXSk7CiAgICBlY2hvICI8L2Rpdj4iOwoKfSAvLyBuY2tfb2xtX2FkbSgpCiI7czo4OiJjb2RlX21kNSI7czozMjoiMzAzZDcyYmZhMGI2NzgwYTRlOTUzNWM2YzEzYWQ0M2QiO3M6NDoidHlwZSI7czoxOiIxIjtzOjM6Im1kNSI7czozMjoiMzAzZDcyYmZhMGI2NzgwYTRlOTUzNWM2YzEzYWQ0M2QiO30=</pre>
Last edited by Andrew (2006-03-20 16:37:42)
Offline
Re: Anyone ever made a glossary?
thanks andrew. Yes, it worked!
TXP Builders – finely-crafted code, design and txp
Offline
Pages: 1