Jump to content

Recommended Posts

Posted

Err, heading should read 'Adding image to template via code' :\

Hi all

I am trying to add an image to a template manually, via code. I want this image to appear on all pages using this template. Looking through the forums, I see many threads on adding images, but I couldn't find any suggestions that helped in my situation.

I have tried:

$remind = "<img src='http://kathep.com/site/templates/img/remind.png' type='image/png' width='400px'>";

$content = $remind;
and 
$remind = "<img src='http://kathep.com/site/templates/img/remind.png'>";

$content = $remind;
and, based on this post by Ryan
$remind = $page->image = 'http://kathep.com/site/templates/img/remind.png';

$content = $remind;
The path to the image is valid, but in each instance the image doesn't show up.

Can you point out what I'm doing wrong?

Posted

Err, heading should read 'Adding image to template via code' :\

You can just edit the first post and choose "Use Full Editor" to edit the topic title.

  • Like 1
Posted

UPDATE: Just got it to work using:

$remind = "<img src='http://kathep.com/site/templates/img/remind.png'>";

$content = $remind; 

I discovered my FTP client (Transmit) was not updating my experiments due to a weird later timestamp on the remote copy of the file.

There's nothing like posting to the forum to make things seem obvious that seemed unsolvable before posting.

Hopefully documenting this simple noob error will help someone else  :undecided:

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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