Jump to content

Using PHP in the .TPL File


Recommended Posts

It works just fine for me so I suggested it, sometimes these things just work :) For example I have an image in mydomain.com/images/image.png, and in my html file located in mydomain.com/account/file.html I can do this just fine:

 

<img src="../../images/image.png">

Link to comment
Share on other sites

Root relative refers to document root, the main publicly viewable folder. There are three types of links:

  • Document relative.
    Links are made with the calling document as the starting point. ("file.ext", "../file.ext" or "../../file.ext"). The server looks for the file starting from where the link is called.
  • Root Relative.
    The server looks for the file starting at the lowest directory viewable by the public: the document root. This is done by using: "/file.ext" and signifies that the server should start looking for the file from the main folder (using cpanel, this is "/home/user/public_html"), no matter from where within the site it's referenced.
  • Absolute link.
    Using the whole URI to tell where to find something, as in "http://www.example.com/folder/file.ext". This will start by the server looking for that domain, then folder then file, all externally. PHP/Apache settings might prohibit that from working as an include, however.

Link to comment
Share on other sites

Root relative refers to document root, the main publicly viewable folder. There are three types of links:

  • Document relative.
    Links are made with the calling document as the starting point. ("file.ext", "../file.ext" or "../../file.ext"). The server looks for the file starting from where the link is called.
  • Root Relative.
    The server looks for the file starting at the lowest directory viewable by the public: the document root. This is done by using: "/file.ext" and signifies that the server should start looking for the file from the main folder (using cpanel, this is "/home/user/public_html"), no matter from where within the site it's referenced.
  • Absolute link.
    Using the whole URI to tell where to find something, as in "http://www.example.com/folder/file.ext". This will start by the server looking for that domain, then folder then file, all externally. PHP/Apache settings might prohibit that from working as an include, however.

 

{include file='http://hostwebsite.co.nz/includes/header.php'}?

Link to comment
Share on other sites

Mainly because of these:

<link rel="stylesheet" media="screen" type="text/css" href="<?=base_url()?>/includes/css/style.css" />

 

This doesn't appear to be defined: ?=base_url()?

You also have this showing in the page's code: "include('functions.php');". That likely means it's not being parsed properly and being sent to the page as literal text. Fix this one, and it may fix the rest?

 

 

You might consider hiring someone to help you through this (just don't do so on this forum, please, it's against the rules). ;)

Link to comment
Share on other sites

Mainly because of these:

<link rel="stylesheet" media="screen" type="text/css" href="<?=base_url()?>/includes/css/style.css" />

 

This doesn't appear to be defined: ?=base_url()?

You also have this showing in the page's code: "include('functions.php');". That likely means it's not being parsed properly and being sent to the page as literal text. Fix this one, and it may fix the rest?

 

 

You might consider hiring someone to help you through this (just don't do so on this forum, please, it's against the rules). ;)

 

The base_url is defined in the functions.php document and is all working 100% except in the clients folder.

 

Jess

Link to comment
Share on other sites

I am not sure what width to alter to change for it being to narrow?

 

For figuring out what to change, I'd highly recommend downloading the Firefox browser and the Firebug plugin for it, both free. It allows you to visually see the box model of the page (and change for testing in real time), and locate the element responsible for widths and so forth. Terrific tool for this.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated