How to change index.php home page in Gallery3

navdeep

Joined: 2012-10-04
Posts: 6
Posted: Thu, 2012-10-04 14:19

Hi all,

Gallery3 starts with index.php, which shows galleries. I want to modify that page so I can have a different "front page" using index.php.

So:

I need http://www.example.com/index.php to go to http://www.example.com/pages/show/home

The above URL is from a module called pages. A .htaccess redirect doesn't work, it gets too many redirects when trying to load that page, and search engines can't parse the redirect also.

Is there a way to a) change the index.php to show different stuff or b) a way to edit the php code so it loads the module page (pages/show/home) after loading the index.php page?

Thank you.

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 27300
Posted: Thu, 2012-10-04 16:01

The .htaccess file that ships with G3 has directions and examples to remove index.php
Some themes like the grey dragon theme have a 'splash'/'front page' page.

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
navdeep

Joined: 2012-10-04
Posts: 6
Posted: Thu, 2012-10-04 16:25

Hey Dave,

Thanks for the info. I have tried the .htaccess removing index.php from the url, which works. But I get too many redirects if I have the pages module load first, since the redirect isn't passing the vars via QSI.

I need the rule for something like this:

#RewriteRule ^index.php$ /index.php?page=home[QSA,L]
#RewriteRule ^$ "http\:\/\/example\.com\/index\.php\/pages\/show\/Home" [R,L]

 
navdeep

Joined: 2012-10-04
Posts: 6
Posted: Thu, 2012-10-04 16:28

Also the same thing is mentioned here, but I don't understand how to follow #1

http://gallery.menalto.com/node/103882

Hi All,
I created some dynamic albums and I would like one of those to be displayed when you land on the homepage instead of the All album. Ho can I do it?

Thanks in advance,
Ste

I guess there is several ways to go about this a couple that come to mind:
1. Make the dynamic album the 'landing' page from your other pages.
2. Use some rewrite magic/voodoo to redirect users to the page you want.
3. A custom theme.

Dave

 
navdeep

Joined: 2012-10-04
Posts: 6
Posted: Thu, 2012-10-04 16:56

Okay so made a default.html file which is loaded before index.php and doing a simple html redirect in side that.

Seems to work. Off to read https://docs.google.com/document/pub?id=1DQ1Tz177aX5ZsSgEbjYtYOBufJ0SYhgYvfJtA6snn2Y Dev handbook to see how to do it in PHP.

Any tips are appreciated.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2012-10-04 22:00

/gallery3/themes/your theme/views/page.html.php

<? if ( $theme->item() && $theme->item()->id == item::root()->id ): ?>
    <?= new View("my_cool_index.html") ?>
<? else: ?>
    show the regular page
<? endif ?>

that's how I'm doing it here.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
navdeep

Joined: 2012-10-04
Posts: 6
Posted: Thu, 2012-10-04 23:21

Suprsidr - Perfect! Thanks

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2012-10-04 23:29

Create one or more sub-albums in your root album(place all others in these sub-albums), and in your intro, link to these sub-albums.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
navdeep

Joined: 2012-10-04
Posts: 6
Posted: Fri, 2012-10-05 00:08

Okay, this works, but is there a way to display the root gallery album somewhere else? I can work around not having it by using the Organize Album to view whats in it, but this would be nice to still be able to see the root gallery folder.

I want my cake and to eat it too. :/

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-10-05 00:12

Make a new root gallery
Create one root -> sub-album to hold all other albums

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Fri, 2012-10-05 00:14

in my example, the "enter" button takes you to FYW Demo album which is the only sub-album off root

of course I could have multiple enter buttons and multiple sub-albums to add categories/events/dates....

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
dstalls

Joined: 2010-04-06
Posts: 6
Posted: Sun, 2013-08-18 00:41

SUPRSIDR, where in the "/gallery3/themes/your theme/views/page.html.php" do you add that line? I am trying to do this but I am not sure where to put the code.

 
dstalls

Joined: 2010-04-06
Posts: 6
Posted: Sun, 2013-08-18 00:43

SUPRSIDR, where in the "/gallery3/themes/your theme/views/page.html.php" do you add that line? I am trying to do this but I am not sure where to put the code.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Sun, 2013-08-18 01:46