Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#61 2006-05-21 16:23:28

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: bos_image_display and bos_image_category for simple image gallery

I see. What I think is that at the moment it would be easier to dinamically add the numbered ids to the list in the DOM via a script, before using the sildeshow script. I’m not skilled on js programming (I’m not skilled in programming at all, to be true), so I can’t help with this, but I think it would be a solution.

Bye!

Z-

Offline

#62 2006-05-22 14:05:51

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: bos_image_display and bos_image_category for simple image gallery

Update: v. 0.38.

Added some attributes and capabilities:

  1. to the bos_image_display added link_to and link_title attribute. With link_to you can set a url which your image will be linked to. Suppose you want to have an image in home page linking to the galleries… now it’s possible.
    The link_title attribute sets the content of the title attribute to be nested in the a tag of the link. Optional.
  2. to the bos_image_index tag added the capabilities of textilizing the caption, like in the image_display tag, via textilize attribute. So you can have a list of your image with caption textilized, not only the fullsize one.

Bug report are apreciated. Bye!

Z-

Offline

#63 2006-06-12 09:46:52

alexwest
Member
From: Järna, Sweden
Registered: 2004-08-04
Posts: 53

Re: bos_image_display and bos_image_category for simple image gallery

Hello Zanza

Thanks for this great plugin. I am starting to use it on a new project and find it very versatile.

Testing your latest release I get a few “Notice: Undefined variable” warnings when in ‘Debugging’ mode, namely
  • <code>previmg on line 175</code>
  • <code>id on line 35</code>

I would also be nice to have the option of setting <code>$breakclass</code> in bos_image_index.

Other than that, working great.

Many thanks!


be safe and happy

Offline

#64 2006-06-12 10:24:13

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: bos_image_display and bos_image_category for simple image gallery

Hi Alexwest. Thank you for the debug. I’ve been able to replicate the previmg warning, and fixed it (no need of previmg at all… ;-) ). I’m not able to see the id warning. Maybe this happens only at certain set of attributes. It shouldn’t affect behavior in live mode, but if you have some further indications I’ll be happy to fix it.

As for the breakclass attribute, maybe it would be possible (I’d need to go further in it), but I can’t see a real utility. You can style your break tag (suppose li) with this rule: ul.bos_image_index li {}. If this can’t solve your needs, please let me know.

Thank you and bye!

Z-

Offline

#65 2006-06-12 14:04:43

alexwest
Member
From: Järna, Sweden
Registered: 2004-08-04
Posts: 53

Re: bos_image_display and bos_image_category for simple image gallery

Hello Zanza,

Yes, I’ve lost the id warning also, so I suppose this is due to how one sets the attributes. As long it doesn’t affect the live mode behaviour (and it isn’t here), it should be ok.

I’ve run in to something else, though, in bos_subcat_image_index. I’m trying to set it up in a section list at the root of my image categories. I’ve tried different settings, none of them worked, and currently trying like this:

<code><txp:bos_subcat_image_index cat=“root” /></code><br/>
In debugging mode I can see that the first sql query is not getting the right ‘type’ of category. The category with <code>name=‘root’</code> and <code>‘lft’ between 1 and 2</code> is actually form the File type category. I’ve also tried a parent category from Image type category, but because it had a duplicate name in the Article type category, it got the latter.

Here’s the debug output
<code> <txp:bos_subcat_image_index cat=“root” /> [SQL (0.000202): select lft,rgt from `pttxp_category` where name=‘root’] [SQL (0.000211): select name,title from `pttxp_category` where name != ‘default’ and type=‘image’ and (lft between 1 and 2) order by lft asc] [SQL (0.000156): select title from `pttxp_category` where name=‘africadoc-2004’ and type=‘image’] [SQL (0.000309): select * from `pttxp_image` where category=‘africadoc-2004’ and thumbnail=1 order by ‘date’ desc limit 1]
</code><br/>

Going through your code, I think this should be enough to fix it. In line 288 change
<blockquote>$qs = safe_row(“lft,rgt”,‘txp_category’,“name=’$cat’”);</blockquote>
to
<blockquote>$qs = safe_row(“lft,rgt”,‘txp_category’,“name=’$cat’ and type=’$type’”);</blockquote>

Cheers,
Alex


be safe and happy

Offline

#66 2006-06-12 14:45:06

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: bos_image_display and bos_image_category for simple image gallery

Looks like you’re right. Only few people use that tag, I suppose, so none noticed the bug.

Now it seems to work properly. Let me know if you notice some other problem.

Bye and thanks!

Z-

Offline

#67 2006-06-20 14:02:19

curiouz
Member
Registered: 2006-06-20
Posts: 56

Re: bos_image_display and bos_image_category for simple image gallery

Hi Zanza, thanks for this nice plugin! Can you please show me how I make a gallery from a category with a next and previous button underneath the image? I understand txp:bos_imgprev and txp:bos_imgnext can do this but I just can’t figure out how to use them.

/Jonas

Last edited by curiouz (2006-06-21 19:20:19)

Offline

#68 2006-06-21 19:15:53

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: bos_image_display and bos_image_category for simple image gallery

If you just want an example, this should work:

<pre><code>< txp:bos_image_display title=“1” capt=“1” />
< div class=“navimg”>
< txp:bos_imgprev cat=“yourcat” wraptag=“p”> & lt; & lt;< /txp:bos_imgprev>
< txp:bos_imgnext cat=“yourcat” wraptag=“p”> & gt; & gt;< /txp:bos_imgnext>
< /div>
< txp:bos_image_index break=“li” wraptag=“ul” cat=“yourcat” /> </code>
</pre>

(without strange spaces). Let me know if you need something different.

Bye

Z

Last edited by Zanza (2006-06-21 19:17:21)

Offline

#69 2006-06-21 20:16:02

curiouz
Member
Registered: 2006-06-20
Posts: 56

Re: bos_image_display and bos_image_category for simple image gallery

Hey! thanks for your the example, it’s greatly appreciated! I’ve copied over the code from your post but it seems the txp:bos_imgprev tag acts as the txp:bos_imgnext tag… well, it’s hard to explain, maybe you can take a look yourself: my test gallery.

/Jonas

[edit] I’ve deleted all the images (images I uploaded with fpx_image_import). And uploaded them again one by one. Now the navigation works like a charm!

Last edited by curiouz (2006-06-21 21:46:23)

Offline

#70 2006-06-22 08:00:56

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: bos_image_display and bos_image_category for simple image gallery

Ok. Please remember that if you use sortby and sortdir attributes for the image index, use them accordingly also in the img and next tags if you want local navigation be coherent with the index!

Bye!

Z-

Offline

#71 2006-06-23 16:05:21

alexwest
Member
From: Järna, Sweden
Registered: 2004-08-04
Posts: 53

Re: bos_image_display and bos_image_category for simple image gallery

Hi Zanza,

In lines 55 and 177
<code>if ($capt = 1) {$capt = ‘’;}</code>

should be
<code>if ($capt = 0) {$capt = ‘’;}</code>

so that there’s no caption displayed when the user sets <code>capt=“0”</code> in the tag options, as you’ve already set <code>$capt</code> to display the caption in the lines above.

Cheers

NOTE Changed the ‘==’ to ‘=’ from the lines of code as they were not appearing in the post

Last edited by alexwest (2006-06-23 16:26:03)


be safe and happy

Offline

#72 2006-06-23 16:37:09

alexwest
Member
From: Järna, Sweden
Registered: 2004-08-04
Posts: 53

Re: bos_image_display and bos_image_category for simple image gallery

Actually, this is not as clear as I’m pointing out because you’ve defined the same variable <code>$capt</code> having two ditinct functions:

1. as the tag attribute to display or not the caption, and
2. the actual variable that handles the placement of the caption inside the code.

I’m definitely not an expert, so bare with me, but this seems to be causing some conflicts. I was unable, for ex, to disable captions in txp:bos_image_index and that’s why this whole issue came up. As I made the changes I mention above, I got it right, but then txp:bos_image_display was getting it wrong

To be consistent with other attributes, it would be good to have the attribute capt for both tags to be set as ‘0’ not to display the caption and ‘1’ to display the caption.

Is there any reason to why you coded it like that?

I’ll take a better look at the code and I can submit you my changes if you would like.

Cheers,
Alex


be safe and happy

Offline

Board footer

Powered by FluxBB