Keyword

How to hide the first article in a module

  • Ruth Cheesley
  • Ruth Cheesley's Avatar Topic Author
  • Offline
  • Senior Member
More
13 years 8 months ago #94622 by Ruth Cheesley
How to hide the first article in a module was created by Ruth Cheesley
Hi guys,

 

I'm in the final throes of a k2 powered website project and I wondered if someone could advise me how to do what seems to be a simple thing but I'm not sure on the syntax.

 

I'm using RokMicroNews to show the first featured K2 item from xyz categories and all featured items in RokNewsPager elsewhere on the page.  Is it possible to have RokNewsPager start displaying from the 2nd featured article, rather than the first one - as clearly with this module showing all, it's repeating the one showing in RokMicroNews.

 

Basically what I need it to do is disregard the first featured article, I think?

 

Ruth

Ruth Cheesley
Virya Technologies

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

More
13 years 8 months ago #94623 by Terry Britton
Replied by Terry Britton on topic How to hide the first article in a module
Not sure how RokNewsPager works, but in general here's what you want to do.

$itemCount = 0;

foreach...  // this is the foreach statement that RokNewsPager uses to list each item

$itemCount = $itemCount + 1;

if ($itemCount > 1) { // left blank so nothing happens on the first item

} else {

...  // the rest of the RokNewsPager foreach statement

}

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

More
13 years 8 months ago #94624 by Terry Britton
Replied by Terry Britton on topic How to hide the first article in a module
Sorry it's late here and I've had a couple of glasses of wine. It should read if ($itemCount == 1) instead of if ($itemCount > 1). 

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

More
13 years 8 months ago #94625 by Jiliko.net
Replied by Jiliko.net on topic How to hide the first article in a module
Hi,

 

Terry is right. In attachment, an updated default.php for the RokNewsPager to copy in the folder :

 

'templates/YOURJOOMLTEMPLATE/html/mod_roknewspager/

 

Olivier

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

More
13 years 8 months ago #94626 by Terry Britton
Replied by Terry Britton on topic How to hide the first article in a module
Thanks Olivier for helping out.

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

  • Ruth Cheesley
  • Ruth Cheesley's Avatar Topic Author
  • Offline
  • Senior Member
More
13 years 8 months ago #94627 by Ruth Cheesley
Replied by Ruth Cheesley on topic How to hide the first article in a module
Thanks guys, much appreciated!

Ruth Cheesley
Virya Technologies

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

More
13 years 8 months ago #94628 by McGreg
Replied by McGreg on topic How to hide the first article in a module
I use this module its very usable, Its not really the same you ask, but u have much more option You can hide the first one or xx of the firsts.

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


Powered by Kunena Forum