- Posts: 55
COMMUNITY FORUM
Following layout possible?
- WinniePooh
-
Topic Author
- Offline
- Senior Member
Less
More
11 years 7 months ago - 11 years 7 months ago #117428
by WinniePooh
Following layout possible? was created by WinniePooh
Hello,
I would like to know if it's possible to do this layout with K2:
(Translation: aus = from)
The categories show their newest articles on their section. Do I've to do it with the k2 content modules or are there other possibilities?
Thank you in advance
Winniepooh
I would like to know if it's possible to do this layout with K2:
Attachment not found
(Translation: aus = from)
The categories show their newest articles on their section. Do I've to do it with the k2 content modules or are there other possibilities?
Thank you in advance
Winniepooh
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 7 months ago #117429
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Following layout possible?
Hello,
You can use the latese items from categories menu type.
You can use the latese items from categories menu type.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- WinniePooh
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
11 years 7 months ago #117430
by WinniePooh
Replied by WinniePooh on topic Re: Following layout possible?
Thank you for your answer. I know how to show the latest items but how can I show the categories separately? It should not be a blog where the categories are mixed together. When a new item has been created so I want it to display on it's own category section on the blog and not at the first place.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 7 months ago #117431
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Following layout possible?
Not the latest items. You need the latest items from menu item instead of the K2 categories one.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- WinniePooh
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
11 years 7 months ago #117432
by WinniePooh
Replied by WinniePooh on topic Re: Following layout possible?
Thank you very much! Now it's perfect. Great extension.
Please Log in or Create an account to join the conversation.
- WinniePooh
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
11 years 7 months ago #117433
by WinniePooh
Replied by WinniePooh on topic Re: Following layout possible?
I've another sort question. After the first layout is possible to create, how is it possible to create this one:
Thank you in advance.
Winniepooh
Attachment not found
Thank you in advance.
Winniepooh
Please Log in or Create an account to join the conversation.
- WinniePooh
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
11 years 7 months ago #117434
by WinniePooh
Replied by WinniePooh on topic Re: Following layout possible?
Is there an option where I can change the layout of each category when I've the latest items from menu? I only have the option to show all items or to show the first item and the titles of the subsequent items.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 7 months ago #117435
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Following layout possible?
You have to make a template override and override the latest.php and latest_item.php.
Of you have some experience with coding it is very easy. It is a simple php check ( if the key is 0 echo one CSS class or echo another for other items. ) Then it's CSS
Of you have some experience with coding it is very easy. It is a simple php check ( if the key is 0 echo one CSS class or echo another for other items. ) Then it's CSS
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- WinniePooh
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
11 years 7 months ago - 11 years 7 months ago #117436
by WinniePooh
Replied by WinniePooh on topic Re: Following layout possible?
It's only the latest_item.php where I've to put a div. Here an example what I've done on the latest_item.php.
Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 7 months ago #117437
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Following layout possible?
You have used <?php if($key == 1): ?> it should 0 as the first item is zero.
I would probably use a different approach. I would strip the extra markup and use a CSS solution.
Finally the $key variable should be used under the foreach loop (inside latest.php)
Locate this line
There you have the $itemCounter which is the same thing.
Then you need to change
to
Use it to echo a css class to the following div ONLY for the first item using something like <?php if($itemCounter==0): ?>
I would probably use a different approach. I would strip the extra markup and use a CSS solution.
Finally the $key variable should be used under the foreach loop (inside latest.php)
Locate this line
<?php foreach ($block->items as $itemCounter=>$item)
There you have the $itemCounter which is the same thing.
Then you need to change
?php foreach ($block->items as $item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
to
?php foreach ($block->items as $itemCounter=>$item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
Use it to echo a css class to the following div ONLY for the first item using something like <?php if($itemCounter==0): ?>
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- WinniePooh
-
Topic Author
- Offline
- Senior Member
Less
More
- Posts: 55
11 years 7 months ago #117438
by WinniePooh
Replied by WinniePooh on topic Re: Following layout possible?
Ok, I've done it and also put a div around the subsequent item. How can I add small images and a intro text beside the subsequent items?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 7 months ago #117439
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: Following layout possible?
You can use CSS resize (Quick and dirty method) or you can hardode the values.
Eg. change echo $this->item->image; to echo $this->item->imageMedium; $this->item->imageLarge etc...
This works both ways. You can set a large image for the first only or the opposite
Eg. change echo $this->item->image; to echo $this->item->imageMedium; $this->item->imageLarge etc...
This works both ways. You can set a large image for the first only or the opposite
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.