Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#205 2008-08-25 13:18:24
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: smd_gallery: super-flexible gallery generator
Also, get rid of any tag faults that might be on your page, I see a superfluous "
and the rest of a tag />
, these can confuse the parsers.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#206 2008-08-25 14:36:53
- xzamen
- Member
- Registered: 2007-02-12
- Posts: 18
Re: smd_gallery: super-flexible gallery generator
uli, thank you so much! You were very helpful! asy_wondertag does the trick. Great.
Those superfluous characters were the result of incorrect tag nesting.
Now I think smd_gallery turns to something totally almighty :)
Offline
#207 2008-08-25 16:40:42
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: smd_gallery: super-flexible gallery generator
xzamen wrote:
TheNow I think smd_gallery turns to something totally almighty :)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#208 2008-08-25 20:51:59
- xzamen
- Member
- Registered: 2007-02-12
- Posts: 18
Re: smd_gallery: super-flexible gallery generator
This is a little offtopic, but do you know a good replacement of <txp:category_list type="image" />
for displaying a linked list of image categories? I need to exclude some cats and also apply formatting for nested cats. Usually such plugins work with article cats only…
Offline
#209 2008-08-25 22:00:12
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: smd_gallery: super-flexible gallery generator
I know about two plugins offering image category listing, upm_category_image and mah_lib_category_array. Have a look if one of them supports what you need.
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
#210 2008-08-27 23:03:32
- xzamen
- Member
- Registered: 2007-02-12
- Posts: 18
Re: smd_gallery: super-flexible gallery generator
Uli, thanks for the links. upm_category_image doesn’t seem to be able to do what I want and mah_lib_category_array is not a tag plugin. Right now I don’t want to dive into php for this and also it seems there’s no way to apply formatting for nested cats. So I stick to <txp:category_list type="image" />
for now.
Another question on smd_gallery if you don’t mind. How do I show all images, but exclude images that doesn’t belong to any category (empty)?
Last edited by xzamen (2008-08-27 23:40:27)
Offline
#211 2008-08-27 23:51:57
Re: smd_gallery: super-flexible gallery generator
xzamen wrote:
How do I exclude images that doesn’t belong to any category (empty)?
A very good question! If you use a category (any category) then it will automatically exclude them, but if you only want to show images in a gallery that are categorized I don’t think the plugin can do it… yet. I could (probably) add some special trigger that allowed you to include or exclude uncategorized images but for now the best I can offer is to use the conditional plugin smd_if. Your gallery tag:
<txp:smd_gallery form="only_cats" />
When no category
or id
attributes are specified, that tells the plugin to extract all images. Then in the only_cats
form:
<txp:smd_if field="NULL" operator="not" value="{category}">
// The category is NOT empty so put smd_gallery tags in here
</txp:smd_if>
I’ve not tested that, but it should work by checking if the {category}
is empty and skipping those records. I’ll add some native way of including/excluding uncategorized images on the ToDo list for the next revision. Thanks for spotting the problem!
Last edited by Bloke (2008-08-27 23:52:38)
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
Online
#212 2008-08-30 20:19:57
- xzamen
- Member
- Registered: 2007-02-12
- Posts: 18
Re: smd_gallery: super-flexible gallery generator
Bloke, thank you for your suggestion, but actually I found an easy way :)
I just put category=”!asdfg” where asdfg is non-existent category and it does the trick. It displays all images assigned to some cat and skips those without a cat. Great!
But a native way of including/excluding uncategorized images would be very useful!
Offline
#213 2008-08-30 20:59:19
Re: smd_gallery: super-flexible gallery generator
xzamen
Neat solution, thanks for sharing. I never even thought of (ab)using the attribute like that; excellent! I’ll certainly look into a way of making it less, umm, hacky in the next rev, though :-)
Last edited by Bloke (2008-08-30 20:59:48)
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
Online
#214 2008-09-01 06:34:56
- nardo
- Member
- From: tuvalahiti
- Registered: 2004-04-22
- Posts: 743
Re: smd_gallery: super-flexible gallery generator
anyone else get this?
am using custom field named “Showcase” to hold integers … calling that field like so:
<txp:smd_gallery id="?Showcase" form="smd_gallery" />
here is the form:
<a rel="lightbox[{category}]" href="{url}" alt="{alt}"
title="{title}" >
<txp:thumbnail id="{id}" />
</a>
there is output on screen… but each thumb is output 3 times! 5 integers, 15 thumbs displayed…
when outputting the images by a category name, behaviour is normal
PS in your first example in the docs there’s a width and height added to the anchor tag; shouldn’t be there right?
Offline
#215 2008-09-01 09:27:22
Re: smd_gallery: super-flexible gallery generator
nardo wrote:
each thumb is output 3 times! 5 integers, 15 thumbs displayed…
Nuts, a confirmed bug. In the process of fixing the problem highlighted by robin746 I broke the code for the situation you mention here. I’ll have to go back and rethink my SQL statement and see if I can come up with some way of fixing it for both scenarios. Thanks for letting me know about this.
In the meantime, if you roll back to v0.44 that should work as you expect. Just make sure you have your images in categories or it’ll not work!
PS in your first example in the docs there’s a width and height added to the anchor tag; shouldn’t be there right?
Correct, I thought I’d fixed that but I must have forgotten. Thanks for pointing it out, I’ll change 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
Online
#216 2008-09-03 08:35:12
- joel
- Member
- Registered: 2004-11-26
- Posts: 162
Re: smd_gallery: super-flexible gallery generator
Hello,
First of all, thanks for a great plugin (as usual with you Stef).
I have a small problem with wrapping p-tags around the gallery tag.
When I insert this
<txp:smd_gallery category="galleri" sublevel="all" form="gallerier" wraptag="div" />
I get p-tags wrapping the gallery’s div. The reason why I need the div is for clearing the floated thumbnails in case there are content below the thumbs.
Any ideas?
Thanks! :)
Offline