I am working on creating my own templates for Gallery. I would like for the first page (what you would see if you were looking at the 'gallery' top album - to look different than the regular album view pages. What would be the correct way to do this in code?
Is there some variable I should check for to see if the main page is being loaded? I was thinking I could just see if the item name is == 'gallery'. But, I am sure there is a better way.
To repeat, I have a albumView template, singleView template, and now a frontPageView template. I need to know the correct way to determine if the user should be in frontPageView.
Also, I hear g3b4 changes the templating/layout/themes system completely. Any idea of a release date for g3b4?
Thank you,
Posts: 32509
if there is a release date for beta 4? no, sorry. it has been delayed because of the uber important layout/theme change. i guess 2 weeks from now is a good estimate.
i'd wait with creating your own templates until this layout/theme change is in. it will change quite a lot of things.
@showing a different page for the top album.
hmm, don't know a good method at the moment. but i'm sure there are.
one method that isn't particularly very good, i guess, would be to replace the
/* Load and run the appropriate view */
if (empty($viewName)) {
$viewName = 'core.ShowItem';
}
code in main.php, which is responsible for defaulting to show the top album if you browse to gallery2/ without any arguments in the url.
in modules/core/ShowItem.inc it defaults to show the root album when no other itemId is set.
is it possible to deal with it on the layout/theme level instead of hacking the code?
in layouts/matrix/templates/albumBody.tpl you could check if the $layout.item.id (or something like that) is the same id as the root album id and if so, display something different / additional than on other pages), e.g. a single huge {if} {else} {/if} around the whole page.
Posts: 35
Alright, this is what I was thinking. Yeah, I want to do it at the layout/heme level, definitely - I just didn't know if there was a more proper way than just checking the album id. I will just do it this way. Thank you!
Posts: 35
Oh, what all is changing in b4 as far as layout/theme is concernced? Will everything still be CSS based (I hope)? smarty based? etc.
Posts: 32509
basically, there layout+themes will be replaced by just a single system that we call themes.
and the theme will have more control over the whole page than the current layouts.
there will be a lot of new things, e.g. blocks, etc.
of course it will be still xhtml, css, smarty, templates based.
it's gonna be a huge change.