Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2006-08-22 19:51:36
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
bos_image_display works only 1x per page?
when i have txp:bos_image_display cat=“gallery_vietnam” i get a vietnam picture – all good. but when i put txp:bos_image_display cat=“gallery_philippines” i get two vietnam pictures. when i put only the gallery_philippines tag, i get a philippines picture
so when i use either of the tags they work. but when i use it twice with different categories i get the same image twice
any idea why?
I need someone to protect me from all the measures they take in order to protect me
Offline
Re: bos_image_display works only 1x per page?
Because the tag relies on the $p variable. If it’s not set, it set it. So, after the first time the tag is called, the $p variable is set and global mantained for the next time, and the images are the same. I suppose that a change is needed, but I have to think about it, because it could affect other tags. Right now you could use default=“random” attribute in the second image display tag, or, better, use a specific image id number (i.e. default=“13”). This is a suboptimal solution, I don’t know if it can apply to you.
In order to make a modification, anyway, I’d need to know how you’re going to use the plugin, to understand if changes can be done. It was origially done to display one image at time. Bye.
Z-
Last edited by Zanza (2006-08-23 00:06:16)
Offline
#3 2006-08-23 08:05:10
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: bos_image_display works only 1x per page?
zanza, thanks for your reply
what i am trying to do is: on my homepage, show a thumbnail for each parent gallery. every parent gallery only contains sub-galleries and no pictures of its own. so, parent gallery europe has: belgium gallery, france gallery, italy gallery. then there is parent gallery africa with namibia gallery, botswana gallery, etc
the thumbnail on my homepage can be a random photo from each of the sub galleries. is that possible?
when i click on the thumbnail for europe galleries, it would show me a thumbnail for belgium galleries, france galleries. when i click on those, i would see the actual galleries
at the moment i have txp:bos_image_index cat=“gallery_europe” but that only shows a thumbnail if i create one especially for gallery_europe, not a random one from one of its sub galleries
do you have any useful tips?
I need someone to protect me from all the measures they take in order to protect me
Offline
Re: bos_image_display works only 1x per page?
If I understand your needs, you should use txp:bos_subcat_image_index
. (The tag) “let you display one or more images from all your subcategory” (from help). The usage is:
txp:bos_subcat_image_index cat="gallery_europe"
Repeat for every parent category, and you should have one thumbnail for every subcat. They’re not random, though. Note that you may need some conditional to not have all the subcat index repeated when you click and see only a specific gallery. Try and let me know if it works and what else is needed. Bye-
Z-
Offline
#5 2006-08-23 10:17:03
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: bos_image_display works only 1x per page?
the problem with that code is that is also displays the sub-sub-categories. i created one “master” category called “galleries”. when i use txp:bos_subcat_image_index cat=“galleries”, i get thumbnails to europe, africa (->good) but also to belgium, france, italy
is there any way i can limit the nbr of sub categories shown?
I need someone to protect me from all the measures they take in order to protect me
Offline
Re: bos_image_display works only 1x per page?
Uhm… you’re right, and seemed reasonable to limit the subcat only to first level of children. I changed the plugin to act accordingly. Download v. 0.43.
If you want the old behavior use the new attribute allchildren=“1”.
Let me know if this help you.
Z-
Offline
#7 2006-08-23 11:30:02
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: bos_image_display works only 1x per page?
thanks for this update. when i put txp:bos_subcat_image_index cat=“galleries” (the top gallery) i get nothing. when i put allchildren=“1” then i get the two levels below. i actually only need one level below … ?
thanks so much for your time!
I need someone to protect me from all the measures they take in order to protect me
Offline
Re: bos_image_display works only 1x per page?
That’s strange, as I got it working on a site!
Something I can think about is:
- have your galleries some image and some thumbs?
- is “allchildren” empty (not set to 0: simply don’t use it)?
- is the galleries appropriately nested under the galleries parent?
- is syntax right?
- are there any nonvisible strange charachter in the tag (you may have put it with some keyboard combination and be not able to see it)?…
- have you tried to rewrite the tag code from scratch?
If you have some other details (php version?) or a url I can give a look: if there is a bug I’d like to fix it, but I need to replicate it. At the moment for me it’s working.
Bye
Z-
Offline
#9 2006-08-23 12:30:10
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: bos_image_display works only 1x per page?
- i created thumbnails for all my galleries, even the ones that dont have any fotos in the them
- im not using allchildren
- all galleries are approriately nested
- syntax: txp:bos_subcat_image_index cat=“galleries” with opening and closing tags ofcourse
?
im developing on localhost on php 5.1.4 and xampp. my head is about to explode now, i will let it rest and get back to you later today. im really struggling to make a simple gallery …
I need someone to protect me from all the measures they take in order to protect me
Offline
Re: bos_image_display works only 1x per page?
In developing on localhost, can you switch to php 4 for a moment and try if this is the issue? I suppose this is possible (I use mamp and it’s possible). See you later, thanks
Z-
Offline
#11 2006-08-23 13:08:09
- stef25
- Member
- Registered: 2005-12-26
- Posts: 88
Re: bos_image_display works only 1x per page?
zanza, here is a link where i try to explain what i am trying to achieve. i think this will be easier for you to understand :-)
sk-audio.org/zanza.pdf
I need someone to protect me from all the measures they take in order to protect me
Offline
Re: bos_image_display works only 1x per page?
What you need is totally possible, but before you can do it, you must have the bos_subcat_image_index working. If it’s working as it is supposed to, you just have to put conditional if_category for top level template and another conditional for the nested galleries.
I could try to help writing the template, but first you need to have the bos_subcat working! If there’s a issue with php 5 (which I haven’t tested), it should work with php 4: if you can try and let me know, then I could try to fix it. In that case I’ll have to set up a fake section on a site to make the test, which could take longer than I actually can.
But if you can have bos_subcat_index working, the procedure would be simple. Let me know if you can try php4. I’ll be back in a couple of hour. Bye
Z
Offline