- Posts: 55
COMMUNITY FORUM
Featured Image
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
BBC said:
Did you make this huge spacing by purpose ? Or is it template problem.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- Terry Britton
-
- Offline
- Elite Member
- Posts: 198
You can use the following to insert an image in item.php or category_item.php based on whether it is featured or not:
<?php if ($this->item->featured) : ?>
<img class="featured-image" src="/stories/icons/featured.jpg" alt="featured article"></img>
<?php endif; ?>
You would put this in the template at a location where you want the image to be. Obviously your html for the image would be different. You would then just have to play around with the positioning and the css to get the exact look you want.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
That´s why i asked for more details.
Please Log in or Create an account to join the conversation.
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
- Posts: 55
Terry A Britton said:
I always laugh at people who completely miss the actual question being asked, and here I did the same thing.
You can use the following to insert an image in item.php or category_item.php based on whether it is featured or not:
<?php if ($this->item->featured) : ?>
<img class="featured-image" src="/stories/icons/featured.jpg" alt="featured article"></img>
<?php endif; ?>
You would put this in the template at a location where you want the image to be. Obviously your html for the image would be different. You would then just have to play around with the positioning and the css to get the exact look you want.
Please Log in or Create an account to join the conversation.
- Terry Britton
-
- Offline
- Elite Member
- Posts: 198
The image in the category listing is wrapped by a div (catItemImageBlock). Within that same div in category_item.php you could put the following code. Sorry I can't give you an exact line number but my files are all heavily modified so the line numbers wouldn't match yours. Just search for catItemImageBlock.
<?php if ($this->item->featured) : ?>
<span class="featured">Featured</span>
<?php endif; ?>
You would then use css to position the text and style it the way you want to. I don't think you'll need z-index if you do it with text, but if you do, just put "z-index:99" in the css for featured. Backup your files before you start and hopefully someone else can step in if you have more questions.
Please Log in or Create an account to join the conversation.
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
- Posts: 55
Terry A Britton said:
I'm getting ready to go on the road for a couple of weeks and won't be on the forum much, so I'll try to give you enough to get you started. I couldn't really see what you where talking about in the link you provided so I'll give you a couple of options. Firstly, you could display text over the image that says "Featured" or you could display an image in front of the other image that highlights the fact it is featured. If you do it with an image you will have to use z-index which allows you to stack items on top of each other, the higher the z-index the closer it is to the viewer.
The image in the category listing is wrapped by a div (catItemImageBlock). Within that same div in category_item.php you could put the following code. Sorry I can't give you an exact line number but my files are all heavily modified so the line numbers wouldn't match yours. Just search for catItemImageBlock.
<?php if ($this->item->featured) : ?>
<span class="featured">Featured</span>
<?php endif; ?>
You would then use css to position the text and style it the way you want to. I don't think you'll need z-index if you do it with text, but if you do, just put "z-index:99" in the css for featured. Backup your files before you start and hopefully someone else can step in if you have more questions.
Please Log in or Create an account to join the conversation.
- Terry Britton
-
- Offline
- Elite Member
- Posts: 198
Please Log in or Create an account to join the conversation.
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
- Posts: 55
Terry A Britton said:
One more thing you'll probably have to set the div (catItemImageBlock) and the span (featured) to either float:left or float:right (both to the same) so you can display one on top of the other.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
- Posts: 55
i192.photobucket.com/albums/z133/nintendonerds/params.png
BBC said:
He.....go to your category in Admin Panel and enable everything for "Fatured" under Categor< and "Item view options in category listings" options.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
'Featured' notice (next to title) -> show
Please Log in or Create an account to join the conversation.
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
- Posts: 55
BBC said:
"Item view options in category listings" 'Featured' notice (next to title) -> show
Please Log in or Create an account to join the conversation.
- Terry Britton
-
- Offline
- Elite Member
- Posts: 198
Put the following code in category_item.php right after <div class="catItemHeader">. Line 41 or so.
<?php if ($this->item->featured) : ?>
<img class="featured-image" src="/stories/icons/featured.jpg" alt="featured article"></img>
<?php endif; ?>
Change the path to match the location of your image and then add this css to your css file:
.featured image {float:right;z-index:99;}
The z-index probably isn't necessary, but it won't hurt anything. I like the look, and may steal this for my website.
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
- Posts: 55
BBC said:
Did you put your item as "Featured" ?
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
background: url("../images/system/featuredItem.png") no-repeat scroll 100% 0 transparent;
Please Log in or Create an account to join the conversation.
- BBC
-
- Offline
- Platinum Member
- Posts: 663
Please Log in or Create an account to join the conversation.
- NintendoNerds
-
Topic Author
- Offline
- Senior Member
- Posts: 55
BBC said:
It wont help you. Terry misunderstod you.
Please Log in or Create an account to join the conversation.