How do you set the number of articles shown

Author Message

Richard Wood

Sunday 05 January 2003 11:39:51 pm

I've looked high and low but can't see how through the admin interface or the templates that you set how many items will display out of the content module.
Anyone, please advise.
Richard.

Jan Borsodi

Monday 06 January 2003 1:05:28 am

> I've looked high and low but can't see how through the admin
> interface or the templates that you set how many items will
> display out of the content module.
> Anyone, please advise.
> Richard.

If you mean children of a content object the number is controlled by the template, for instance open design/standard/templates/node/view/full.tpl and look at the top you should see a line that says page_limit=25, this controls the maxium number of children.

By default the templates will have a constant value(that's the only sensible thing for a generic release), however if you want to you could create a template which reads the children count from the object itself (for instance an integer attribute).
This is done by creating an override template for a specific class.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Richard Wood

Monday 06 January 2003 2:42:16 am

> > I've looked high and low but can't see how through the
> admin
> > interface or the templates that you set how many items
> will
> > display out of the content module.
> > Anyone, please advise.
> > Richard.
>
> If you mean children of a content object the number is
> controlled by the template, for instance open
> design/standard/templates/node/view/full.tpl and look at the
> top you should see a line that says page_limit=25, this
> controls the maxium number of children.
>
> By default the templates will have a constant value(that's
> the only sensible thing for a generic release), however if
> you want to you could create a template which reads the
> children count from the object itself (for instance an
> integer attribute).
> This is done by creating an override template for a specific
> class.

Thank you for your answer.
I apologise for my ignorance here as I am having to work by trial and error a fair bit.
There appears to be a default of eight items being shown in my news view which uses a file pagelayout.tpl for the entire user side of the site, and template line_class_24 and line_class_2 as override templates for particular classes of articles in line view.
I can't find any page_limit=8 in those override templates and wherever else I've found it and changed it has not had the necessary effect.
So I figure 8 is a default setting in ezpublish and I need to add some code to one of my templates to change that to the 15 I want. Which template do I add it to, or am I on the wrong track.
Richard.

Jan Borsodi

Tuesday 07 January 2003 10:34:04 am

> > > I've looked high and low but can't see how through the
> > admin
> > > interface or the templates that you set how many items
> > will
> > > display out of the content module.
> > > Anyone, please advise.
> > > Richard.
> >
> > If you mean children of a content object the number is
> > controlled by the template, for instance open
> > design/standard/templates/node/view/full.tpl and look at
> the
> > top you should see a line that says page_limit=25, this
> > controls the maxium number of children.
> >
> > By default the templates will have a constant
> value(that's
> > the only sensible thing for a generic release), however
> if
> > you want to you could create a template which reads the
> > children count from the object itself (for instance an
> > integer attribute).
> > This is done by creating an override template for a
> specific
> > class.
>
> Thank you for your answer.
> I apologise for my ignorance here as I am having to work by
> trial and error a fair bit.
> There appears to be a default of eight items being shown in
> my news view which uses a file pagelayout.tpl for the entire
> user side of the site, and template line_class_24 and
> line_class_2 as override templates for particular classes of
> articles in line view.
> I can't find any page_limit=8 in those override templates
> and wherever else I've found it and changed it has not had
> the necessary effect.
> So I figure 8 is a default setting in ezpublish and I need
> to add some code to one of my templates to change that to
> the 15 I want. Which template do I add it to, or am I on the
> wrong track.
> Richard.

You pass the limit parameter to the fetch function for content/list, like:
fetch('content','list',hash(....,limit,5))

There's also an offset parameter that can be used.

--
Amos

Documentation: http://ez.no/ez_publish/documentation
FAQ: http://ez.no/ez_publish/documentation/faq

Richard Wood

Tuesday 07 January 2003 8:25:19 pm

> > > > I've looked high and low but can't see how through
> the
> > > admin
> > > > interface or the templates that you set how many
> items
> > > will
> > > > display out of the content module.
> > > > Anyone, please advise.
> > > > Richard.
> > >
> > > If you mean children of a content object the number is
> > > controlled by the template, for instance open
> > > design/standard/templates/node/view/full.tpl and look
> at
> > the
> > > top you should see a line that says page_limit=25,
> this
> > > controls the maxium number of children.
> > >
> > > By default the templates will have a constant
> > value(that's
> > > the only sensible thing for a generic release),
> however
> > if
> > > you want to you could create a template which reads
> the
> > > children count from the object itself (for instance an
> > > integer attribute).
> > > This is done by creating an override template for a
> > specific
> > > class.
> >
> > Thank you for your answer.
> > I apologise for my ignorance here as I am having to work
> by
> > trial and error a fair bit.
> > There appears to be a default of eight items being shown
> in
> > my news view which uses a file pagelayout.tpl for the
> entire
> > user side of the site, and template line_class_24 and
> > line_class_2 as override templates for particular classes
> of
> > articles in line view.
> > I can't find any page_limit=8 in those override
> templates
> > and wherever else I've found it and changed it has not
> had
> > the necessary effect.
> > So I figure 8 is a default setting in ezpublish and I
> need
> > to add some code to one of my templates to change that
> to
> > the 15 I want. Which template do I add it to, or am I on
> the
> > wrong track.
> > Richard.
>
> You pass the limit parameter to the fetch function for
> content/list, like:
> fetch('content','list',hash(....,limit,5))
>
> There's also an offset parameter that can be used.

I understand that now. My problem is to find which template the fetch command is in that sets the view to eight in the demo.
I have now searched through every template that comes with the demo to no avail.
As I understand it the full_class_x tempates are the individual article views, the line_class_x are the individual line views.
Where is the template in the demo that does that fetch and then loops through and produces the line views - that will be the one I want.
If I need to create an override, then what do I call it and where do I put it?

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.