
Theo
Project Manager
/ Moderator

Oct 20, 2006, 1:57 PM
Post #6 of 22
(5549 views)
Shortcut
|
|
Re: [Ginslinger] Template question
[In reply to]
|
Can't Post
|
|
Single author image for each author and it will display on the article page either at the top or bottom. What I would like to do is have it display right below the category breadcrumb. Each author is a sub of the reviews category. Currently there are only four or five that would need to be setup for now. Thanks for the reply, Ginslinger! Okay, here's what I'd do: 1) Go to Admin > Database, click on "edit table..." for Categories. 2) Click "Add field" 3) For Field Label, put "Author Image (for Reviews)", and Field Name should be "authorImage". Set Field Type to Upload. 4) For Field Options, it should default to Single File (if not, select it). If desired, you could set some values for Input Validation, or rely on your defaults. Click SAVE. 5) Now open templates/articlePages/articlePage.html. Put this code where you want the author image to appear (customize the HTML to suit your tastes):
<!-- templateInsert : $category.authorImage$ --> <!-- templateCell : category.authorImage.row --> <img src="$file.WebUrl$" width="$file.width$" height="$file.height$" align="left"> <!-- /templateCell --> Note that the HTML will only be generated when you actually have an Author Image. If there is OTHER html you want to include, to offset the placement of the image, it's a simple matter of adding it to a templateIf:
<!-- templateIf : $category.authorImage$ ne "" --> <EXTRA HTML HERE> <!-- /templateIf --> 6) Use FTP to upload your modified articlePage.html template, then go to your various Reviews categories and upload your author pics! Thanks for your questions, Gins, this is really a great illustration of how you can do things slightly differently for one category with one simple field, rather that a completely different template and publishing rule! Theo Wiersma Project Manager
|