Offsetting some news items

Post

Posted
Rating:
#5030 (In Topic #1126)
Avatar
Site staff
enelson is in the usergroup ‘Super-moderators’
Is it possible to offset the news items displayed by the main_news block? I want to use both the main_image_fader_news and the  main_news block on a homepage. My intention is for the fader block to carry the latest 5 news items and the main_news block to carry the next 10 latest news items, offsetting the "most" latest 5. Is there some way this can be done -- without some extra PHP?
Online now: No Back to the top

Post

Posted
Rating:
#5031
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
Hi,

I was going to say it's not possible, but then I realised you could use Filtercode and Tempcode.

Code

{$BLOCK,block=main_news,filter=date_and_time<{$SUBTRACT,{$FROM_TIMESTAMP},604800},fallback_full=10,fallback_archive=0,days=0}

604800 is 1 week in seconds


Become a fan of Composr on Facebook or add me as a friend. Add me on on Twitter. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#5032
Avatar
Site staff
enelson is in the usergroup ‘Super-moderators’

Code

{$BLOCK,block=main_news,filter=date_and_time&amp;amp;amp;amp;lt;{$SUBTRACT,{$FROM_TIMESTAMP},604800},fallback_full=10,fallback_archive=0,days=0}&amp;amp;amp;lt;br /&amp;amp;amp;gt;604800 is 1 week in seconds

It seems to work – I have just 5 article currently, so it just displays There is no news yet for now.
I had to paste the code in "view source" mode for it to work as the whole news items were displayed normaily, when I pasted the code in the normal editor mode.
Thanks

Code

{$BLOCK,block=main_news,filter=date_and_time&amp;amp;amp;amp;lt;{$SUBTRACT,{$FROM_TIMESTAMP},604800},fallback_full=10,fallback_archive=0,days=0}&amp;amp;amp;lt;br /&amp;amp;amp;gt;604800 is 1 week in seconds

It seems to work – I have just 5 article currently, so it just displays There is no news yet for now.
I had to paste the code in "view source" mode for it to work as the whole news items were displayed normaily, when I pasted the code in the normal editor mode.
Thanks
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Users online:

babu, Paul D, John Connor, waqasf160, amit.nigam, Manu, Vaiva, MVLipwig

Forum statistics:
  • 1,174 topics, 5,550 posts, 6,746 members
  • Our newest member is waqasf160
Birthdays:
Back to Top