Status: offline

odieolson

Forum User
Newbie
Registered: 11/24/21
Posts: 1
How can I test in the header.thtml (via PHP) whether the site is on the front page? I want to display an image, but only on the front page. I know I can do it in a static page centerblock, but that forces white space around the image. I want it flush against everything. If I place it in the header, it displays nicely, but on every page. I only want it on the front page.

Any ideas?

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Take a look at the Geeklog Caching Template Library Wiki page:

http://wiki.geeklog.net/index.php/Caching_Template_Library

It shows how you can use logic in your template and how to access default template variables like

'xhtml'
'image_type'
'site_url'
'site_admin_url'
'layout_url'
'anonymous_user'
'device_mobile'
'front_page'
'current_url'

and how to use the built in logic like:

Text Formatted Code
{!if front_page}

<p>Place HTML here that will only show on front page</p>

{!endif}

One of the Geeklog Core Developers.