Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
bos_album
I put together a little plugin to create a simple collection of photo galleries (someone call it “album”…) with one tag.
29/12/2006: bos_album v.1.0beta
Important: To have this working you have to install and activate the new version of my old plugin bos_image_display v.0.45 or above. (note that old version 0.44 still remain at his place in his thread, because I can’t assure full compatibility: install the new version only if you want to try bos_album, but download and keep the old bos_image_display to revert it if needed. Let me know if something broke).
How does it work? Basically, it helps you deal with a two-level album, with a page that list all the galleries you have, and then the galleries with internal navigation and thumbs. This is done by one tag, to simplify the complicate usage of my old plugin, but at the moment you can only have this two-level structure.
Just create the category tree (one parent one-or-more children), and assign any image to the appropriate child category. Then place the bos_galleries
tag with his attributes in page template and you are done.
Some features:
- option to display or not the title
- option to display or not the caption, even textilized or not
- option to display a cover in the first-level page for each gallery.
- option to have a ‘next-previous-(up-at-the-end)’ list of link
- option to have a list of thumbnails for the navigation within the galleries
- option to have a counter navigation within the galleries
- actual picture in the navigation list with specific class to style a “you are here” thing.
- Breadcrumb automatically generated
- Big image linked to the next image in gallery for better usability (or it should)
- Sort of freedom in the layout of the galleries pages (first the image, or first the nav, or the path below, or the nav above, or the counter in your hair, etc)
- I don’t remember…
Caveats
If you have only one gallery, this plugin isn’t for you. The old bos_image_display should work. If you have more than two level, this plugin isn’t for you. But if you have just the case above, that is fairly common, i.e., in portfolio, then, guess?, this plugin is for you.
Actually I did it for my portfolio, so it is also an example of usage. In my example I don’t use thumbnails list in the galleries, but the option is provided, of course. This is just an example. I use a counter to minimize the space of the navigation list.
What I managed to accomplish is to have a simple way for putting together those type of galleries. I hope I did, but I can’ assure. Let me know. Also let me know if something is broken, as I couldn’t extensively test it due to lacking of time: it just work for me. But I could try to fix some bug, if any. For all those reason, it’s beta.
You may also ask: why on the hell the plugin is named bos_album, but there isn’t a tag so named? Well, actually this was my first plan, this is just a first step. Sorry, but I can’t discover the whole picture. It’s a sort of secret plan between me and my imaginary friend that live under the carpet. If we will be able to do the second step, it is to be seen… ;-) So this is it, for the moment.
Bye
Z
Last edited by Zanza (2006-12-29 18:37:08)
Offline
Re: bos_album
Hi, I like your plugins a lot! BUT, the code inside them are very messy (tabs and spaces mixed, linebreaks sometimes and sometimes not) that it’s so hard to read and understand.. I did some cleaning up in 0.44 but now when I’ve upgraded to 0.45 the mess is back again..
I would llike to contribute some things for you (for example having the counter display titles instead of numbers) but it’s just too much digging right now, sorry..
cheers,
/Anton
Offline
Re: bos_album
You’re right, it’s a mess, ‘cause I’m not a developer and have a really casual way of proceeding, just inside txp (that doesn’t support tabs without plugin), not a textual editor.
Next days (maybe next week) if I can find some time I will give it a look to try some ‘code layout improvement’.
Thanks for caring, cheers.
Z-
Offline
Re: bos_album
And there is an afful lot dublicated code. First, why this is outputted 6 times:
return "<div class='bos_album".$sectionclass."'>".bos_subcat_image_index(array('cat' => $c,'link_to_image' => $link_to_image))."</div>";
Er – it could be done with single conditional at array, and the array could be done in once also, not multiple times… And there is also some code that is completely useless.
PS. could you use Textpattern’s inbuild wrap-tag function, so we could choose class, id and container-tag automatically ;-)
Cheers!
Offline
#5 2007-10-24 00:37:18
- masa
- Member
- From: Asturias, Spain
- Registered: 2005-11-25
- Posts: 1,091
Re: bos_album
@ gocom: Would you consider getting in touch with the author?
Perhaps you could help to improve this plugin.
Offline
Re: bos_album
Zanza: Sounds good! :) I’m not a PHP wizard either so..
BTW, wouldn’t it be cool to have a “code wiki” or something where everyone could add his/her cleanup or modification code for consideration directly? Like SVN but simpler ;)
Offline
Re: bos_album
Gocom: As far as i remember, there were reasons to use that because there were many conditions. But surely there are more efficient ways, if I ever studied php… :) The built-in wrap tag function couldn’t be used for some reasons (uhm… maybe ‘id’ couldn’t be used?), but in the meanwhile txp has improved, so I will give it a look.
The other useless piece of code is there as a reminder for some function I originally planned and never implemented…
Anton: never used a SVN, but if someone would put up a wiki, the code is freely available, of course. Don’t know how to deal with forks, anyway.
See you next days, let me finish some urgent works first.
Thanks for your interest in the plugin.
Z-
Offline
Re: bos_album
Any news on this..?
cheers,
Offline
Re: bos_album
Sorry, starting from tomorrow I’m again out of office for some business. I’ll try to give it a look, anyway, to better format the code. The title/counter issue, anyway, should already be addressed by the plugin (see answer to the bos_image_display thread)!
Z-
Offline
Re: bos_album
Ok, wrong thread maybe, sorry..
However, I wasn’t referring to titles of the categories but the names of other images in the selected category/gallery, shown as numbers in the list next to each image. I can’t find a way using title=“1” there and counter=“0” just disables the feature entirely.
Sorry to see you go again.. any volunteers here to help me achieve what I want? Anyone else having this request..?
cheers,
Offline
Re: bos_album
quickly… title=“1” is for other images names in the same image category/gallery. I don’t remember if I tried using both counter and title simultaneously, but it should work. If not let me know. Anyway, this need to be done with bos_image_index tag, not bos_album. bos_album has fewer option, because is meant only to give easier access to some of the functions of the bos_image_display plugin. Maybe this can cause some confusion, it surely does.
But the feature you need (if I understand) is already there… If I don’t understend please explain. Bye
Z-
Offline
Re: bos_album
I never got this to work when displaying 1 image, only on the categories listing. But I ended up adding $name in the counter-string and removed the number from there, and then it worked :)
PS: I have cleaned up both the plugins now, if you want to continue with them in the future.
Offline