n00dles101 Wrote:Say you wanted to have a different header image on each page. You would have something like this on your theme.
Code:<div id="header">
<img src="yourimage.jpg" alt="" />
</div>
Install the customfields plugin and edit or create /pages/other/customfields.xml
and add the following.
Code:<?xml version="1.0" encoding="UTF-8"?>
<channel>
<item><desc>image</desc><label>Header Image</label><type>text</type></item>
</channel>
Each <item> must have 3 parts,
desc - id of the customfield
label - what to display on the page edit form
type - type of field, either text or dropdown.
if type is dropdown add <option></option> tags with whatever you want in the dropdown menu
Now when you edit your pages you should have a new field "Header Image"
Change your template file to use the following instead
Code:<div id="header">
<img src="<?php getCustomField('image');" alt="" />
</div>
Simple example, check out http://cmstest.digimute.com
which uses 3 new fields to create the portfolio - subtitle, image and jobtype.
Hope it helps, let me know if you need more info.
Mike.
I would like to say thanks for making this plugin. It is exactly the thing I need for my problem plus I can use it for dynamicly change other pages without hassling to much with the code. But.....
How can one intergrate this in the Abacus theme ?
I have done the things in the quote. But I think things go bad when I put the div in the theme php.
Now all the pages go blank.
I know that Im a noob (dont tell anybody). I also know i am doing something wrong. I simply cant figure out what.
Please help ?