Welcome to Geeklog, Anonymous Friday, June 14 2024 @ 12:13 pm EDT

Geeklog Forums

How to include HTML file in THTML file


Status: offline

deepak1155

Forum User
Chatty
Registered: 01/15/08
Posts: 35
Hi to all

I am using geeklog 1.4.1 , I want to include a HTML file in the HEADER.THTML. I have tried normal way like <!--#include file="abc1.html"--> , but it is not working. Please help me how to include a file.

Thank you all
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
The "normal way" is called Server Side Includes (aka SHTML) and doesn't work within Geeklog.

You can, however, use PHP in header.thtml (and only in header.thtml). Try this:
Text Formatted Code
<?php echo file_get_contents("{layout_url}/blah.html"); ?>

(assuming "blah.html" is in your theme's directory).

bye, Dirk
 Quote

Adam Moro

Anonymous
confused
How would this be accomplished in the footer (as you said, using php outside of the header isn't possible)? I'm trying to include my template files in the footer but nothing seems to work. Thanks in advance! btw, love Geeklog! It's simply awesome.
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
As I said, header.thtml is the only template file where PHP code can be used.

Not sure what you're trying to do. footer.thtml is a template file, so why would you want to include another template into that template?

bye, Dirk
 Quote

Adam Moro

Anonymous
I understand that. To put it as simply as I can, I'm trying to make the GL install fit inside my site's theme. I'm achieving this currently with an iframe and some js to break out of the iframe (for links that point to the index of the GL directory). What I'd like to do is simply include my template files in the Geeklog template files. Please let me know if my question is still unclear and I'll see if I can get some help with the terminology to better ask what I'm asking. Thanks again!

Adam
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Yeah, I understand what you're asking now. Your options are:

- Copy what you need from your site's theme into Geeklog's footer.thtml (thus duplicating things and making updates a pain).

- Write a replacement function for COM_siteFooter. There's actually a hook in Geeklog for that: The function needs to be called (themename)_siteFooter, e.g. professional_siteFooter() for the Professional theme.

Depending on you PHP knowledge, this shouldn't be too hard. You can copy most of the code from COM_siteFooter and then add whatever you need to include the template from your "other" theme.

bye, Dirk
 Quote

Adam Moro

Anonymous
awake
Thanks Dirk. That helps a lot.
 Quote

All times are EDT. The time is now 12:13 pm.

  • 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