You are not logged in.
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
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
Online
Just an update for those of you waiting on a less buggy version. As of today in my dev version:
Things on the roadmap, in no particular order:
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
Online
Your mutterings are musical.
Offline
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
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
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:
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
Online
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
Online
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
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
linkattribute).
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.<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