Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#541 2025-01-26 21:44:45
Re: smd_tags: unlimited article, image, file and link taxonomy
Deleting (or renaming) /lib/i18n-ascii.txt
file might partly help here.
Offline
#542 2025-01-28 18:27:39
Re: smd_tags: unlimited article, image, file and link taxonomy
It seems to have worked. With the overrides, I was able to adapt the pages to the look and behavior provided by tru_tags
.
The first tricky moment was that smd_tags
showed all available tags, not just those related to the current language. So I had to reorganize the tag structure. Put tags with the name of the language on the first level, and put the corresponding tags inside them.
Build tag lists using the parent attribute <txp:smd_tag_list parent="LC”>
Of course, I didn’t want to manually configure everything, so I added the line $smd_tags_import_tag_parent = doSlash($row['l10n_lang']);
to smd_tags_import()
which defined the parent for the tag as a short language code.
The next trick was with tag names that were translated into Latin characters. This was done using the sanitizeForUrl()
function, which we decided to remove. This allowed us to display tag lists in the same way as tru_tags
did. Next is the landing page that shows the articles for the selected tag.
Here I was waiting for the next 2 tricks. Moreover, they worked in pairs, driving me crazy in fixing this issue. Firstly, as it turned out, I needed to decode the tag names from the URL, and secondly, I needed to correctly update the request URI after processing the tag.
For decoding, I used rawurldecode()
, but if you want to support google notation with plus spaces, you need to change it to urldecode()
.
Refreshing the request URI broke everything because the first segment of the URI is the language code (according to best practices) and the plugin code built the URI again by inserting only one segment at first. I decided that it would be more correct to simply remove the segments from the end. This solution will work equally on regular and multilingual sites.
After this update, the landing page and the selection of articles by tag started working. The only known problem was the sorting of tags in the list. Even though the database had the utf8mb4_unicode_ci
setting, it was sorting incorrectly.
I thoroughly inspected the plugin code and found one place where the array was sorted. So I simply added the SORT_LOCALE_STRING
modifier to sort based on the localization setting and everything worked!
Now everything seems to work as expected. I like this plugin for its administration capabilities, architecture, and performance. I also like the ability to communicate with the solution owner. Stef, it’s a pleasure to deal with you!
PS: pls, give me 5 minutes and I’ll open a pull request with updates
Offline
#543 2025-01-29 11:51:13
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,313
Re: smd_tags: unlimited article, image, file and link taxonomy
could somebody help me to replace this rss_unlimited_categories code with smd_tags code?
i just can’t myself.
<txp:rss_uc_filedunder linked="1" parent="inimene,sumptomid" delim="/" />
it displays list of categries i associate with article
Offline
#544 2025-01-30 16:10:03
Re: smd_tags: unlimited article, image, file and link taxonomy
The tag list, when not in a selector but a list, looks sad on a dark theme.
Don’t we want to tweak it? Like, to this state or something…..
The tooltip on a dark theme is completely useless.
Offline
#545 2025-01-30 16:58:53
Re: smd_tags: unlimited article, image, file and link taxonomy
spiridon wrote #338968:
The tag list, when not in a selector but a list, looks sad on a dark theme.
Don’t we want to tweak it?
Yes! This plugin predates dark mode by a few years and hasn’t caught up.
The tooltip on a dark theme is completely useless.
The tooltip overall is useless, imo, and isn’t accessible at all. I’m tempted to ditch it. I can’t even remember why it’s there, besides really annoying me. But if you think it has value and want to have a go at taming the styles, please be my guest.
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
#546 2025-01-30 18:16:05
Re: smd_tags: unlimited article, image, file and link taxonomy
Gallex wrote #338960:
could somebody help me to replace this rss_unlimited_categories code with smd_tags code?
i just can’t myself.
<txp:rss_uc_filedunder linked="1" parent="inimene,sumptomid" delim="/" />...
it displays list of categries i associate with article
Have a look at the smd_tag_list. That should output the tags related to an article. It has a “parent” attribute, but I don’t know if you can specify multiple parents. If not, you could use the smd_tag_list twice with different parents. The tag has lots of other options, too.
I don’t know the rss_uc_filedunder
tag, but it looks like linked
and delim
have to do with how the url is output. With smd_tags, you can construct your own link schemes using smd_tag_name in your form or code contained in the tag. You need to make the links match the trigger word you’ve chosen in the url anyway.
BTW: I did try installing this version of rcc_unlimited_categories on a recent txp and php version, and while it throws a few notice errors in debug mode, it was showing the field on the Write panel and outputting category lists on the public side. I haven’t tested it in any detail, as I don’t have any sites set up with it, but it didn’t seem completely broken to me.
TXP Builders – finely-crafted code, design and txp
Offline
#547 2025-02-02 10:21:28
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,313
Re: smd_tags: unlimited article, image, file and link taxonomy
jakob wrote #338973:
BTW: I did try installing this version of rcc_unlimited_categories on a recent txp and php version, and while it throws a few notice errors in debug mode, it was showing the field on the Write panel and outputting category lists on the public side. I haven’t tested it in any detail, as I don’t have any sites set up with it, but it didn’t seem completely broken to me.
installed that version. i get those errors:
Deprecated: Optional parameter $event declared before required parameter $rs is implicitly treated as a required parameter in /www/apache/domains/www.4tuult.ee/htdocs/textpattern/plugins/rss_unlimited_categories/rss_unlimited_categories.php on line 622
Deprecated: Optional parameter $step declared before required parameter $rs is implicitly treated as a required parameter in /www/apache/domains/www.4tuult.ee/htdocs/textpattern/plugins/rss_unlimited_categories/rss_unlimited_categories.php on line 622
Deprecated: Optional parameter $event declared before required parameter $ids is implicitly treated as a required parameter in /www/apache/domains/www.4tuult.ee/htdocs/textpattern/plugins/rss_unlimited_categories/rss_unlimited_categories.php on line 635
Deprecated: Optional parameter $step declared before required parameter $ids is implicitly treated as a required parameter in /www/apache/domains/www.4tuult.ee/htdocs/textpattern/plugins/rss_unlimited_categories/rss_unlimited_categories.php on line 635
Deprecated: Optional parameter $event declared before required parameter $ids is implicitly treated as a required parameter in /www/apache/domains/www.4tuult.ee/htdocs/textpattern/plugins/rss_unlimited_categories/rss_unlimited_categories.php on line 643
Deprecated: Optional parameter $step declared before required parameter $ids is implicitly treated as a required parameter in /www/apache/domains/www.4tuult.ee/htdocs/textpattern/plugins/rss_unlimited_categories/rss_unlimited_categories.php on line 643
yes, it outputs the category list on public side, but no articles inside it when i click category link. empty page.
Offline
#548 2025-02-02 10:25:02
- Gallex
- Member
- Registered: 2006-10-08
- Posts: 1,313
Re: smd_tags: unlimited article, image, file and link taxonomy
jakob wrote #338973:
Have a look at the smd_tag_list. That should output the tags related to an article. It has a “parent” attribute, but I don’t know if you can specify multiple parents. If not, you could use the smd_tag_list twice with different parents. The tag has lots of other options, too.
i will
Offline