vanberla
vanberla

Reputation: 81

Display images on Joomla

I just can't seem to display my images in Joomla. Here is an example of my code:

<a href="/img/Zaalvoetbaltornooi SKLA 2.jpg" rel="shadowbox"><img src="/img/Zaalvoetbaltornooi SKLA 2.jpg" width="200px" height="250px" alt="Fuif SLKA" id="eventskla" />

As you can see it also uses shadowbox which doesn't work. Here is a screenshot of my folders:

enter image description here

And a screenshot of templateDetails.XML:

enter image description here

Can anyone tell me what I'm doing wrong? Options in Joomla wrong or wrong code?

Upvotes: 0

Views: 53

Answers (2)

Chris Cather
Chris Cather

Reputation: 30

Just as a friendly tip, I like to create a variable called "tpath", which is the path to the template. It makes the paths I have to write in the template much shorter. I just create the variable in the Head like so:

$tpath = $this->baseurl.'/templates/'.$this->template;

Now all you have to do to write a template URL is:

href="<?php echo $tpath; ?>/...

Upvotes: 0

vanberla
vanberla

Reputation: 81

I found it: I used the 'normal' way of coding but the code you have to use is this one:

<img src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/myimage.png" alt="Custom image" class="customImage" />

Then simply change the map and image (e.g. /img/base.jpg) you're using in Joomla.

Upvotes: 3

Related Questions