coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: johanz on August 15, 2008, 07:24:27 PM

Title: Special tags and how to add your own?
Post by: johanz on August 15, 2008, 07:24:27 PM
You see themes have special tags like:
{GAL_NAME}
{LANGUAGE_SELECT_FLAGS}
{GALLERY}
etc.
So, how do I make my own tag like {banners} and it will show content from php,html page?
Title: Re: Special tags and how to add your own?
Post by: johanz on August 17, 2008, 03:02:05 PM
Anyone?
Title: Re: Special tags and how to add your own?
Post by: Nibbler on August 17, 2008, 03:11:57 PM
They are in the pageheader/pagefooter functions.
Title: Re: Special tags and how to add your own?
Post by: johanz on August 17, 2008, 07:31:48 PM
Can you explain if it is possible to add your own to a theme ?
Title: Re: Special tags and how to add your own?
Post by: Nibbler on August 18, 2008, 10:05:57 AM
Yeah. You copy the pageheader or pagefooter functions from the sample theme into your theme.php and modify that.
Title: Re: Special tags and how to add your own?
Post by: johanz on August 18, 2008, 11:34:45 AM
Okay,I found how to do that and now I need little help for stupid me.
I added {BANNERS} tag and made it to be $bannerpage
Now I need this $bannerpage to be include('banners.php')
Title: Re: Special tags and how to add your own?
Post by: Αndré on August 18, 2008, 11:51:09 AM
If 'banners.php' outputs the banners, try
'{BANNERS}' => include('banners.php')
Title: Re: Special tags and how to add your own?
Post by: Nibbler on August 18, 2008, 12:11:29 PM
'{BANNERS}' => cpg_get_custom_include('banners.php'),
Title: Re: Special tags and how to add your own?
Post by: johanz on August 18, 2008, 03:08:46 PM
Strange I added '{BANNERS}' => cpg_get_custom_include('banners.php'), to my pagefooter at the end, but in theme {BANNERS} remains the same. I dont get errors or anything
Title: Re: Special tags and how to add your own?
Post by: Nibbler on August 18, 2008, 03:10:45 PM
If {BANNERS} is before {GALLERY} it belongs in pageheader. If it's after {GALLERY} then it goes in pagefooter.
Title: Re: Special tags and how to add your own?
Post by: johanz on August 18, 2008, 03:14:03 PM
Aww, I am dumb :(
Where and what do I need to put to banners.php so it shows html  ::)
Title: Re: Special tags and how to add your own?
Post by: Αndré on August 18, 2008, 03:21:10 PM
Quote from: johanz on August 18, 2008, 03:14:03 PM
Aww, I am dumb :(
Where and what do I need to put to banners.php so it shows html  ::)

Some code, that returns something like
<a href="http://www.google.com"><img src="banner.png" /></a>
??? ??? ???
Title: Re: Special tags and how to add your own?
Post by: johanz on August 18, 2008, 03:26:02 PM
Okay everything works now,thanks. You can lock if needed
Title: Re: Special tags and how to add your own?
Post by: Αndré on August 18, 2008, 03:35:06 PM
Mark the thread yourself as solved by clicking on the hook in your first post.