htmlblock - Default FrontPage.tpl for anonymous\guest users only?
ntrantham
Joined: 2008-10-14
Posts: 15 |
Posted: Mon, 2009-08-31 23:37 |
Get system details; useful for copy/paste into G2 support forum. Gallery URL = http://mygallery.localhub.com/main.php Module: HTML Blocks ver. 0.0.2 I have followed the guide outlined in the wiki for creating a default homepage. It works. What I would like to be able to do though is have this default page only show up for guests\users not logged in. When a new person comes to the site, I would like the splash page to open, but once they are logged in it would take them to the default album view that shows the theme's normal default album view. I have tried modifying the main.php with this: /* Serban: if not embedded and empty view, nor a path, nor an item specified list ($ret, $isAnonymousUser) = GalleryCoreApi::isAnonymousUser(); if ($ret && $viewName<>'core.UserAdmin' && !$gallery->isEmbedded() && empty($itemId) && empty($rewritePath) && empty($page)) { Instead of what was in the wiki, but it does not work, it displays the htmlblock no matter what. I have tried taking out all of the conditions for the if statement, if making the condition something like if (1=2) but it would still display the htmlblock. It is almost like it is ignoring the if statement conditions and will execute the next line no matter what. Can someone please point me in the right direction? I am by no means a coder, and have just been working on this for a few hours. Thanks. |
|
Posts: 15
Nevermind I figured it out...
For those that are interested...
I copied the album.tpl from the theme folder to local and added this at the top:
{if $user.userName == 'guest'}
<div>
{g->block type="htmlblock.HTMLBlock" file="index.html"}
</div>
{else}
and then at the very bottom added {/if}
This way, if the user is not logged in it will redirect them to the index.html file. Once logged in, everything is normal.
Right now my index.html file is just a "Hello World" but I did copy the album.tpl file to it as well so that the look is the same. My Splash page will now look the same as every other page in my Gallery.
Posts: 27300
please update the docs for this module if they are not clear:
http://codex.gallery2.org/Gallery2:Modules:htmlblock
Docs are for users by users.
Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team
Posts: 15
I gave up on the html block module. I could not figure out how to even get img tags to work properly in it. So, I modified my entry in the album.tpl file, instead of referencing the html block I just created the html right there.
I am at work right now and can not ftp into my site to copy\paste the code, but you can see it in action by going to mygallery.localhub.com
Thanks.
Posts: 118
I'm looking for the same thing, except I use miniCMS and pointing to html files is pointless.