Textpattern Forum

You are not logged in. Register | Login | Help

#51 2009-04-01 16:10:16

danwoodward
Member
From: Brooklyn NY
Registered: 2006-08-06
Posts: 51
Website

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

For some reason I can’t get this plugin to work for me.

I am trying to use the tags conditional in file form called from a file list tag to see if a tag has been applied to a certain file.

<txp:file_download_list form="files" category="mycat" />

The File Form

DESC:<txp:file_download_description />
Cat:<txp:file_download_category title="1"   />
FILE: <txp:site_url />files/<txp:file_download_name />
Downloadable:
    <txp:smd_if_tag type="file" name="download">
       1
    <txp:else/>
       0
    </txp:smd_if_tag>

I’ve looked at my debug console and its returning all my files that have the tag of “download” as false

<txp:smd_if_tag type="file" name="download">
 [SQL (0.00116991996765): show columns from smd_tags]
 [<txp:smd_if_tag type="file" name="download">: false]
</txp:smd_if_tag>

I’m kind of at a loss, anyone have a ideas? Thanks!

Last edited by danwoodward (2009-04-01 16:10:47)

Offline

#52 2009-04-01 16:53:17

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,713
Website

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

danwoodward wrote:

I am trying to use the tags conditional in file form called from a file list tag to see if a tag has been applied to a certain file.

OK, right. This is one of those things that I didn’t consider and will have to address. Currently, smd_if_tag can only be used inside an smd_tag_list; and this is foolishly missing from the half-assed documentation. It’s largely due to the plugin structure and the way I set about implementing it; I simply overlooked that you might want to check for the existence of an arbitrary tag. But since it’s so bloody obvious (d’oh!) I’ll see about making it happen for you.

In the meantime you can cheat a little and do this:

<txp:smd_tag_list break="" wraptag="">
  <txp:smd_if_tag type="file" name="download">Downloadable</txp:smd_if_tag>
</txp:smd_tag_list>

The break and wraptag just fool the tag into not outputting anything (since it’s bound to find other tags and you don’t want to see them). The conditional then looks at each tag in turn and shows ‘Downloadable’ if it finds that tag in the list.

It’s hackish and horrible, and I’ve just checked over the code for that tag (among others) and want to cry. The code is plain ugly. I have an idea that I can streamline this entire process quite a bit. Let me have a think about it tonight; if I find a few hours spare tomorrow I think I’m now motivated enough to fix this sucker.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#53 2009-04-02 18:11:55

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,713
Website

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

Just an update for those of you waiting on a less buggy version. As of today in my dev version:

  • TXP 4.0.7+ database warnings: fixed
  • non-messy URL rewriting: fixed
  • smd_if_tag: now correctly works outside smd_tag_list context
  • Textarea+ : allows new tags to be created on-the-fly from article/image/file/link tabs

Things on the roadmap, in no particular order:

  • Multi-tag filtering and checking: work on OR logic has begun; AND logic is still at the thinking stage
  • Global tags (across content types): mostly coded, but a few major problems left to iron out before it may hit the streets
  • Per-section/category tag counts
  • Tag cloud
  • Tag list pagination
  • Apply an active class to ‘current’ tag in list
  • List tags by linked category
  • Dumb down foreign characters in auto tag system
  • Admin-side tag find (live search)

I might release the current dev version as-is for now just to get everyone to a more stable platform, then build from there. Watch this space.

Last edited by Bloke (2009-04-02 18:13:32)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#54 2009-04-02 18:42:51

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 819
Website

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

Your mutterings are musical.

Offline

#55 2009-04-06 15:18:42

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

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

  • smd_if_tag: now correctly works outside smd_tag_list context
  • Multi-tag filtering and checking: work on OR logic has begun; AND logic is still at the thinking stage
  • Tag list pagination

Big ‘oh’ as in :-O. Sounds great.


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#56 2009-04-26 18:25:56

owenswain
Member
From: Canada
Registered: 2007-11-25
Posts: 27
Website

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

Stef, this is the perfect plugin for helping sort the many images I will have on my site. Both parts of the plugin are successfully installed now. Can you sense a question or a ‘but’ coming? If so you are correct and, here it is:

I have a basic understanding (i.e. if I see it or something like it I can copy it but I cannot write code from scratch) of how textpattern works. What I need to be able to do is call a list of the Image Tags on my default Page in the same way that say a Category List is displayed.

I did my best to read through the smd_tags (Client side) page in the Admin

I have guessed at this: <txp:smd_tag_list break="li" wraptag="ul" type="image" section="image" exclude="articles" active_class="active" /> While my Tag names show where I expect them too are not linked and the following message on the default Page Textpattern Notice: Unknown tag attribute: section...

I tried the same line of code with section="images" but that failed too.

My images in question are loaded to the Content / Images admin page and all load properly on the default Page and link properly in the Categories List in the sidebar.

Perhaps I need to create a Form? or do something different?

Here is my blog link http://onionboy.ca/blog/ and here is the anchor location on the page where I am trying to create a list of smd tags http://onionboy.ca/blog/#images

Thanks.

Offline

#57 2009-04-26 18:40:32

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,713
Website

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

owenswain wrote:

this is the perfect plugin for helping sort the many images I will have on my site.

Except, sadly, it isn’t :-( You see, images are second-class citizens in Textpattern (at present). Whereas articles, files and links get their own _list tags, images don’t. Well, there’s image_index and image_display, but they’re a bit pants. So at the moment, image support in smd_tags is experimental and requires a hack to the core code in order for it to work. If you’re happy doing that, let me know via e-mail and I’ll see if I can find my patch and check it works for TXP 4.0.8, then talk you through the changes. If not then I’m afraid this plugin is not going to help much until images are treated a little better in TXP.

Textpattern Notice: Unknown tag attribute: section...

You see this message for two reasons:

  1. version 0.12 of smd_tags is brain damaged. Although I haven’t tracked down every bug mentioned in this thread, I may actually release smd_tags 0.2 for now and patch the rest later
  2. there’s no concept of a ‘section’ for images to reside in. The same way there’s no ‘section’ for links or files — they’re just files and links that can be displayed within an article flow, in any section

So the ‘section’ attribute is only of use for article tags. I should probably make that clearer in the documentation, sorry.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#58 2009-04-26 19:23:20

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 5,713
Website

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

OK, have at it. Please try out v0.2 of the plugin. Download it from the beta page

There are a couple of issues as yet unresolved (the one woof mentioned about the broken parent/sublevel is one such beast). Got my hands full at the moment, but I’ll try and fix that and tend to the other new features I promised a few posts ago as soon as I can. Please continue to report anything you find — good and bad — here. Thanks for your patience.


The smd plugin menagerie — for when you need one more gribble of power from Textpattern.

Txp Builders – finely-crafted code, design and Txp

Offline

#59 2009-04-28 02:39:45

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 819
Website

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

I upgraded to v0.2 of the admin and client side plugins, and I wanted to report my results:

Using this ‘Tags List’ code block in my tags section, I’m still observing the same behavior I described here: The tags section will output a list of tags, but clicking on a specific tag leads to 404— even though the URL is constructed correctly according to the scheme you described.

Still running TXP 4.0.8 stable.

Please don’t take this as a complaint, sir! Outputting a list of related articles by tag still works perfectly, as does showing a list of tags for a specific article (as long as I don’t use the link attribute). The only problem is with tag navigation, which I’m in no dire need of at this time.

Thanks!

Offline

#60 2009-04-28 02:52:07

johnstephens
Plugin Author
From: Harrisonburg, VA
Registered: 2008-06-01
Posts: 819
Website

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

johnstephens wrote:

Outputting a list of related articles by tag still works perfectly, as does showing a list of tags for a specific article (as long as I don’t use the link attribute).

I think I spoke too soon— I have asy_jpcache on this site, and I think I was looking at a cached version.

  • smd_related_tags works perfectly, as I said.
  • But my tag list on an individual article is not displaying at all with the new version of the plugin. Here’s my code:
<txp:smd_if_tag name="">
		<txp:else />
		<tr>
			<th>Tags</th>
			<td>
				<txp:smd_tag_list class="">
					<txp:smd_tag_name title="1" />
				</txp:smd_tag_list>
			</td>
		</tr>
</txp:smd_if_tag>

The tag trace is telling me that [<txp:smd_if_tag name="">: true], but with the version v0.11 it returned false for tagged articles.

Hmmm.

Rolled back to smd_tags_admin v0.11 and smd_tags_client v0.1 (with the same edit I used before), and got my tags list back.

Last edited by johnstephens (2009-04-28 03:06:00)

Offline

Board footer

Powered by FluxBB