Special tags and how to add your own? Special tags and how to add your own?
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Special tags and how to add your own?

Started by johanz, August 15, 2008, 07:24:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

johanz

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?

johanz


Nibbler

They are in the pageheader/pagefooter functions.

johanz

Can you explain if it is possible to add your own to a theme ?

Nibbler

Yeah. You copy the pageheader or pagefooter functions from the sample theme into your theme.php and modify that.

johanz

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')

Αndré

If 'banners.php' outputs the banners, try
'{BANNERS}' => include('banners.php')

Nibbler

'{BANNERS}' => cpg_get_custom_include('banners.php'),

johanz

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

Nibbler

If {BANNERS} is before {GALLERY} it belongs in pageheader. If it's after {GALLERY} then it goes in pagefooter.

johanz

Aww, I am dumb :(
Where and what do I need to put to banners.php so it shows html  ::)

Αndré

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>
??? ??? ???

johanz

Okay everything works now,thanks. You can lock if needed

Αndré

Mark the thread yourself as solved by clicking on the hook in your first post.