How to add a text to gallery on homepage only?

bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 417
Posted: Tue, 2011-12-27 07:44

How to add a text to gallery on homepage only? Or in all subpages only?

Thanks.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7894
Posted: Tue, 2011-12-27 11:50

The homepage is nothing more than an album itself(root album)
Edit album and add a description.

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

 
bigu_c
bigu_c's picture

Joined: 2007-10-28
Posts: 417
Posted: Tue, 2011-12-27 11:56

But I don't want it showing on domain/?page=2

How can I do?

Thanks.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7894
Posted: Tue, 2011-12-27 12:17

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

Where you want your text/html to appear:

<? if ( $theme->item() && $theme->item()->id == item::root()->id ): ?>

  <h2>My fun html will show up here.</h2>
  <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>

<? endif ?>

I moved all my subalbums into a new base album and I show a slideshow on the root page using this technique.
http://www.flashyourweb.com/gallery3/

-s

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25967
Posted: Tue, 2011-12-27 22:27

FYI this is already documented:
http://codex.gallery2.org/Gallery3:Tutorials:Themes#Adding_stuff_to_root_album_only

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 7894
Posted: Wed, 2011-12-28 01:03
 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25967
Posted: Wed, 2011-12-28 01:58

I might be better at guessing key words:
http://www.google.com/search?q=site:gallery.menalto.com+root+album+only+G3
Google is my friend :-)

Dave

_____________________________________________
Blog & G2 || floridave - Gallery Team

 
customize

Joined: 2011-12-28
Posts: 2
Posted: Wed, 2011-12-28 05:58

Hi, so how would one go about adding text to a specific album or photo page?

For example, on album ABC I want to add a paragraph of text (ideally on top of the row of photos) which contains some HTML links (a href=...).

Also, is there any recommended way to add articles to these types of websites? For example, I just want to add a new article that consists of only text, but it still uses the theme/design of the main website.

Thanks in advance for any help!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25967
Posted: Wed, 2011-12-28 06:10
Quote:
how would one go about adding text to a specific album or photo page?

suprsidr wrote:
Edit album and add a description.

Each item (albums and photos) have the capability of adding a description.

Quote:
which contains some HTML links (a href=...).

If you want html link you will need the purifier module.
http://codex.gallery2.org/Gallery3:Modules:purifier

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
customize

Joined: 2011-12-28
Posts: 2
Posted: Wed, 2011-12-28 20:17

Thanks floridave, I was able to load the purifier module and add HTML links in the description!

My last question is, do you know of anyway I can basically have a large block of text "above" an album's photos? Or in the case of a photo page, above the photo itself?

Basically, I want to be able to have a few paragraphs (with HTML links) above an album's images or above a photo. Earlier in this thread, Suprsidr showed a way to do that easily for the homepage with a few lines of code, and I was wondering if there was a way to do that for a specific album or photo page.

Thanks!

 
floridave
floridave's picture

Joined: 2003-12-22
Posts: 25967
Posted: Wed, 2011-12-28 20:43
Quote:
for a specific album or photo page

Is a lot more work and gets complex if you want it to show to more than a few pages. I would use the description and add html there.
The other option is the custom fields module.
http://codex.gallery2.org/Gallery3:Modules:custom_fields
once installed you might want to look at this thread: http://gallery.menalto.com/node/103755

Dave
_____________________________________________
Blog & G2 || floridave - Gallery Team

 
undagiga

Joined: 2010-11-26
Posts: 643
Posted: Wed, 2011-12-28 21:26
customize wrote:
Basically, I want to be able to have a few paragraphs (with HTML links) above an album's images or above a photo.

The Greydragon theme has this as an option for album pages, including the homepage. There is a theme option to display the album description above the thumbs. For some reason you won't need the Purifier module to display html.

For photo pages, you could use the "About this photo" module to display the photo description in the sidebar. If you want it above the photo, you'd need to hack the theme.

U-G