I've created a new theme for Gallery2 called Tien. Currently this is my first go at creating this theme and I will improve on it, if you notice any problems, please let me know!
Tien specific features
- Layout separates albums from photos and places them at a seperate part on the page.
- Subalbums can be displayed, and a maximum nr to display can be set.
- Albums can be shown with or without thumbnails.
Tien specific notes
- Does not look good with color packs. However, this is a theme so that is ok.
- Rearrange items puts in the pagebreaks at the wrong places because album items are displayed differently with this theme. Rearranging does work though!
- I haven't done localizations but did put all new texts in smarty tags, if anybody wants; feel free to translate and compile
Screenshots
tien-screenshot-1.jpg: Albums view
tien-screenshot-2.jpg: Albums + items view
tien-screenshot-3.jpg: Item view
tien-screenshot-4.jpg: Colorpack "After dark"
Files
Because of problems with uploading in this forum I have a server hosting the files for the moment:
tien.zip with source images
tien.zip without source images
Updates
- v0.1.6 (bugfix)
- Fixed a small bug that made a notice appear
- v0.1.5
- Added option to show each albums total descendant count. (This is for the albums inside the current album)
- v0.1.4 (bugfix)
- Made subalbums thumbnails option available for more then 2 columns display.
- v0.1.3
- Added thumbnails for subalbums option.
- v0.1.2
- Added a colorpack: "After dark".
- fixed a stylesheet bug.
- v0.1.1
- Added a logo button for this theme itself.
- fixed a minor typo.
ps, all drawings and the rabbit that appear in the screenshots are my own. Yes, the rabbit has real stripes. No, I unfortunately do not own the SLR ;)
Posts: 32509
maybe add some screenshots when not offering a demo, this would definitely attract more users
Posts: 16504
Since I'm not the author, I won't post the screenshots so he can control them if he changes things up, but... Damn! That's pretty cool looking. Really good example of showing people what you can do with G2.
Posts: 383
Thanks nivekiam. The looks are actually the last thing I've done. It took some more work to separate albums from items back into the form that other gallery systems use, but it is possible with G2 as well
There are some issues with the css, but that's why I versioned it 0.1. But I didn't want to wait to show what I did so far...
Posts: 32509
pretty cool
Posts: 388
Nice job RwD! What caught my eye (besides the Zebra wabbit) is you show the image filesize in bytes. That I like.
Posts: 383
It is a tiger print, I've never seen zebra rabbits :P
Posts: 388
Posts: 383
Shall I add a psd file so everybody can have their own text instead of "Tien" displaying in the header??
Posts: 32509
yep, i think that would make a lot of people happy
kudos for your dedication
Posts: 383
I've added the header "source" image to the zip. It is not actually the source image, but it allows you to change the header text into anything you want but keeping the style and background I set up.
I included 4 files for this:
Posts: 2
I LOVE this theme, but for one thing... How do I add a thumbnail instead of the folder icon for each album on the main page???
Posts: 383
Thanks
I actually took them out on purpose but am planning to make it an option in the config to reinstate the thumbnails, but I first have to find out how to give them smaller sizes then the other thumbs have.
For now you can add thumbnails but you'll have to try to get it right yourself;
lines 44 and 45 should be these:
I haven't tested this for looks or functionality. I have little time at the moment (got a new (non G2) project for the rest of the month) but let me know if the fix works...
If you happen to know how to make smaller thumbnails for albums then let me know so I can implement it into the theme as an option...
Posts: 383
I was studying the Translator class when I suddenly noticed the textdomains being (component) type_name. So checking this with the .mo files I suddenly saw that the translations which I did put into the zip file could not be used because they belonged to another textdomain (eg, there name was theme_donortheme.mo where they should have been theme_tien.mo. So I fixed that, and resubmitted (and replaced) the old zip files. Except for some strings everything should now be translated. I downloaded poedit, so chances are I'll translate the 5 or 6 words to Dutch, German and perhaps French and Swedish (and unlikely but possibly to Greek, Romanian, Finnish and Chinese).
Anyway, in short, the theme Tien is now comming with correct .mo files.
Posts: 2
This worked great, though down on line 80ish I had to delete a </if>. I also found that it needed a <br> tag to get the title on the line under the image!!
It's awesome!!!
But I don't know how to make smaller thumbnails I'm fairly new to this... But I'm happy with them that size!
One more little question, how do I change the colour of the cell in the header? I've changed the colour of the image, but when the page loads I get a flicker of the bright orange.... I can't see it in the code anywhere...
If you're interested, I'm doing this all on www.jolenemooney.com/photos.
Posts: 383
Actually most style and layout parts are in the css, so you need to find and change colors in there... So for changing the color of the header change this part in theme.css:
For your site #f55f00 should be changed into #6c14c3 (or if you don't want a temporary color while the image loads use #fff
I tried my code myself now, and you must have done something wrong; I did not have to get rid of an extra {/if}. Perhaps you should redo the change??
Also, if you decide to redo the change you shouldn't put in the <br> again. Instead add
Which will put the title on the next line as well. (If you do want to put in the <br> then use <br /> instead because that is a valid empty XML element where <br> is not...)
Ow, while I was at it, I took the moment to update the theme slightly, minor change...
(the zip files in the start post are updated)
Ps, nice to see you like the theme
______________________
I made a theme for G2, try it
Posts: 383
Because all standard themes are white (and some darker are popular as well) I have added a colorpack to the theme; "After dark". I am not quite satisfied yet, it seems a bit off. Perhaps someone can tell me what I need to change to make this work :P
You can download it here: tien.zip
You NEED TO UPDATE the theme to use the colorpack...
______________________
I made a theme for G2, try it
Posts: 6
I'd like to add the number of photos within a folder next to the folder thumbnail, since members never know if a folder contains images or not.
I'm guessing there is a some kind of variable which returns the number of photos within a child folder, but I don't know what it is. If I could insert it within this line (where it says number of photos go here) it would be really nice.
How could I do this?
Posts: 383
If anybody could tell me I would instantly implement it. It was in the design but I couldn't figure out how to do it in the little time I had left before I had to start on another project.
So if you figure(d) it out please tell me!!
______________________
I made a theme for G2, try it
Posts: 8601
check modules/core/classes/GalleryTheme.class, loadCommonTemplateData. The phpdoc there lists data you can load with keys to that function call in showAlbumPage of your theme. Look at matrix to see how it gets child count and desendent count for subalbums.
Posts: 6
That's a large file! I've been looking for a function or variable that would return the child count... so far the only one that sounds right is
and that doesn't return anything! I'm not exactly a php pro and I might be doing something wrong... who has any other ideas?
Looks like the function described above is the right one and that the matrix theme does indeed return numbers of children... could you check that out?
Posts: 8601
Large file, yes.. but I was only directing you to the phpdoc above function loadCommonTemplateData where it lists all the data items you can request. Look at http://cvs.sourceforge.net/viewcvs.py/gallery/gallery2/themes/matrix/theme.inc?view=markup function showAlbumPage to see how those keys are passed in. Now add 'childCount' and/or 'descendentCount' in the array of keys used in your theme, then turn on buffered debug output in config.php and load an album page.. in the popup smarty console you can see what new data is now available to use in your tpls.
Posts: 6
Whew. Ok, I think I got it. I activated debug mode and the errors...
Basically, from what I understand, the line should look something like this:
$dispcounts = loadCommonTemplateData(array('childCount','descendentCount')); echo $dispcounts['childCount']; echo $dispcounts['descendentCount']; ?>
Debug mode notifies me of an error of an undefined index (childcount), and I can't get it to work. I'm really not very good at php and only know basics... a lot of the information in the debugger is hard for me to understand, I know I have something wrong but I'm not too far...
Posts: 6
Other suggestion:
I was looking at the Matrix theme album.tpl file to see how they had shown date/owner/size etc under the folder name. The code used is as follows:
{g->block type="core.ItemInfo" item=$theme.item showSize=true class="giInfo"}
I really don't know template coding language at all, but i see it's somewhat similar to html. This calls some kind of block (probably the gray one that shows the info) and then displays it all. I inserted this line into the tien album.tpl but it isn't doing much. I tried changing it to text format but it returns errors. Again, I really don't know how this works so obviously I am making mistakes. This looks like the simplest way of displaying the number if items in a folder.
Posts: 8601
look at how existing themes call loadCommonTemplateData..
also tpl info at http://codex.gallery2.org/index.php/Gallery2:Tpl_Reference
Posts: 383
atomix,
I had a few seconds today to look at it. I was not behind my own pc so I couldn't make new code (that would work). But I did notice something on line 46 of "album.tpl". The {if} part that is there is the part I intended to show the nr of items inside. It might only need little adjustments. I have no clue if it is easy to make it work or not; it has been a while since I made this. But at the moment I have no time to figure out how to do it. Perhaps in December...
______________________
I made a theme for G2, try it
Posts: 6
Looks like the code needs to be mixture of what i typed above: it uses a {g->text arg= } style line. The arg= should have the loadCommonTemplateData function, or something similar. I'll be reading up on the Tpl tutorial that mindless posted.
Posts: 1
Love the theme, just had a question that I may just be overlooking?
You show a SS at the top with albums+items view, how do I get the split view like that?
Thanks in advance,
Dave
EDIT: disregard this, I see now that they are all subfolders within the main one.
Posts: 383
What's an SS?
______________________
I made a theme for G2, try it
Posts: 6
Screenshot. :p
Posts: 1
Great theme Rwd, hope you keep up with minor changes.
Posts: 10
I am very new to G2 so I hope that you will be patient! I love this theme and in particular the after dark colour. However I have installed it and am finding that although the colours have changed to darker orange in the header the background is still white and I do not have the random image on the left. Can some please explain to me where I should be placing the various folders and if in fact I should be seeing the random image window on the left.
Thanks for your patience.....was running 1.4 so this seems like the difference between windows 3.0 and XP!
Regards
Phil
Posts: 383
Do you perhaps have a screenshot of the problem?? I do not remember actually leaving white spaces in....
______________________
I made a theme for G2, try it
Posts: 1
Hi RwD, I am using your theme if that is ok, and I have made some modifications to it but would like to add a couple of things I hope you can help me with. My site is here - http://www.waclan.co.uk/wfb/gallery .I would like the Header images to be linked to a url (in this case my site homepage) I gather I need to add something to this section of code:
But I am not too good with css.
Also, I would like the background colour to not be white but a different colour, while keeping the inside of the gallery white - i have tried to change this:
But it does the whole page, inside and out. Any ideas? Great theme by thw way
Thanks,
Adam
Posts: 2
I love this theme. But i'm having a hell of a time installing it. The theme only shows up on two of my 7 Albums. I dont get it, the Main screen that shows the albums is the matrix. and two of my other albnums r tien. The rest are matrix. I triend unstalling and doing again. same deal can anyone help?
Thanks!
Posts: 8601
did you set tien as your default theme in site admin / themes? if you just did edit album / album tab to assign tien to 2 albums then i'd only expect those 2 albums to use it.. every album can have a different theme..
Posts: 2
Yea. I have it set to my default theme.. I ahd no idea you could do it for each album so i just went thew all fo them manually and changed it. It was kinda a pain but it looks fine now! thanks
Posts: 383
Well, you cannot add hyperlinks with css, you need to do that in the templates. In one of the templates there should be tienLogo.jpg or tienLogo.gif somewhere. Around that image markup you should add the link like: <a href="mysite.com"><img ...></a>.
That should fix the first point.
Second thing I cannot help you with exactly right now because I do not have the time or the theme itself nearby. But when you do not set a backgroundcolor then an object will be transparant (entire page will of course have a backgroundcolor, but everything in it is transparant unless told otherwise).
So when you set the backgroundcolor you must make sure that the site container element does get the color white.
My guess (since I haven't seen the code in a while) is that you should add:
background-color: #fff;
to #mainContainer. After that you can change the background color in the way you suggested...Posts: 383
Adam_T,
I've just tried the color you suggested, nice color :P
Perhaps I could add a colorpack for a different bg color ;)
______________________
I made a theme for G2, try it
Posts: 2
I love, love, love this theme!
I've been making wee alternations with transparent icons and things and want to use the dark pack.
The one thing that I've been trying to get is album thumbnails. Not big ones just wee ones. I tried and tried with the dark pack and couldn't get it to work. I finally got somewhere when I took off the pack but it still has problems.
screenshot : http://ladymix.com/mix/screenshot_gallery.jpg
It has the little question marks and I can't change the size of the thumbnails any longer.
Thanks for any help I could get from anyone. Once again AWESOME theme!
Posts: 383
Which browser is that screenshot from??
If you assign a classname to each album thumbnail you can control the size using css. (of course an image at the correct size would be better, but I don't know how to do that right now, anybody else??)
______________________
I made a theme for G2, try it
Posts: 2
It is Safari 2.02 and I obviously use a mac. Comes up the same way on Firefox. Thanks for the suggestion, one of these days when I have the time I'll go in and work with the css if no further suggestions are presented.
Still have the question marks though :P For now I'll use the folders until either I or someone else can figure something out ;) Thanks!
Posts: 383
It is on a future to do list to built in an option to show the thumbnails. It would have been in if I had easily been able to find out how exactly to create the even smaller thumbnails because the large ones simply didn't fit. I didn't want to use css as a solution because then I'm sending large images to a browser, displaying them very small.
______________________
I made a theme for G2, try it
Posts: 8601
thumbnails are small anyway.. seems ok to send a thumbnail image and tell the browser to make it even smaller. PGtheme does this, as does micro-thumbs in matrix theme.
Posts: 383
Ah, ok. I dind't really take a look yet at how others did it. And it might be quite a while before I am going to make the option in this theme. I still have to finish 3 websites for customers who keep on wanting new things... (which of course is not a bad thing for me as long as they keep paying :P but it doesn't help this theme one bit)
______________________
I made a theme for G2, try it
Posts: 426
Thanks RwD
I love this theme and had tried unsuccessfully to load it but with your suggestion it works.
I have also found the answers to some of my questions in the thread.
I do have a suggestion though:-
It would be nice if you added in the footer -
"Theme created by <you>" and facility or instructions for us to add "adapted by <me>"
In fact I would like to see that in all themes. It would nicely get round the feeling that we should be giving credit where it is due.
I am planning to make a cream/lt brown version of the theme. I have yet to look at the css etc. Now I feel armed to do so.. just where is the time <ggg>
Blessings,
Gaynor
Posts: 383
It already states in the footer: "(c) Tien theme by RwD, download here (version:'0.1')" and that is static text somewhere in the templates that theoretically can be altered by anyone.
If you want to create a theme with different colors then perhaps you should look at the color pack I made. I made it with two reasons: One being that I wanted a darker theme because these seemed to be in demand (PG is popular) the other reason was that you can then quite easily see how to make a colorpack for my theme by copying and altering the afterdark one..
When you have it done and if I like it I could put it in the zip so everybody can get it easily!
ps, I don't like the afterdark colorpack myself, it is not quite done. But it is there to look at and some people seem to like in nonetheless..
Posts: 426
I have made some versions on the Tien theme
You can see them at http://travelpicsmcc.com/gallery2.0.2/
Login with user = gallery and password = forum
Obviously my G2.0.2 site is not yet public and I have a lot of work to do on it.
The first page is theme Matrix with my own colorpack “ltgold” (which has not come out the right colour because the computer I made it on has odd display colours)
Select Overseas Travel / USA / San Francisco / Colour Fun
USA has my adapted theme ‘PlusWebgold’
San Francisco has my adapted theme ‘PlusWebgold2’,
And Colour Fun has my adapted theme ‘PluswebGreen’
I think the adaptation I am doing is more than just colorpacks as I am heading towards making pipes instead of flat slats for the bars. The images for the bars looked like pipes, but somehow they changed in the theme, possibly because of the border.
We have some clients very happy with themes based on Jade’s pipe bars.
I am hoping to be able to translate these into G2.
I like the way Classic has the captions below the thumbnails, but don’t like the owner being stated beside every image.
I like Matrix, but for the caption being to the side
And so far I have not been able to work out how to add images to the heading and bars
Tien suits me very well, but so far I have not been successful in getting the thumbnails to show up.
Blessings,
Gaynor
Posts: 8601
Site Admin / Themes / Classic -- turn off show-owner here to turn off owner display next to thumbnails.
also need to edit themes/classes/templates/album.tpl and photo.tpl to change showOwner=true to showOwner=false to also remove owner display in the heading for each page.
(if you have anymore non-tien related questions please ask in another topic, thanks)
Posts: 383
Well, the colorpack is basically just an extra css on top of the existing one overruling previous settings. If you add images or change them then that is okl inside a colorpack I think; no need to call it a new theme like many would do...
You can set the border to 0 by adding border-bottom: 0 !important; to the colorpack css for those headers. (The !important makes sure you overwrite the previous setting, but may not be needed)
I don't really see the pipe in there... it is just some sort of flat rainbow to me. You also have a horizontal color shift which looks weird every time the bg image is repeated??
Thumbnails in images has been requested now many times where I actually specifically took them out because I don't like them. In a month or so I might have time to put them in as an option. You can do it yourself as well, but if you dnon't want to do more then needed then it requires to change the theme. Just use the image code used for images in the place where the folder image is used..
______________________
I made a theme for G2, try it
Posts: 426
Thank you both of you.
Mindless, I have taken note of these processes, sort of making myself a FAQ of the things I have "needed to know"
RWK Thank you.
Yes I can see there are times when it is good to not have the thumbnails, and I am glad you have given us a theme that does it.
I do think the option will be a great addition. I, for instance, would use it without thumbnails for the top page of my trip record, with the subalbums shown there too, all live links and easy to choose quickly, but would have thumbnails showing on the inner pages.
I shall wait for the options to be available so I can do that. It will be wonderful. Thanks.
Thank you for pointing out about the colour change. I shall fix that. As to the pipes aspect, those vertical lines are part of what prevented the pipe effect, but I also have yet to do rounded ends to the images.
In Jade's Pipes skins, the pipe was made of three images, one at each end and a repeating one for the middle.
At this stage I was happy to just achieve changing the image for the bars.
This is one reason I like your Tien theme. With my limited knowledge, I have been able to understand the working documents.
Blessings,
Gaynor (very much a learner)