Keyword

display an article on a module and not on the main content

  • Christos Simatos
  • Christos Simatos's Avatar Topic Author
  • Offline
  • New Member
More
7 years 4 months ago #161793 by Christos Simatos
Hello.
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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #161852 by Krikor Boghossian
Replied by Krikor Boghossian on topic display an article on a module and not on the main content
Hello there,

I would suggest a different approach.
Display only featured item(s) in the module and then have the featured hidden in the category view.

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

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

  • Christos Simatos
  • Christos Simatos's Avatar Topic Author
  • Offline
  • New Member
More
7 years 4 months ago #161874 by Christos Simatos
Replied by Christos Simatos on topic display an article on a module and not on the main content
Hello and thank you for your response but I have tried that and it’s not very convenient because I would like to show only the featured articles in the front page.

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
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #161906 by Krikor Boghossian
Replied by Krikor Boghossian on topic display an article on a module and not on the main content
The key will look for a position in the loop.
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.

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

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

  • Christos Simatos
  • Christos Simatos's Avatar Topic Author
  • Offline
  • New Member
More
7 years 4 months ago #161928 by Christos Simatos
Replied by Christos Simatos on topic display an article on a module and not on the main content
Thanks again Krikor for your reply, but your solution its beyond my coding skills. I understand what you're saying but I don't know how to do it. I thought it was something relatively easy but now I see it's not..

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #161935 by Krikor Boghossian
Replied by Krikor Boghossian on topic display an article on a module and not on the main content
There are other ways to approach this, but they all require coding skills.

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

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

  • Christos Simatos
  • Christos Simatos's Avatar Topic Author
  • Offline
  • New Member
More
7 years 4 months ago #161942 by Christos Simatos
Replied by Christos Simatos on topic display an article on a module and not on the main content
I understand. Can you please send me if it's OK (as a private message or email), an offer for assigning you the coding task?
Thank's again

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #161943 by Krikor Boghossian
Replied by Krikor Boghossian on topic display an article on a module and not on the main content
I cannot personally undertake this task.
I can however refer you to a dev -> www.joomlaworks.net/forum/k2-en/47220-k2-image-issue?start=10#160132

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

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

  • Christos Simatos
  • Christos Simatos's Avatar Topic Author
  • Offline
  • New Member
More
7 years 4 months ago #161954 by Christos Simatos
Replied by Christos Simatos on topic display an article on a module and not on the main content
Thanks Krikor for you help. I will contact Mohamed and ask him if he can help me.
Thanks

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 4 months ago #161966 by Krikor Boghossian
Replied by Krikor Boghossian on topic display an article on a module and not on the main content
You 're welcome Christos :)

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

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


Powered by Kunena Forum