Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [limit]

The tag has no usage guidance.

1
vote
1answer
19 views

Update field setting value using getFieldByHandle

I need to update the limit setting for Images allowed to be empty, so as to allow for no limit. How do I go about updating the 'limit' setting? $fieldsService = Craft::$app->getFields(); $field = $...
1
vote
1answer
105 views

Impossible to invoke a method (“limit”) on an array… but it's not an array?

I am receiving the error message "Impossible to invoke a method ("limit") on an array," but I don't think I am working with an array! Here is why I think that... First I set an albums variable: {% ...
1
vote
1answer
122 views

Adjusting Max File Size - Stuck at 16M After Adjusting general.php

I'm adjusting the maxUploadFileSize in Craft, to 50MB. In following the post below, I made several adjustments to both: php.ini and craft/config/general.php. https://stackoverflow.com/questions/...
1
vote
0answers
50 views

Cannot add more fields - SQLSTATE[42000]: Syntax error or access violation: 1118 Row size too large

I've been bumping into a field limit when attempting to mirgrate fields in, which is a massive limitation for the way the site was originally set up. I've read a bunch of other threads where it's ...
1
vote
1answer
30 views

How to limit number of entries to a given user/user group

I have a site where users can add entries of an entry type/section called Listings. I would like to limit the number of Listings to a maximum of three per user. In another CMS I did this by writing ...
1
vote
1answer
22 views

Allowing the user to update a CraftCMS pagination limit with listing filter options

I am building a pagination layout limiting the content to 10 because, well, it makes sense to break down large amounts of content to smaller chunks. But as there is so much, a user might want to ...
1
vote
2answers
174 views

Querying channel entries hits memory limit

We have a channel that has about 700 entries but is paginated with a limit of 30 entries. Our client is looking to add a button so users can print out all entries. One of our proposed solutions was to ...
1
vote
1answer
134 views

Get next 3 upcoming entries

I'm working on a new website for my student radio station but I've stumbled into a few key bugs which are stopping us from advertising the new site. It's live right now over on Stormfm.com, you'll ...
0
votes
1answer
129 views

Dynamic entries limit via dropdown

On a entries (listing) page I'm using pagination and a fixed limit of entries set. I want visitors to be able to select (dropdown) the number of entries that should be listed (limit). I'm not a Java ...
2
votes
1answer
243 views

Can't add anymore fields / blocks to Matrix Field

I have a really big / flexible Matrix field for one of my websites. It works great and is easy to handle. The problem is that I need to add another block containing some fields. I already extenended ...
1
vote
1answer
351 views

For loop, if statement, then limit

I've created two global variables which my content creator is going to use to turn off a bunch of articles and turn on a bunch more which a slight change in the Global. I have a page where there is a ...
1
vote
1answer
293 views

ElementAPI: How to order and/or limit results?

Currently collaborating on a site with another developer, which is using ElementAPI pretty heavily for content delivery. Is there a way to limit the number of returns on any given json feed? Say; ...
3
votes
1answer
810 views

Limit the for loop returns with an if statement

I've got a for loop working perfect with a limit of 5. Then I throw in the if statement to filter those entries that correspond with a global variable I have set. The problem is the if statement is ...
1
vote
1answer
26 views

How can I pull every entry (large number) in a section?

I have an extended profile that users can purchase. When purchased, an entry is created, and tied back to the user. The user can then log in and access the entry with the extended profile fields. I ...
0
votes
1answer
139 views

For loop does not display all entries in section

I have a for loop for all entries. There is no limit set, yet the loop is not displaying all the entries. The missing entries are the oldest. These missing entries do appear on category specific ...
1
vote
1answer
158 views

Only allowed 100 queries with relatedto?

Despite using null and paginate false i can still only return 100 queries with this: {% set results = craft.entries({ limit: null, paginate: false, section: 'directory', relatedTo: ...
1
vote
1answer
75 views

Date Archives: Last 6 months

From the Creating an Archive Page for Entries article in the Craft docs. How could I limit it so that it grouped by month but limited things to 6 months?: {% set allEntries = craft.entries.section('...
3
votes
1answer
75 views

A more economical method of building an archive menu?

I seem to be having trouble with the performance of my site (on localhost) after including this object. Im using it to build a menu for an archive of the posts section which has about 2,500 entries ...
4
votes
2answers
2k views

Default Craft entry limit

There seems to be a default limit to for loops in craft of 100. I have a channel with quite a few entries. How can I disable this without writing nasty things like .limit(100000000)
3
votes
1answer
533 views

Limit category choice in entry to 1 and select child category

I have a section of book entries with a categories field called "Genre". A book can fall into multiple genres. A stripped down version of the categories works something like this: Fiction Crime, ...
1
vote
1answer
74 views

Unable to sort large number of blocks in Matrix field in CP and template

I have about 145 blocks in a single Matrix. If I try and re-arrange (drag&drop) the first few blocks, and then hit save, all is well. However, trying to re-arrange the last few blocks doesn't save ...
1
vote
2answers
1k views

Check if paginate

Below is my paginate code. How can I check if there is more than one page? At the moment when there is only one I'm getting a '1' appear at the bottom (the page number) which looks odd. Ideally I only ...
2
votes
1answer
633 views

Matrix - using Limit on block types

I'm using Matrix fields for blog posts. These are made up of text and image block types. I want to pull in only the first image block and a snippet of text from the first text block into the blogs ...
1
vote
2answers
828 views

Only display entries based on a field conditional

Hey I am trying to get 4 entries, but only want 4 that have a body length > 100. How would I accomplish this? {% for entry in craft.entries.section('artists').order('RAND()').limit(4) %} // only ...
2
votes
2answers
283 views

Display only one entry with checkbox checked in my pagination loop?

I have multiple entries in 'blog' that have the 'featurePost' checkbox field checked. I want to display ONLY the latest, but this code is displaying multiple fields. {% paginate craft.entries({ ...
2
votes
1answer
265 views

How can I limit the output of assets randomly if an asset exists?

How can I limit the output of assets based on this criteria? search all entries randomly in section "homes" for only entries with at least one asset image limit those results to 8 random assets I ...
1
vote
1answer
267 views

When using .limit on matrix blocks they don't show in live preview

I have a Matrix field setup and working perfectly except for one problem. In my template I'm using .limit to only pull the first two items from the matrix field (I can't use max in the field ...
3
votes
1answer
257 views

How can I show 3 entries at random from within the next 10

{% for entry in craft.entries.section('entertainmentEvents').status('live','pending').search('entertainmentBanner:*').order('RAND()').limit(3) %} This is working to show 3 random entries from the ...
2
votes
1answer
953 views

How to limit number of entries returned from a group filter?

I'm wondering how I would go about limiting the number of results returned from a set using the group filter? I only want four to show, but using the limit() method seems to throw errors wherever I ...
2
votes
2answers
594 views

Matrix max block type limit

Currently it's possible to set a max block value for the collection of block types. However I have a case where it would be great if I could set block type limit. For example I have a situation ...
2
votes
1answer
80 views

Is there a way to prevent uploading assets into a parent level folder?

Say that I have a folder structure like this: /images /products /employee-photos /user-photos /advertising Is there a way that I could define the single asset source of /images while only ...