Theme PageType
|
anandamd
Joined: 2008-06-26
Posts: 11 |
Posted: Fri, 2008-07-04 14:05
|
|
Hi, {if $theme.pageType == 'album'} also in the GalleryTheme.class it uses the following code fragment to decide which view is being requested. switch ($view->getViewType()) { I have also figured out that VIEW_TYPE_ADMIN and the rest is getting defined in GalleryConstants.class So if i want to do something like VIEW_TYPE_FOO and set it in the GalleryTheme.class, and then add the code given below to the theme.tpl to say {elseif $theme.pageType == 'foo'} how exactly do i go about doing this, where exactly in the code do I set VIEW_TYPE_FOO. Thanks |
|
| Login or register to post comments |

Posts: 11234
Perhaps a better explanation of what you want to do is in order.
Depending on what you want to archive it might be better to develop a module or a simple if statement in a template file to load the content. Far easier than editing core files where I will not be able to help out.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team.
Posts: 11
Hi Dave,
indeed i want to put a simple if statement in the theme.tpl to redirect to the custom.tpl that i have created. As mentioned earlier this done in the theme.tpl on the basis of $theme.pageType[i] , at the moment i am clueless about where $theme.pageType is getting populated in the code. Writing a new module to achieve this a very big penalty.
All you time and efforts are highly appreciated.
Thanks
@nand
Posts: 11234
How is your custom pageType set then?
Is it a album setting, theme setting, title setting, url parameter.
Please give a user story.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 11
Hi Dave,
my problem is same as in this one
http://gallery.menalto.com/node/42609
I am not trying to convert it to CMS though, I want it to be Gallery, all i want is that the theme.tpl redirect it to my new.tpl
Your time and efforts are always appreciated.
Best Regards
@nand
Posts: 4
Ya, Im facing the some problems too... if I add a new define in GalleryConstants.class. (ex. define('VIEW_TYPE_NEW', 6);) and adding a new case in GalleryTheme.class:
switch ($view->getViewType()) {
case VIEW_TYPE_NEW:
$theme['pageType'] = 'New';
...
and it will affect my frame setting. Could somebody help us for this?
Posts: 11234
So much for a good user story......
If you want to just pass in a url parameter do something like:
{if ($smarty.get.my_perameter == "ON")} ON {else} Off {/if}and the urls would be like:
gallery2/main.php?my_perameter=ON
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team