- Posts: 8
COMMUNITY FORUM
? Featured items in the order
- Markus Maier
- Offline
- New Member
Less
More
13 years 4 months ago #82527
by Markus Maier
Replied by Markus Maier on topic ? Featured items in the order
Short update on this. I also tested the 'not show any featured item' if statement. Compared to the statement above it causes the whole website to break. I receive a blank page.
Please Log in or Create an account to join the conversation.
- Terry Britton
- Offline
- Elite Member
Less
More
- Posts: 198
13 years 4 months ago #82528
by Terry Britton
Replied by Terry Britton on topic ? Featured items in the order
I'll try to play with it this weekend.
Please Log in or Create an account to join the conversation.
- Markus Maier
- Offline
- New Member
Less
More
- Posts: 8
13 years 4 months ago #82529
by Markus Maier
Replied by Markus Maier on topic ? Featured items in the order
Great. Let me know if you need any help.
Please Log in or Create an account to join the conversation.
- Terry Britton
- Offline
- Elite Member
Less
More
- Posts: 198
13 years 4 months ago #82530
by Terry Britton
Replied by Terry Britton on topic ? Featured items in the order
Hey Markus, just wrap the following portion of the foreach statement as shown.
if ($this->item->featured) {
echo $this->loadTemplate('item');}
The syntax for not featured is:
if (!$this->item->featured) {
echo $this->loadTemplate('item');}
if ($this->item->featured) {
echo $this->loadTemplate('item');}
The syntax for not featured is:
if (!$this->item->featured) {
echo $this->loadTemplate('item');}
Please Log in or Create an account to join the conversation.
- Markus Maier
- Offline
- New Member
Less
More
- Posts: 8
13 years 4 months ago #82531
by Markus Maier
Replied by Markus Maier on topic ? Featured items in the order
Awesome. I will try this and let you know.
Please Log in or Create an account to join the conversation.
- Markus Maier
- Offline
- New Member
Less
More
- Posts: 8
13 years 4 months ago #82532
by Markus Maier
Replied by Markus Maier on topic ? Featured items in the order
It's working Terry. Good job. Unfortunately there's another problem: Your code generates a "itemContainer" div no matter if the 'if-function' matches or not.
This causes a lot of empty div containers that are breaking the layout. For instance if you're working with a two column layout for the secondary items there will be a lot of rows only displaying one item. It's like having empty placeholders.
This causes a lot of empty div containers that are breaking the layout. For instance if you're working with a two column layout for the secondary items there will be a lot of rows only displaying one item. It's like having empty placeholders.
Please Log in or Create an account to join the conversation.
- Terry Britton
- Offline
- Elite Member
Less
More
- Posts: 198
13 years 4 months ago #82533
by Terry Britton
Replied by Terry Britton on topic ? Featured items in the order
My first approach was preferrable for just this reason, but I couldn't ever get it to work consistently. Not sure why. Give me a link to your site, may be something we can do in css.
Please Log in or Create an account to join the conversation.
- Markus Maier
- Offline
- New Member
Less
More
- Posts: 8
13 years 4 months ago #82534
by Markus Maier
Replied by Markus Maier on topic ? Featured items in the order
Terry - I found a solution for this. I just placed the code snippet in front of the div container...simple but useful.
Please Log in or Create an account to join the conversation.
- Terry Britton
- Offline
- Elite Member
Less
More
- Posts: 198
13 years 4 months ago #82535
by Terry Britton
Replied by Terry Britton on topic ? Featured items in the order
Great. Glad you got it working.
Please Log in or Create an account to join the conversation.