eZ Community » Forums » Install & configuration » How do you set the number of articles...
expandshrink

How do you set the number of articles shown

How do you set the number of articles shown

Monday 06 January 2003 8:39:51 am - 4 replies

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.

Monday 06 January 2003 10: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.

Monday 06 January 2003 11: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.

Tuesday 07 January 2003 7:34:04 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.

Wednesday 08 January 2003 5:25:19 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.

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?

expandshrink

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from