By Jovean on
I'd like to add an attribute to the output for a given view. How do I do that? To be more specific I'd like to add ' rel="lightbox[group]" ' to the a tag of all the photos in my image galleries (without hacking the views module, of course).
Comments
_
For something simple like that you can probably use the 'rewrite the output of this field' option in the field configuration settings. To completely theme a view, or a specific field within a view, see Views 2 theming.
Thanks for the reply. It
Thanks for the reply. It took a bit, but I found the "Rewrite the output of this field" option you mentioned. Except I also notice that the "Link this item to it's node" is checked and that that option will override other link options ... I assume I will have to disable that ... but I am unsure of the rewrite syntax ... in general, but also I don't want to lose the link to the node (thus failing gracefully for the few who have JavaScript disabled).
So far, I have
But what do I can't figure out what the replacement pattern for the node id is! :(
=-=
you should consider nevets comment below. There is a drop down that does what you want, right in views. It can be found by editing the field that holds your image.
Hmmm ... but I see no
Hmmm ... but I see no reference to Lightbox2 in any of the Views dialogs ...
=-=
Is the lightbox2.module installed?
screencapture on its way of what you should be seeing.
Yes, Lightbox2 is installed.
Yes, Lightbox2 is installed.
I just figured it out ... I
I just figured it out ... I needed to add the node id argument to make the replacement pattern available ...
If you are using image field
If you are using image field + image cache + lightbox 2, you can format the field in views to use lightbox 2.
Thanks for the reply. After
Thanks for the reply. After the first reply, I think that's what I'm trying to do ... but as I said in the replay to the first responder, I can't figure out the replacement pattern for the node id (a link to which I want to keep for graceful failure reasons).
=-=
you won't need to know the nid, the dropdown nevets and I speak of, require only a selection of how the image should be displayed. preset -> original.
investigating the field mentioned should shed a lot of light on this. It's similar to chooseing a display option for a field in cck.
=-=
Image here
screencapture above.
how to expose:
click on the field that holds the image in "fields" (in screenie, I clicked on Content: image)
scroll down to the bottom of the page and look for Format:
Under that drop down is the lightbox display options provided that the lightbox2 module is installed properly.
Ok ... I see that I don't
Ok ... I see that I don't have the ImageField module installed ... but that depends on CCK ... installing and enabling CCK makes my admin pages inaccessible: the host has not allocated enough memory to the site, and I'm getting PHP memory allocation errors! It might be "the hard way" but is there another way to do what I want?
=-=
what module is handling images?
Image and ImageCache
Image and ImageCache
=-=
ah.
not sure what goes on with image.module and don't have it installed on a sandbox anywhere.
in administer -> content types -> display fields tabs for the content type in question, is there lighbox2 options?
I'm guessing it may not, as image.module produces images as nodes and not fields. Though there may be some interaction there because of imagecache.
have you tried clearing your views cache tables in administer -> views -> tools tab -> clear veiws cache button?
Personally, I'd double check host documentation and ensure that you can't override the memory settings on your own with a custom php.ini file. Though that has nothing to do with the image.module.
Thanks for taking the time to
Thanks for taking the time to try to help me.
To answer your questions: no, there are no Lightbox2 options in the administer -> content types -> image, fields tab; and no clearing the views cache didn't seem to make any difference.
As for the memory problem, I managed to successfully install CCK and activate FileField and ImageField (by completely removing a couple unused modules - which I may need later, but I'll cross that bridge when I come to it.)
I discovered this has a very
I discovered this has a very simple solution. Visit admin/settings/lightbox2/automatic, expand the "Image node settings", choose "Lightbox grouped", leave the rest of the settings at their defaults, then save the configuration. Voilá!