Using template variables to show thumbnails of siblings
mattsson
Joined: 2005-07-02
Posts: 25 |
Posted: Wed, 2005-07-13 07:20 |
I would like to make a theme that shows all the thumbnails for the selected album on every page (in a column on the right), and shows one intermediate sized image in the center of the page. Every page would look like this. Also the current album would be highlighted in a list of album names on the left, and the caption for the current image would be displayed below it. As in this example. I'm using the new themes-only version of Gallery 2: Gallery version = 2.0-beta-3+ core 0.9.31 My hope was to create this clean view of the website for the visitor, but keep the original Matrix look for the admin. That is, the photographer can log in and upload new images and modify her captions, and automatically have her website updated. Right now I've made a copy of the Matrix layout and I'm figuring out which variables will give me the values I need to generate pages like this. From there I can modify the album.tpl and photo.tpl to get my layout. I've figured out that a foreach loop through the $theme.children will get me the thumbnails (as illustrated in the album.tpl). That's fine for a pageType of album because the "self" object has a .children. The problem is, if I'm in a pageType of photo, where the object is the photo, how do I get to the object that has the siblings so I can display thumbnails for all the images in the selected album. (e.g. $image.parent.children (I made that up, but I want something like that)). And if I'm in a pageType of album, I will choose as the current photo, the first of the $theme.children. And I managed to get this child saved as a variable $saveChild ({assign var="saveChild" value=$theme.children[0]}). But how do I get to the image for that child (I need something like {g->image item=$saveChild image=$saveChild.image}? Each thumbnail would link to another photo page, with the current photo matching the one of the thumbnail. Or a different approach could be, I want an album page that displays not only thumbnails, but two more things: the intermediate view sized image of a specific photo (or the first one if not specified), and the caption for that image. I am new to Smarty Templates but I've done some work with XML style sheets so I think I have the basic idea. However I don't really grasp what's going on in theme.inc, but it looks a little like Java class definitions to me. If this request is beyond the scope of the kind of help you can offer, let me know. Also if you think it's beyond the scope of Gallery, let me know that too. I realize if I can't figure this out, I could perhaps modify the website design to be more like "native" Gallery, with thumbnails and view-sized images on separate web pages. Thanks, |
|
Posts: 32509
please wait a few days. in a few days, i hope, one of the developers will have ported siriux to the new theme system.
once this is done, you can copy siriux and customize it.
siriux is more likely what you want than matrix, because matrix has pagination (shows only a certain number of items per page) while siriux shows all subitems in one page.
@diferent themes for different users:
not yet possible in G2.
but you could do a {if $user.isSiteadministrator} or something like that around all options that should be invisible to the guests.
Posts: 25
Hi Valiant,
Hmmm, I didn't even think of pagination. My new layout needs only a subset of the features available in Gallery, as the website is as much about creating a good feeling about the photographer as it is showing the photos. Each album would hold only 6-10 photos, enough to always fit on a single page.
What I'm looking for is, a theme that will show (in a single web page) both the current photo, and the thumbnails for the rest of the photos in that album. Then I will know which variables I can use to get the values I need for my layout.
On different themes for different users, I have few enough users that it's satisfactory for me to create a custom theme for each one.
On my attitude about waiting for an upgrade of Gallery, the short answer is, sorry, can't wait, gotta finish this project. I know your point of view is you are improving a great product and you need feedback on the work you are doing. My point of view is I'm practicing to be a consultant who can deliver a product for a client on time. Each Gallery upgrade seems to set my schedule back a day, and for this particular project I need to get at least the first version of my practice client's website up and running. I have enough information to do that now. Of course my using Gallery is improving my general skills as a web developer as well. When it comes time to revise my client's website, I can check in with Gallery and upgrade at that time to provide new features for my client.
Cheers,
Carol
Posts: 32509
my point was: a few days ago there was the biggest change in g2 ever, a theme / layout refactor. if you wait a few days, you get back some of the old layouts back (now as themes).
the default g2 theme has pagination, which is not what you want. that's why i mentioned siriux, which is very similar to what you want to do. if you waited a few days, you could start with something that is far more similar than to what you need than the matrix theme. thus reducing the overall time you have to work on your project.
Posts: 1
I needed a theme something like what the original post was asking about for a client and hacked the siriux theme in Gallery2 to do this. It actually incorporates the "Skipping the thumbnail page and going directly to the photo page thread:
http://gallery.menalto.com/node/39583 " thing and having the sibling thumbnails on the photo page (this thread).
My application (for the client) will be embedded in the clients site so I made the breadcrumbs and other controls (besides the thumb nails) to be hidden unless your the admin. The user should use the portfolio or gallery link in the header or sidebar (from the host site) to get back to the thumb nails of the main albums. So the admin can add photos and albums and see the album only pages but the user can not.
Anyway some of that functionality may not be useful to others but it is easily changed. to install this just untar it in the themes directory and then install and activate using the siteadmin page in gallery2. Pretty simple.
Here is a link to a tar of the theme:
http://www.monjayaki.org/downloads/gallery2-monjayaki-theme.tar
Here is a sample gallery I used for developing it. This is embedded in a Mediawiki page. The control to get to the top is in the mediawiki control panel to the left.
http://www.monjayaki.org/wiki/index.php?title=Embeded_Gallery2
.---.
|[_]|
|(o)|
'---'
m0nk3y