HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Number of news , topics on main page

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#67923 (In Topic #14459)
Avatar

Fan in training

Hi

I'm new with OCPortal and my first question here I bet has a vey simple answere but one that I was unable to find on my own :'(
How do I determin the numer of news for exemple that I want to be shown on the first page ? For example I want to show only the last 2 posts and the rest to be accesible throu "show more" option.
The same problem for the other blocks…
Is it a code line to add or can I set this from the admin interface?

Thanks.
Back to the top
 
Posted
Rating:
#67924
Avatar

Community saint

When you add a block, it's one of the parameters. It should ask you how many you want to show.

Eric DeMars . com
My electronic portfolio and personal site. Uses ocPortal!
Back to the top
 
Posted
Rating:
#67925
Avatar

Fan in training

That is what I thought.
But for exemple I have now :

Code

[block="14" member_based="0" multiplier="0.5" fallback_full="2" fallback_archive="2" blogs="-1" zone="_SEARCH" show_in_full="0"]main_news[/block]

and it still shows more than 2 news on the main page…
Something I do wrong or is it a bug ?
Back to the top
 
Posted
Rating:
#67927
Avatar

Community saint

The code looks Ok to me, and the fallback_full="2" bit is the relevant code that should limit your display to only 2 posts on the front page.

I have something similar:

Code

[block="0" title="Section#2 - Articles, Anecdotes and Tall-tales - (by various Authors)" fallback_full="2" fallback_archive="0" filter="8,9,10,12,21,23"]main_news[/block]
… with a few differences, e.g. I have a 'filter' in place to only show articles from certain categories.

Why not copy that and give it a try and see if it works for you, then adapt your code to suit your requirements.

Let us know how you get on.

 :thumbs:



P.S. Don't forget to clear your caches. Probably best to do that using the built-in ocP Tools!


Take my advice. I'm not using it!

View my working ocPortal site (version 9.x.x) at Anglo-Indian Portal
Back to the top
 
Posted
Rating:
#67951
Avatar

It's fletch's initial =0 bit that does it. This tells it to set the days to show to 0, which makes it fallback to showing based on a number of items (the fallaback_full value).


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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.
Back to the top
 
Posted
Rating:
#67989
Avatar

Community saint

I was going to post a similar question, but block="0" fixes my problem also  :thumbs: .

I think the instructions for Param need to add a note that 0 is a valid option.

Do you have a Samsung Galaxy S / Galaxy S II ? If so, why not check out my ScreenFree FM Radio .
Back to the top
 
Posted
Rating:
#67996
Avatar

Yes agreed, I made that change previously after checking the wording myself.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
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 ocPortal whenever you see the opportunity.
  • 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 ocPortal 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.
Back to the top
 
Posted
Rating:
#68013
Avatar

Fan in training

that did the trick.
thanks guys
Back to the top
 
1 guests and 0 members have just viewed this: None
Control functions:

Quick reply   Contract

Your name:
Your message: