logo
g Text Version
Beauty & Self
Books & Music
Career
Computers
Education
Family
Food & Wine
Health & Fitness
Hobbies & Crafts
Home & Garden
Money
News & Politics
Relationships
Religion & Spirituality
Sports
Travel & Culture
TV & Movies

dailyclick
Bored? Games!
Nutrition
Postcards
Take a Quiz
Rate My Photo

new
European Travel
Action Movies
Bible Basics
Houseplants
Romance Movies
Creativity
Family Travel


dailyclick
All times in EST

Full Schedule
g
g Digital Art and Design Site

BellaOnline's Digital Art and Design Editor

g

Gallery 2 Custom theme.inc file


Now that we are familiar with the layout of the Gallery 2 directory, we can begin to create our new theme. We have already made a copy of the Matrix theme folder and renamed it to the name for our new theme. For this example, the name of the new theme is dCipollo. But you can name your theme anything as long as it contains only alphanumerics and underscores. This tutorial is part of a group of tutorials about how to use the Gallery 2 software as an online portfolio. See the links below to read the previous tutorials.

The first step is to make some changes to the theme.inc file. Even though we gave our new theme a name when we renamed the folder, we still need to tell Gallery that this is a different theme from the Matrix theme. To do this, we will change a few lines of code in the theme.inc file. Open the theme.inc file in your text editor (not in Word or another word processing editor).

Here is the code with the areas that we will change highlighted. As you can see, we are changing the name, called a theme ID, from Matrix to the name of our theme. Here is what your new theme.inc code should look like.

  1. * REVISION OF THE MATRIX THEME

    First we will add a line of code after line 21. We don't want to claim that this theme is anything but a customization of an existing theme by Bharat Mediratta. So we will put the text "*REVISION OF THE MATRIX THEME" on this new line. Don't omit the * in front of the text. This tells the server that the text is a comment and not part of the executable code.

  2. class dCipolloTheme extends GalleryTheme {

    On Line 29, we will use our theme name in the class code by changing MatrixTheme to "dCipolloTheme".

  3. function dCipolloTheme() {

    On line 31, we will again change the MatrixTheme to "dCipolloTheme".

  4. $this->setId('dCipollo');

    On line 34, we will change Matrix to "dCipollo".

  5. $this->setName($gallery->i18n('dCipollo'));

    On line 35, we will change Matrix to "dCipollo".

  6. $this->setDescription($gallery->i18n('REVISION MADE TO MATRIX THEME'));

    On line 36, we will add the text REVISION MADE TO MATRIX THEME as our description.

  7. $this->setVersion('1.1.1');

    On line 37, we will start our version numbering at 1.1.1.

Now we can return to the Site Admin control panel and change the default template from Matrix to our new theme.



Join us in the Digital Art and Design forum.



Add Gallery+2+Custom+theme%2Einc+file to Twitter Add Gallery+2+Custom+theme%2Einc+file to Facebook Add Gallery+2+Custom+theme%2Einc+file to MySpace Add Gallery+2+Custom+theme%2Einc+file to Del.icio.us Digg Gallery+2+Custom+theme%2Einc+file Add Gallery+2+Custom+theme%2Einc+file to Yahoo My Web Add Gallery+2+Custom+theme%2Einc+file to Google Bookmarks Add Gallery+2+Custom+theme%2Einc+file to Stumbleupon Add Gallery+2+Custom+theme%2Einc+file to Reddit



 



RSS | Related Articles | Editor's Picks Articles | Top Ten Articles | Previous Features | Site Map


For FREE email updates, subscribe to the Digital Art and Design Newsletter


Past Issues


print
Printer Friendly
bookmark
Bookmark
tell friend
Tell a Friend
forum
Forum
email
Email Editor


Content copyright © 2014 by Diane Cipollo. All rights reserved.
This content was written by Diane Cipollo. If you wish to use this content in any manner, you need written permission. Contact Diane Cipollo for details.

g


g features
Getting Started Photoshop Elements by TeachUcomp

Scalloped Circle and Illustrator Shape Builder

Honeycomb Xmas Ornament SVG Cut Design

Archives | Site Map

forum
Forum
email
Contact

Past Issues
memberscenter


vote
Poetry
Daily
Weekly
Monthly
Less than Monthly



BellaOnline on Facebook
g


| About BellaOnline | Privacy Policy | Advertising | Become an Editor |
Website copyright © 2014 Minerva WebWorks LLC. All rights reserved.


BellaOnline Editor