Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#271 2010-01-25 19:46:38
- Something Clever
- New Member
- Registered: 2009-03-26
- Posts: 8
Re: hak_article_image
I’m trying to exclude one image from hak_article_thumb… but there’s a catch.
I currently have a section “/portfolio/ where I’m using hak_article_thumb and jcarousellite to display various projects with a slideshow of images associated with that project (article). This works great.
I set up another carousel on my home page using jcarousellite + hak_article_thumb again. This one shows only the first article image (limit=“1”)from each project (article) from the category “featured”. This is also working great. Users can now flip through my features.
Problem: My ‘feature’ area and my /portfolio/ carousels have different image dimensions. (The features are larger). I therefore would like to EXCLUDE the first article image (the feature image) from the carousel on /portfolio/.
So the result would be, click on a large feature image on the front page, go to the article about that project, where a carousel shows all the images from that article EXCEPT the first image – the feature image.
The first thought was to use offset and limit, in order to skip the first image, and then not allow it to show the whole list – therefore hiding the first image. Problem – not all the articles(projects) have the same number of images associated with them.
Is there a way to do this? Or a better way to do this?
Do I need to make a separate ‘feature’ article and somehow just hardcode those images to link to a different article?
Any help greatly appreciated! Thanks
Offline
#272 2010-01-25 20:57:35
Re: hak_article_image
If I’m understanding correctly you should be able to just use offset in the carousel. Limit should adjust itself accordingly if my memory of how this works is correct.
Shoving is the answer – pusher robot
Offline
#273 2010-01-25 21:18:54
- Something Clever
- New Member
- Registered: 2009-03-26
- Posts: 8
Re: hak_article_image
Ah! I misunderstood how offset works – adding offset=“1” does work in that it is now not displaying the first ‘feature’ image.
However, something about adding offset seems to make the carousel and thickbox not work. (Which obviously might be outside the scope of this forum but any suggestions are highly appreciated.)
Edited to clarify – The correct images are still showing up, but they’re no longer in a carousel. They just appear in an unordered list with the now non-functioning controls below.
Last edited by Something Clever (2010-01-25 21:20:54)
Offline
#274 2010-01-25 21:33:53
Re: hak_article_image
Without actually looking at the actual markup and what jCarrousel is expecting it’s hard to say but it seems like it’s missing something to attach the carrousel to. Are the proper classes etc being applied?
Shoving is the answer – pusher robot
Offline
#275 2010-01-25 22:02:42
- Something Clever
- New Member
- Registered: 2009-03-26
- Posts: 8
Re: hak_article_image
Adding offset=“1” seems to still generate the exact same source code EXCEPT – as planned – it doesn’t display that first image. class=“thickbox” is still being assigned and the ul is still in the proper div for the carousel.
Offline
#276 2010-01-25 23:35:51
Re: hak_article_image
I don’t it’s hard to see what could be wrong without actually looking at it. Are you getting any js errors that could be causing the carousel initialization from firing?
Shoving is the answer – pusher robot
Offline
#277 2010-01-26 00:11:11
- Something Clever
- New Member
- Registered: 2009-03-26
- Posts: 8
Re: hak_article_image
Adding in offset=“1” causes an error to show up that reads: “a[ 0 ] is undefined” Source File: http://(sitename)js/jscarousellite_1.0.1.min.js – Line 1
Removing offset makes the error disappear.
(If it were on a public server I’d post the address. Thanks again for trying while operating blind!)
Last edited by Something Clever (2010-01-26 00:22:43)
Offline
#278 2010-01-26 01:00:49
Re: hak_article_image
yeah that sounds like whatever element collection jcaroussel is trying to get is not actually getting populated somehow.
From looking at the jCaroussel code it looks like the li’s are not getting grabbed properly. I’m trying to match the minified error to the non minified source so this could be off. In firebug try doing
console.log($("divselector ul li"))
and see what comes back. Replace divselector with however you are attaching jcaroussel to the div. It definitely seems like something is getting screwy with the markup.
Shoving is the answer – pusher robot
Offline
#279 2010-01-26 01:40:24
- Something Clever
- New Member
- Registered: 2009-03-26
- Posts: 8
Re: hak_article_image
Hopefully this is what you meant… The first carousel in list view is div.projectcarousel17 so…
>>> console.log($(“div.projectcarousel17 ul li”))
comes back with ….
[li, li, li, li, li]
Offline
#280 2010-01-26 01:47:24
Re: hak_article_image
Well that looks right so I have no idea how it’s coming up with it being undefined from that. Not really sure what else to try at this point, since I’m not really familiar with what jCaroussel is doing. At this point I can only suggest poking through the debugger with the uncompressed version and figuring out what is failing, but that’s not real helpful if you haven’t done that sort of thing before.
Shoving is the answer – pusher robot
Offline
#281 2010-01-26 04:16:01
- Something Clever
- New Member
- Registered: 2009-03-26
- Posts: 8
Re: hak_article_image
Posting my mortification in case it helps someone else. I called in someone who COULD debug for me.. and they pointed out that one of my projects only had 1 item in it so far, so with the offset it was turning up empty, and borking the whole thing. The /portfolio/ page has multiple carousels on it, and hitting one that was now ‘empty’ caused the problem. Thanks so much for your assistance!
Offline
#282 2010-01-26 13:46:39
Re: hak_article_image
That makes sense since jcaroussel doesn’t verify if the li array actually has anything in it before accessing the first item (which is kind of shoddy).
Glad you worked it out.
Shoving is the answer – pusher robot
Offline
#283 2010-02-21 14:23:26
Re: hak_article_image
Hi Patrick and everybody,
A while back I posted the query below (see original post).
Just writing in to share a simple solution I found for it here
catnip wrote:
Hi Patrick,
I’m using the plugin in an article form to link to images, but want these links to be tracked by Google Analytics, which by default only tracks actual pages.Google indicates here that tracking for linked files can be achieved by manual addition of the following code structure to each file:
<a href="http://www.example.com/files/map.pdf" onClick="javascript: pageTracker._trackPageview('/downloads/map'); ">Is there any trickery that will allow me to include the javascript in the form? (I’m not a programmer – Just know how to cut and paste)
This is the form I’m using:
<li><br/>
<div id="title"><txp:title /></div>
<txp:excerpt />
<txp:hak_article_thumb link="1" linktype="image" linktitle='txp:caption' />
</li>
Thanks.
Offline
#284 2010-03-25 04:27:32
Re: hak_article_image
First of all – thanks for a great plugin – its been a mainstay of our sites for a couple years now : )
I just have a query – is there any reason the plugin adds a title attribute to the img tag?
I get this for example;
<a href="…/images/12.jpg" title="Director / CEO" class="thickbox right">
<img src="http://binnacle.dev/images/12t.jpg" alt="alt text" title="Director / CEO" width="200" height="225" />
<span></span>
</a>
Whereas there’s options to use title= on the link, I can’t see any mention of title= being included on the img tag and its surplus to requirements. Can I remove it?
Incase anyones wondering, I’m using the span’s so I can attach a magnifying glass icon over the top of the image.
Offline
#285 2010-03-25 15:35:40
Re: hak_article_image
That is an artifact of the plugin using the built in image() function which assigns the caption to the title attribute if it exists.
I have a replacement function that I’m using for a more general purpose image plugin I’ve been building on and off, I could see how involved it would be to port that over.
Last edited by hakjoon (2010-03-26 02:20:21)
Shoving is the answer – pusher robot
Offline