HEADER IMAGE - in each article of a category

Discuss the development and implementation of Joomla! 1.0.x templates here.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Locked
stuartdinnie
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Sep 18, 2009 8:48 am

HEADER IMAGE - in each article of a category

Post by stuartdinnie » Fri Sep 18, 2009 9:13 am

Hi all

first post here on joomla forum. have been working with Joomla for about a year so not a newby particularly, but am struggling to find a decent solution to this.

I want to show a standard image on the first page of a category listing, and within each article. The image is a sponsor logo, which just needs to sit at the top of each the article. At the minute, i am simply putting it in article manually, but this is not a practical solution as the sponsor may change as time passes.

I realise, I could probably copy the current template, have a tinkle with it and assign it to this category only, but the client needs the ability to change the image themselves and they do not have the technical ability to be changing templates.

So to clarify, i need a standard image to appear at the top of each article, within a blog layout called blog (section) > blognews (category).

I have managed to put the image at the top of the blog article listing already.

any ideas would be great


thanks in advance

stuart

TurtleTurtle
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Sat Aug 08, 2009 12:59 am

Re: HEADER IMAGE - in each article of a category

Post by TurtleTurtle » Tue Oct 27, 2009 3:29 pm

I'm trying to do the same thing for my site.

Anyone? ???

thugsb
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Dec 10, 2009 9:56 am

Re: HEADER IMAGE - in each article of a category

Post by thugsb » Wed Jan 13, 2010 11:58 am

Unfortunately what you're trying to do seems to be very hard for Joomla, although it really shouldn't be.

The best solution I've found so far is to use a custom HTML module with the image, that is set to only display on those pages, and will appear in the right place (assuming your template has the option of putting a module in that place). There really should be an extension to do this, but I've not found one yet. :(

Stu

walg
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Thu Nov 20, 2008 10:00 pm

Re: HEADER IMAGE - in each article of a category

Post by walg » Sat Jan 30, 2010 12:35 am

I use the banner image component placed in a module position.

You can see an example of this on the following website:
http://www.m-v-t-i.com/index.php/Campus ... ew-Mexico/

thugsb
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Dec 10, 2009 9:56 am

Re: HEADER IMAGE - in each article of a category

Post by thugsb » Mon Feb 01, 2010 11:05 am

The solution here is what we're all after (thanks to Ronze):

http://youcanjoomla.com/component/conte ... meter.html

Text posted below:
Last year, I was making an online newspaper with Joomla, and I had to be able to send images as article parameters. Why? Because if you're only able to insert images into the article body, then you're quite handicapped when it comes to placing that images in a newspaper design. I wanted a frontpage where my article image was on top, then my author name and date, and then came the article text. This was not possible when inserting the article image into the article text.

What I found out was, that it's actually quite simple. All you have to do is locate the file: administrator/components/com_content/models/article.xml.

In this file is an XML list with all article parameters. If you want to be able to select an image from your default images/stories directory, then simply put this line into the "Advanced" group:

Code: Select all

<params group="advanced">

<!--This is the line -->

<param name="articleimage" type="imagelist" directory="/images/stories" 
hide_default="1" default="" label="Article Image" description="Image" />

<!-- End of line-->
Now, in your layout files inside of the html folder in your template, you're able to use this parameter to display the image whereever you want to. This is how you get the path to the image:

Code: Select all

<?php if ($this->item->params->get('articleimage')) : ?>
<img src="/images/stories/<?=$this->item->params->get('articleimage')?>" />
<?php endif; ?>
It's a neat way to be able to control your images, and remember that you can make as many custom parameters as you want!


Locked

Return to “Templates & CSS - 1.0.x”