Welcome to Geeklog Thursday, December 09 2021 @ 05:11 am EST

Geeklog Forums

How to test in header whether site is on Home (ie front) Page?


Status: offline

odieolson

Forum User
Newbie
Registered: 24/11/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?
 Quote

Status: offline

Laugh

Site Admin
Admin
Registered: 27/09/05
Posts: 1440
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:

PHP Formatted Code
{!if front_page}

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

{!endif}

One of the Geeklog Core Developers.
 Quote

All times are EST. The time is now 05:11 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content