- Posts: 6
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- display an article on a module and not on the main content
display an article on a module and not on the main content
- Christos Simatos
-
Topic Author
- Offline
- New Member
I'm using K2 Version 2.7.1 and I would like to do the following.
I've created a module that will display the latest ( 1 ) article filtered by a specific K2 tag.
I would like to create a template override for the category.php so that when that particular article is shown on the module it would not be repeated on the main content.
I think I will have to include some custom code that identifies that particular tag and skips the first one when it prepares to display the content.
I believe its something simple but I don't know the proper php syntax.
Thank you very much.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
I would suggest a different approach.
Display only featured item(s) in the module and then have the featured hidden in the category view.
Please Log in or Create an account to join the conversation.
- Christos Simatos
-
Topic Author
- Offline
- New Member
- Posts: 6
With this module, I would like to stick one article to the top of the page, for as long as it needs to be without stopping the daily article posting.
When another article needs to take its place, it will show at its original position in the category view.
For the module, it’s easy simply display the latest 1 article filtered by a tag.
But for the category view you will see the same article twice ( on the module and on the category view), that is why I think something like <?php if($key < 1) continue; ?> would skip the first article with that tag and not display it twice.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
It will bypass eg: the first post, so this solution is flaky to say at least.
You could use a system plugin to remove that ID from the loop or you can use the ID as a classname or an HTML ID and use a JS script to hide or remove it from the DOM.
Please Log in or Create an account to join the conversation.
- Christos Simatos
-
Topic Author
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Christos Simatos
-
Topic Author
- Offline
- New Member
- Posts: 6
Thank's again
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
I can however refer you to a dev -> www.joomlaworks.net/forum/k2-en/47220-k2-image-issue?start=10#160132
Please Log in or Create an account to join the conversation.
- Christos Simatos
-
Topic Author
- Offline
- New Member
- Posts: 6
Thanks
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Christos Simatos
-
Topic Author
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Lisa Mitchell
-
- Offline
- New Member
- Posts: 2
If you don't need to changes that top article very often, this task could also be made with two copies of RAXO All-mode K2 module .
1. In the first module instance you display that specific article.
2. In the second copy you display the list of latest articles and just set to exclude this particular article by ID.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- display an article on a module and not on the main content