Keyword

Following layout possible?

  • WinniePooh
  • WinniePooh's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 1 month ago - 11 years 1 month 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:

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
Attachments:

Please Log in or Create an account to join the conversation.

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 1 month ago #117429 by Krikor Boghossian
Replied by Krikor Boghossian on topic Re: Following layout possible?
Hello,

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
  • WinniePooh's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 1 month 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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 1 month ago #117431 by Krikor Boghossian
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
  • WinniePooh's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 1 month 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
  • WinniePooh's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 1 month 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:

Attachment not found




Thank you in advance.
Winniepooh
Attachments:

Please Log in or Create an account to join the conversation.

  • WinniePooh
  • WinniePooh's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 1 month 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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 1 month ago #117435 by Krikor Boghossian
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

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • WinniePooh
  • WinniePooh's Avatar Topic Author
  • Offline
  • Senior Member
More
11 years 1 month ago - 11 years 1 month 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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
11 years 1 month ago #117437 by Krikor Boghossian
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
<?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.