How to get a landing page like the one on flashyourweb.com/gallery3

suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7886
Posted: Fri, 2012-03-23 13:21

I was asked in my forums how to get a landing page like mine and figured this was a better place to respond:

Quote:
Re: How to make landing page like you...

It was kind of a hack, but here goes:

  • Move all albums to one root level sub album - this gives landing page for "Enter" button
  • Edit themes/your theme/views/page.html.php directly at the top
    <?php defined("SYSPATH") or die("No direct script access.") ?>
    <? if ( $theme->item() && $theme->item()->id == item::root()->id ): ?>
      <? define($showIntro, true) ?>
    <? endif ?>
    

    this gives us our $showIntro variable to test against where ever we want/need.

  • Now with the power of $showIntro we can add our own html, javascript, css etc:
    <? if ( defined($showIntro) ): ?>
      <script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
    <? else: ?>
      <?= $theme->script("jquery.js") ?>
    <? endif ?>
    

    My slideshow requires a newer jQuery than G3 provides

  • To make it easier to manage the larger amount of html to insert for our intro page, I created themes/your theme/views/intro.html.php and include it where I need like:
    <? if ( defined($showIntro) ): ?>
      <?= new View("intro.html") ?>
    <? else: ?>
        <div id="yui-main">
          <div class="yui-b">
            <div id="g-content" class="yui-g">
              <?= $theme->messages() ?>
              <?= $content ?>
            </div>
          </div>
        </div>
    <? endif ?>
    
  • Only show the sidebar when not in intro mode:
    <? if ( !defined($showIntro) ): ?>
    <div id="g-sidebar" class="yui-b">
      <? if ($theme->page_subtype != "login"): ?>
      <?= new View("sidebar.html") ?>
      <? endif ?>
    </div>
    <? endif ?>
    

For the cool slideshow I included in the intro.html.php I used the free open source Galleria javascript image gallery by Aino.
Instructions to use w/G3 here.
Two other examples here and of course here.

I can supply the complete page.html.php and intro.html.php files if anyone wants them.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

AttachmentSize
page.html_.php_.txt14.07 KB
intro.html_.php_.txt4.26 KB
 
vbhosale

Joined: 2011-03-18
Posts: 3
Posted: Fri, 2012-03-23 13:28

this really helps..a big thanks to you suprsidr ..if needed I will post my questions here

 
vbhosale

Joined: 2011-03-18
Posts: 3
Posted: Sat, 2012-03-24 02:48

suprsidr can you please send me page.html.php and intro.html.php to me at vaibhavpbhosale[at]gmail[dot]com ? I don't want to mess up with current installation and don't have much knowledge of PHP. Those file will be great help me to. Thanks for all your help.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7886
Posted: Sat, 2012-03-24 03:13

I attached them above.

Keep in mind that I'm using the default Wind theme, yours would differ.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
vbhosale

Joined: 2011-03-18
Posts: 3
Posted: Tue, 2012-03-27 04:48

suprsidr just wanted to let you know that I was able to follow above steps and come up with this http://www.vaibhavbhosale.com/photogallery/index.php/. I will be working on the appearance to match the theme I have.. thanks for all your help

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7886
Posted: Tue, 2012-03-27 11:59

there is a section of "suprsidr's adjustment CSS" that you can remove.

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7886
Posted: Tue, 2012-03-27 12:02

you can also remove all this:

              $("#g-site-menu>ul").prepend('<li><a href="/">Main Site</a></li>');
              $("a.g-menu-link:contains('Home')").text('Gallery Home');
              var h = $('#g-info>div').html();
              if(h) $('#g-info>div').html(h.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi, '<a href="$1" target="_blank">$1</a>'));
              var h = $('ul.g-metadata>li:contains("Description:")').html();
              if(h) $('ul.g-metadata>li:contains("Description:")').html(h.replace(/((ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?)/gi, '<a href="$1" target="_blank">$1</a>'));

-s
FlashYourWeb and Your Gallery with The E2 XML Media Player for Gallery2

 
grantiago

Joined: 2002-08-23
Posts: 78
Posted: Tue, 2013-02-12 02:54

suprsidr: I stumbled upon your landing page and thought, 'this is what gallery needs! Thanks for the pointers. I have your hacks running (sort of) on a g3 install with wind theme. I'm getting an error:

Quote:
Fatal error: Could not extract a stage height from the CSS. Traced height: 0px

But the slides are coming through and the links and animation and thumbs are all working. Somewhat slow on the load.

if I check it with firebug it shows:

Quote:
<div id="galleria" style="position: relative;">
<div class="galleria-container notouch" style="width: 640px; height: 420px;">
<div class="galleria-errors" style="color: rgb(255, 255, 255); position: absolute; top: 0px; left: 0px; z-index: 100000;">

I'm using galleria-1.2.9.min.js
and the classic theme it came with. (If and when I get this running I will buy a paid theme).

I like your mods to the g3 menu bar but they don't come through on the landing page. just a stack of links on top of the logo. After clicking enter, they come through fine.

Whoops I had the intro slides size fixed, but now the thumbs along the bottom are hidden behind the bottom of the frame again. I had made the "welcome slides" smaller to achieve this -- I think.

thanks again. I'm tired at this point and could use a little help. the test is http://www.grantamaral.com/test/

ga

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7886
Posted: Tue, 2013-02-12 03:30

1st you'll want to dial back the version of jQuery to 1.7.x ish
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.js"></script>
to:
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
grantiago

Joined: 2002-08-23
Posts: 78
Posted: Wed, 2013-02-13 05:37

Thanks! The jquery change fixed the top menu.
I bought the theme twelve and the 'Could not extract a stage height from the CSS' error is gone
And with Twelve, Galleria fits nicely in the stage or div you created.
In the future I will figure out how to tweak the div and galleria stage sizes to accommodate different themes. I do like the classic.

I initially put all the galleria js in the wind theme js directory. It was veeerrry slow and I was getting a timeout error from galleria. I moved it to a directory in the root and things sped up. Once again I might be imagining this.

Thanks for the initial post, idea and your feedback! I am pretty damn happy with my landing page.