Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#493 2021-07-19 12:14:11

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,108
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

Nice one, thanks. Been on my list for a while to fix that. Using jquery seems neater.


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

#494 2022-03-24 14:23:23

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: smd_tags: unlimited article, image, file and link taxonomy

I’d like to import files and their tags into a completely new TXP install.
What’s the best way to do this?

Can i simply copy files and database tables smd_tags, smd_tags_cats and smd_tags_used and txp_file into the new site and that’s it?


A hole turned upside down is a dome, when there’s also gravity.

Offline

#495 2022-03-24 14:26:58

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,108
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

Never tried it but yes in theory. As long as the file IDs exactly match up – that’s what’s used to link the content to the tags in the database tables.


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

#496 2022-03-29 18:32:18

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: smd_tags: unlimited article, image, file and link taxonomy

Bloke wrote #332991:

Never tried it but yes in theory. As long as the file IDs exactly match up – that’s what’s used to link the content to the tags in the database tables.

Worked!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#497 2022-03-29 18:37:46

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: smd_tags: unlimited article, image, file and link taxonomy

I am tagging files – only files – and wonder:
How could i restrict the user to only be able to use max 10 of a much longer list of tags?

And a more complicated issue.
The file i am tagging are audio files. These are being random played. That’s easy for the whole pool, however my brain is blocked in seeing, how exactly i could select files of just one tag (or up to three) for random play.

Could somebody give me a roadmap? Although i use smd_tags every once in a while it has remained a mistery to me, how exactly it works. Could be aging. Thank you in advance!


A hole turned upside down is a dome, when there’s also gravity.

Offline

#498 2022-03-29 19:36:50

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,108
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

The second one is simpler to solve. Assuming you have a tag pool (<smd::tag_list>) set up in a section of your site, when you click on it you’ll get a URL of, say, example.com/tags/death-metal. So what you need to do on that page is detect if a tag is ‘in use’ (i.e. in the URL, compared to there being no tag, whereby you’ll display the entire linked tag list).

What you could do is show files that match the current tag (as displayed in the URL) and just use limit="3" sort="rand()" to pick 3 random files that have that tag.

<smd::if_tag_list>
   <smd::related_tags type="file" limit="3" sort="rand()">
      // Display stuff from your file
   </smd::related_tags>
</smd::if_tag_list>

The smd_related_tags defaults to matching tag_name, so it’ll find files that match the tag in the URL as you click one from your tag list.

Limiting tag selection is not something I’d considered so it’s not built in. At the moment you’d perhaps have to add some JS to the page to count the ones selected and hide the tag pool if a nominated limit had been reached. Alternatively, add a field text prompt to the tag pool to say that only the first N tags will be counted, and then only display 10 whenever you list them.

The label used in the plugin unfortunately predates the inline help text concept in core. When I next tweak the plugin a little, I’ll add that ability.


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

#499 2022-03-29 20:25:51

jayrope
Plugin Author
From: Berlin
Registered: 2006-07-06
Posts: 687
Website Mastodon

Re: smd_tags: unlimited article, image, file and link taxonomy

Thank you, Bloke. You’re invaluable. I go from there.

(Where is your music?)


A hole turned upside down is a dome, when there’s also gravity.

Offline

#500 2022-03-29 20:30:39

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,108
Website GitHub

Re: smd_tags: unlimited article, image, file and link taxonomy

I haven’t got any of my stuff up currently. I mainly produced/engineered stuff for other people anyway.

I’ve got an empty domain ready for it, but whether I make time to populate it with content and music remains to be seen!


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

Board footer

Powered by FluxBB