Questions tagged [limit]
The limit tag has no usage guidance.
36
questions
0
votes
0
answers
20
views
Limit External API Calls From Plugin In Craft 2
I have a plugin in Craft 2 that will make an API call to an external API to gather and display data on a template; however, I would like to limit the number of calls to a certain number per second (or ...
1
vote
2
answers
424
views
Offset setting a limit?
If have this in a template:
{% for mainLink in section.links.limit(4).all() %}
{% endfor %}
{% for secondaryLink in section.links.offset(4).all() %}
{% endfor %}
Which I thought would show the first ...
1
vote
1
answer
41
views
Categories field limit doesn't disable Add a Category button
I set the Branch Limit for a Category Field Type to 1, but after adding one category, the Add a Category button is still active.
Shouldn't it be disabled after reaching the limit?
Thanks!
1
vote
1
answer
216
views
Restricting file size for an Assets Volume
I have a use case where I want to limit the allowed file size for a certain Assets Volume to 20kb. All other volumes should be allowed files no matter the size.
I have looked at some other threads ...
1
vote
1
answer
108
views
Date Limit on Element Query
I have a custom date field - "renewalDate" - which I want to use to limit an entry query. Here is the code:
When I run that it throws this error:
"Calling unknown method: craft\behaviors\...
1
vote
1
answer
172
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 = $...
2
votes
1
answer
3k
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
2
answers
2k
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
0
answers
595
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
1
answer
142
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
1
answer
38
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
2
answers
461
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
1
answer
217
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
1
answer
316
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
1
answer
728
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
1
answer
1k
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
2
answers
2k
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; ...
2
votes
1
answer
2k
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 ...
2
votes
1
answer
38
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
1
answer
210
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
1
answer
350
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
1
answer
170
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
1
answer
81
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
3
answers
3k
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
1
answer
1k
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
1
answer
93
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
2
answers
2k
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
1
answer
834
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
2
answers
1k
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
2
answers
419
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
1
answer
453
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
1
answer
331
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 ...
4
votes
1
answer
580
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
1
answer
2k
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
2
answers
964
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
1
answer
88
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 ...