Modifying template [ need to skip items view and go straight to first image ]
draco2002
Joined: 2003-04-28
Posts: 70 |
![]() |
Not sure what the best way to do this would be. I want to show the list of albums like normal, but when you click on the album it brings you to the photo view of the first image. Any help would be greatly appreciated -Dan edit: the post you link to is 100% on track, you just need to edit the album.tpl Thanks for the help! |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
You're not the only person ____________________________________________ |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
draco2002, if you were able to do this, do you mind posting your solution to this thread (I think your title explains itself a little better)? Then I, you or someone can link the Codex to it or you could just create a HowTo on the Codex Thanks. |
|
draco2002
Joined: 2003-04-28
Posts: 70 |
![]() |
making me give away all my secrets now ;) my mod is based off of the sirux theme add this in theme.inc after line 97: Quote:
foreach ($childIds as $childId){ modify line 30 of album.tpl to look like this: Quote:
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.firstImage[$child.id]`"}"> Hope this helps out. -Dan || G1 + G2 Hosting | Custom Theming | Donate to Gallery || |
|
Washi
Joined: 2005-11-19
Posts: 5 |
![]() |
I tried that Draco2002. Didn't work for me. I'm using Siriux for "main" gallery, and PG Theme for the albums, and, I'm kinda confused, cause I have no idea which theme to try to mod. And, I tried modding the PG one, but got an error: Parse error: parse error, unexpected T_FOREACH, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /home/user/public_html/rach/gallery2/themes/PGtheme/theme.inc on line 604 I'm about to tear my hair out. Help please? |
|
draco2002
Joined: 2003-04-28
Posts: 70 |
![]() |
That code is for the siriux them. I haven't played much with the PG Theme, but attach your theme.inc file (rename it theme.txt) and i'll take a look and see what i can dig up for you -Draco || G1 + G2 Hosting | Custom Theming | Donate to Gallery || |
|
Washi
Joined: 2005-11-19
Posts: 5 |
![]() |
Thanks a lot. Like I said, before we start anything, my "main" gallery page is done in siriux, I want to be able to click the album name and go directly to the first picture in the album, in the PG theme. |
|
Washi
Joined: 2005-11-19
Posts: 5 |
![]() |
Anyone? It's been almost a week, and I'd kinda need to get the gallery up and running soonish. Thank you. |
|
TuBaG
Joined: 2004-09-01
Posts: 5 |
![]() |
I'm struggling to pull this template modification off also. Any success? |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
draco2002, When trying to apply this change to the Siriux theme with a current CVS I get this error |
|
Washi
Joined: 2005-11-19
Posts: 5 |
![]() |
Ok, I have a question. When you use this kind of way of seeing the gallery, how can you edit the album? Since there isn't an actual thumbnails page, how can you make a link somewhere to edit the whole album and not just the photo? |
|
RickiusMaximus
Joined: 2005-12-06
Posts: 9 |
![]() |
Hiall, I am also attempting to do this using the matrix template and the posted method is not working for me. From what I can see the program checks to see if the item has children, and if it does it contines to show the album page until it reaches an item which has no children, upon which it shows the photos page. Can anyone help? |
|
RickiusMaximus
Joined: 2005-12-06
Posts: 9 |
![]() |
Okaydoke, this works but the lines you have to enter the information are different. For the Matrix theme- 1. open theme.inc 2. go to line 84 and insert- Quote:
foreach ($childIds as $childId){ (Thats inside the Quote:
@see GalleryTheme::showAlbumPage section just before) Quote:
return array(GalleryStatus::success(), 'theme.tpl'); 3. open album.tpl 4. go to line 62 and change- Quote:
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$child.id`"}"> to Quote:
<a href="{g->url arg1="view=core.ShowItem" arg2="itemId=`$theme.firstImage[$child.id]`"}"> There is still one issue however, the navigator button at the top (gallery >> album >> photo.jpg) is still clickable and brings up this error message- Quote:
Fatal error: Call to undefined function: getorderby() in gallery\modules\core\classes\helpers\GalleryChildEntityHelper_simple.class on line 512 Any ideas for this? Or is disabling the link an easier option? |
|
RickiusMaximus
Joined: 2005-12-06
Posts: 9 |
![]() |
This error message also comes up if you attempt to add an image to the mainpage rather than in a subalbum (thus effectivly crippling your page) Can anyone help me with this? |
|
nivekiam
![]()
Joined: 2002-12-10
Posts: 16504 |
![]() |
Ah, so some additional logic may need to be added so it handles this gracefully. I be you'd have the same problem on other albums that contain sub-albums, maybe not though as I haven't tested this. Ouch, well I burned my hande tonight and can barely type. I'm done for the night. ____________________________________________ |
|
RickiusMaximus
Joined: 2005-12-06
Posts: 9 |
![]() |
Ive re-written a big chunk of the matrix album code inorder to differentiate between images and albums better- Quote:
{* Check if album with images*} But still no joy, the error appears as soon as tou add an image so the problem is somewhere in the theme.inc file, unfortunatly I'm way outta my depth when I get in there Can anyone give me a hint as to what might be causeing this? |
|
bayon86
Joined: 2008-12-02
Posts: 17 |
![]() |
I tried to use draco's code but it didn't work for me. The call to GalleryCoreApi::fetchChildItemIds($childEntity[1]); would give me errors when i was on subalbum pages. I spent quite a few hours puzzling this out, so I thought I would pass along the code, just in case anybody else wants to do this. I am using ebony theme, but i think this should will work with most themes. in gallery>themes>your-theme>theme.inc insert this code into function showAlbumPage Quote:
$firstImages = array(); then in your album.tpl page on this line: Quote:
{foreach from=$theme.children item=child} change to Quote:
{foreach from=$theme.children item=child key=k} the key=k will give you a number for the iteration of the foreach loop down further, depending on your theme, you will need to incorporate this code with the code that creates the links Quote:
{* if canContainChildren, it must be an album, so let's use the album's first photo id for the link *} hth. |
|
fmmcmillan
Joined: 2009-06-16
Posts: 18 |
![]() |
Has anyone done this successfully for the Carbon theme? |
|