Welcome to Geeklog, Anonymous Friday, March 29 2024 @ 08:48 am EDT

Geeklog Forums

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


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

Status: offline

Laugh

Site Admin
Admin
Registered: 09/27/05
Posts: 1468
Location:Canada
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.
 Quote

All times are EDT. The time is now 08:48 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