Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#385 2018-02-26 16:12:00

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

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

jayrope wrote #309451:

I sent you some flowers.

Awesome, received with thanks.

“smd_tag_title” as well as [smd_tag_clear] & [smd_tag_toggle], those last two without link to them.

Probably some language strings not loaded properly. Might be an issue with the 0.60 version, I’ll check, thanks for letting me know.


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

#386 2018-02-26 16:55:25

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

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

Add-on: A tag error shows up as well in debug mode on my trigger page:

Tag error: <txp:smd_related_tags section="music" type="article" match="tag_name" wraptag="ul" break="li" /> ->  Textpattern Error: Unknown column 'position' in 'field list' while parsing form sitemap_results_2 on page default
textpattern/lib/txplib_db.php:409 trigger_error()
textpattern/lib/txplib_db.php:1096 safe_query()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:3921 getRows()
smd_related_tags()
textpattern/vendors/Textpattern/Tag/Registry.php:83 call_user_func()
textpattern/lib/txplib_publish.php:514 Textpattern\Tag\Registry->process()
textpattern/lib/txplib_publish.php:463 processTags()
textpattern/lib/txplib_misc.php(1782) : eval()'d code:3522 parse()
smd_if_tag()
textpattern/vendors/Textpattern/Tag/Registry.php:83 call_user_func()

Last edited by jayrope (2018-02-26 16:57:07)


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

Offline

#387 2018-02-26 17:26:18

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

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

jayrope wrote #309454:

Add-on: A tag error shows up as well in debug mode on my trigger page:

Argh! I forgot about that, sorry. I should update my site to use the patched version. I’ll do that (EDIT: updated).

That might be why things aren’t going your way. But anyway, here’s how I set things up in my test environment after applying the error-free plugin to the site (and installing the textpack without its “@#language en” line. For some reason, the pack didn’t get installed properly during installation. I’ll fix that too. EDIT: fixed in above download).

Sections:
  • articles, default, filter
Pages:
  • default (assigned to section: default)
  • tag_results (assigned to section: filter)
Articles:
  • A bunch of articles containing band names or artists. Prodigy, Chemical Brothers, LeAnn Rimes, Dumpy’s Rusty Nuts, etc. Each band was assigned tags from the following list:
Tags:
  • Artist
  • Band
  • Country
  • Dance
  • Easy listening
  • Rock

I didn’t bother categorising the tags or setting up a hierarchy for now.

I changed one smd_tags pref:

  • Trigger(s) for tag lists = filter

In my tag_results Page:

<html>
<head>
<title>Music tag list</title>
</head>
<body>
<txp:smd_if_tag_list>
  <txp:smd_tag_list>
    Other articles with tag <txp:smd_tag_name title="1" link="1" />
    <txp:smd_tag_count />
    <txp:smd_related_tags section="articles" wraptag="ul" break="li" />
  </txp:smd_tag_list>
  Show <a href="<txp:site_url /><txp:section />">all tags</a>.
<txp:else />
  <h2>All tags</h2>
  <txp:smd_tag_list showall="1">
    <txp:smd_tag_name title="1" link="1" />
    <txp:smd_tag_count />
  </txp:smd_tag_list>
</txp:smd_if_tag_list>
</body>
</html>

In my default Form I have the usual <txp:body />, <txp:excerpt />, <txp:posted /> tags, but I ripped out the chunk where the category info was displayed and replaced it with:

        <txp:smd_if_tag>
           <txp:smd_tag_list>
              <txp:smd_tag_name link="1" /> <txp:smd_tag_count />
           </txp:smd_tag_list>
        </txp:smd_if_tag>

That’s it. Navigating to an article shows me a list of clickable tags it contains. Clicking one takes me to the /filter/article/<tagname> page which shows me the tag name and then a list of all articles that contain the tag. Clicking one of those articles takes me to the article in question, which shows its tags, and so on…

Just for a laugh, I also added a link at the bottom of the tags-with-articles list to show an ‘all tags’ list (which is handled by the ‘else’ portion of the code in the tag_results page).

All works swimmingly. Hope that helps get you going.

P.S. This has highlighted that:

a) The plugin documentation is bad and needs rewriting in the next version.
b) I need more examples in the docs, like the above.

Last edited by Bloke (2018-02-26 17:36:34)


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

#388 2018-02-27 10:39:50

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

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

Stef, i implemented your version exactly like you did and it still doesn’t work. The all tags list shows, but when clicking on a single tag i get no results – just like before.

I got the version i am using from your website, it says 0.60.
When i go to your github, though, i can see, that for txp 4.6.2 only 0.51 would work?
Is that correct?
Because i am using 0.60 on txp 4.6.2 and maybe that’s the reason for all error.
Also i see the textpack link for 0.60 but am unsure how to install this?

Thanx much, again!


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

Offline

#389 2018-02-27 10:59:39

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

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

jayrope wrote #309459:

it still doesn’t work. The all tags list shows, but when clicking on a single tag i get no results – just like before.

Hmmm. Odd. You changed the section attribute in the <txp:smd_related_tags> to match your music section, right?

I got the version i am using from your website, it says 0.60.

Download and install it again. I naughtily replaced it last night with the patched master version from GitHub.

Although it says it’s 4.6.2 compatible, v0.51 still had the ‘position’ issue so you’re no better off. I think 0.60 should be fine for you, but please check it’s installed correctly by flicking your site to debugging mode and checking you don’t get any nasty errors or warnings from the plugin.

The updated version should also fix your gTxt() strings. But if not, grab that Textpack from GitHub, open it in a text editor, remove the “@#language” line at the top, then copy and paste the entire contents into the textarea at the bottom of the Admin->Languages panel and upload them. That should fix 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

Offline

#390 2018-02-27 14:30:47

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

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

Stef, i installed your updated version of 0.60 over my version ( EDIT: Vanished extension preferences page and options menu have come back when i switch the plugin ON… ai ai ai ai.)

But in the current state it still refuses to show individual tags with articles assigned.

On the good side the articles, which were tagged before still show their tags in the frontend. And the textpack is installed now, looks much better. I will double check now, that i have implemented your suggestions well, and suppose i get back here if i did.

(Sorry to bother you again…)

Last edited by jayrope (2018-02-27 14:56:16)


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

Offline

#391 2018-02-27 17:43:57

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

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

Stef, i don’t find the error. Everything looks like you proposed to me.

Could it be, that some mechanism doesn’t work on an https connection?
And: I’m on a Litespeed server, not running Apache…

I feel almost tempted to post diagnostics, and i know you guys are busy with 4.7.0 for sure…

anyway here it is/low resolution:

Textpattern version: 4.6.2 (bfa46b9ca53321b86032998cc23950ab)
Last update: 2018-02-19 12:17:11/2018-02-19 12:04:44
...
Article URL pattern: title_only
Temporary directory path: /tmp
Site URL: ...
PHP version: 5.4.45
GD Graphics Library: bundled (2.1.0 compatible); supported formats: GIF, JPG, PNG.
Server TZ: Europe/Moscow
Server local time: 2018-02-27 20:45:18
Daylight Saving Time enabled?: 0
Automatically adjust Daylight Saving Time setting?: 0
Time zone (GMT offset in seconds): Europe/Berlin (+3600)
MySQL: 5.5.5-10.1.30-MariaDB
Database server time: 2018-02-27 11:45:18
Database server time offset: 0 s
Database server timezone: SYSTEM
Database session timezone: SYSTEM
Locale: en_GB.UTF-8
Server: LiteSpeed
PHP server API: litespeed
RFC 2616 headers: 
Server OS: Linux 3.10.0-714.10.2.lve1.4.77.el7.x86_64
Active plugins: cbe_frontauth-0.9.7m, smd_query-0.50, smd_multi_choice-0.20, adi_gps-0.4, rah_replace-0.4.2m, rah_repeat-1.0.1, adi_matrix-2.1beta2, oui_player-1.3.1, etc_search-0.9.5, smd_tabber-0.11, yab_cf_article_list-0.2, glz_custom_fields-1.5.0, smd_user_manager-0.21, smd_tags-0.60
Admin-side theme: hiveneutral 4.6.2

Pre-flight check: 
------------------------
Clean URLs are only supported on Apache, use at your own risk.
/home/kliklak/public_html/infra/textpattern/setup/ still exists
Some Textpattern files have been modified: 
	/home/kliklak/public_html/infra/textpattern/textpattern.js
------------------------

.htaccess file contents: 
------------------------
#DirectoryIndex index.php index.html

#Options +FollowSymLinks
#Options -Indexes
SecFilterEngine Off
<IfModule mod_rewrite.c>
	RewriteEngine On
	#RewriteBase /relative/web/path/

	RewriteCond %{REQUEST_FILENAME} -f [OR]
	RewriteCond %{REQUEST_FILENAME} -d
	RewriteRule ^(.+) - [PT,L]

	RewriteCond %{REQUEST_URI} !=/favicon.ico
	RewriteRule ^(.*) index.php

	RewriteCond %{HTTP:Authorization}  !^$
	RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]
	RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

##php_value register_globals 0


EDIT: The only error in debugging mode is the missing article tag on the landing page, no errors in backend.

Last edited by jayrope (2018-02-27 23:39:44)


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

Offline

#392 2018-02-27 18:42:33

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

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

Can’t figure what could be going wrong. Would it be possible to have a publisher login so I can see if I can figure it out?


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

#393 2018-02-27 19:10:29

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, Stef, that’s very kind. I sent you a PM.


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

Offline

#394 2018-02-27 23:34:10

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

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

Thank you for the login. And the award for most obscure bug to track down on the planet goes to… me, probably.

For a panicked moment, I thought it wasn’t working because you were using a subdomain (and I thought I’d fixed that long ago). Thank goodness it wasn’t that.

Nope, the reason it was falling down was…

… deep breath…

you had an article in the same section as your tag result lists.

Remember in the first exchange I questioned why you’d done that and said it might not work? Well it doesn’t, I just found out for sure!

Thinking about it, I know why this happens. It’s to do with tag protection and (partly) poor coding on my part. Since you can use <txp:smd_tag_list> in multiple contexts so you can list tags on landing pages and also within articles, if it detects that an article is in use it blows away the tags found on the URL in deference to the ones it might find in the article. In this case of course, there are no tags in the article in the filter section, so you get no output.

In an ideal world, it would be able to handle both, but the plugin keeps track of the “tags I’ve found” in a single global variable, so there can be only one list. And if you have an article, it beats the URL and overwrites what it finds there. Articles always win.

Simply hiding (or better yet deleting) the article restored everything to full working order, and saved my sanity… just. So please delete that article at your leisure and wire up your in-article tag lists to point to the /filter page using the link attribute.

Job done.


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

#395 2018-02-27 23:49:30

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

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

Whew ha. I guess I had misunderstood you. I was just not using txp:article tags on the filter page. Didn’t realize the sheer existence of an an actual article assigned to the filter section would be a problem.

the plugin keeps track of the “tags I’ve found” in a single global variable, so there can be only one list.

I am secretly wishing already i could run several of those plugs, and creating several tag lists with different content. This is perfect ground for networking, cross-reference.

Stef, thank you very much. Now i can go network the heck out of that! It isn’t commercial, really, however I’ll send flowers soon again.

Last edited by jayrope (2018-02-27 23:50:24)


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

Offline

#396 2018-03-01 17:30:22

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

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

Stef, smd_tags is really an awesome idea. Bravo!

i found, that i can do sorting of related tags by custom fields and use those in a form to display addtional information
<txp:smd_related_tags sort="custom_1 asc, custom_2 asc" match="tag_title" form="sitemap_secondary" />

and form sitemap_secondary for instance like this:

<li class="left"><txp:if_different><txp:custom_field name="country" /><txp:else />"</txp:if_different></li> <li class="left"><txp:if_different><txp:custom_field name="city" /><txp:else />"</txp:if_different></li> <li><txp:permlink><txp:title /></txp:permlink></li>

That is super awesome!

Now i wonder (is that a feature request?) can one also establish sthg. like
<txp:smd_related_tags custom_2="Berlin" form="sitemap_secondary" />
? The version above at least doesn’t work, neither does
<txp:smd_related_tags city="Berlin" form="sitemap_secondary" />

Provided i can use a section to select output of smd_related_articles it just seems logical to go further.

So can i do this somehow already, or is this a feature request?


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

Offline

Board footer

Powered by FluxBB