Most Popular
1500 questions
4
votes
1 answer
How to load entry-objects with Ajax
I should begin to say that I have no idea really how exactly ajax works. Although I've used it a couple of times with pre-made WordPress plugins. I saw some examples of ajax entry-loading here on Stack Exchange, I tried to make ajax requests in…
Slebbo
- 87
- 1
- 8
4
votes
1 answer
Installing Craft in sub directory
I need to install Craft under a laravel sub-directory http://example.com/corp/ where example.com is a laravel site.
Does anyone have a clean way to install craft in a directory below an existing app?
Here is my config from /corp/public/index.php
//…
David A McInnis
- 1,201
- 12
- 26
4
votes
1 answer
How do you output images without "?mtime" at the end of the url?
For some rss readers they have issues with the images having "mtime" at the end of the url. Is there a way to output an image without this?
a-am
- 2,857
- 1
- 19
- 25
4
votes
1 answer
What SQL query can I run to remove all users assigned to a particular group?
So I have a user group containing a few thousand users and I want to remove all of those users with a SQL script.
These users don't have access to the control panel and so don't have any Entries authored by them.
At the moment I have this:
DELETE…
Russ Back
- 1,503
- 13
- 26
4
votes
1 answer
How to include JS and CSS resources for a plugin variable
I've got a variable (widget is a better word) that I want to output with accompanying CSS and/or JS.
I'm rendering the variable (widget) with the following
return TemplateHelper::getRaw($output);
I realize the following exists but other than…
Adam McCombs
- 1,695
- 12
- 25
4
votes
3 answers
Asset thumbs missing in control panel after Assets Source update
I've updated several Assets Sources on my production site. I've exported / imported the database from production into local - the new Assets Sources are in place but the asset thumbs are now missing.
How can I get Craft to re-generate these please?
Matt Ellis
- 361
- 1
- 9
4
votes
2 answers
Fetch Single asset without for loop?
I've got a Assets field which is limited to 1 asset inside a Matrix field. Is there a better way to fetch the image without using a forloop?
At the minute I've got:
{% for image in block.backgroundImage %}
{{ image.getUrl() }}
{% endfor %}
But…
Keiron Lowe
- 225
- 1
- 5
4
votes
1 answer
Assets and S3 - Reduced Redundacy Storage
is it possible for S3 bucket assets to use reduced redundancy storage?
mjr
- 1,405
- 13
- 21
4
votes
1 answer
Check and remove repeat entries from loop
Is it possible to loop through the list of entries and filter out any that have the same ID as any of the other entries (duplicates)? I have a specific case where this is an issue. I want to keep the first entry, but filter out the rest of them. I'm…
Ben Shoults
- 316
- 2
- 8
4
votes
1 answer
Eager Loading Users Returning "Array to String Conversion" Error
I am trying to eager load users in a specific group to reduce queries. I've tried this:
{% set designers = craft.users({
group: 'designers',
with: [
…
Angela
- 569
- 2
- 12
4
votes
1 answer
Is it possible to make Craft/Twig throw 404 if a template can't be found?
Attempting to include a template that doesn't exist throws HttpStatus 500 – Craft\TemplateLoaderException – Unable to find the template “{template}”.
This is usually fine and what you want, but is it possible to override this behaviour somehow, and…
Mats Mikkel Rummelhoff
- 22,361
- 3
- 38
- 69
4
votes
3 answers
Creating environment variable from JSON file
Brand new to Craft here. I'm trying to port across my gulp workflow to Craft and basically everything has gone super smooth. Just one last obstacle due to my lack of knowledge of the Twig templating engine and some of the internal workings of…
lotech
- 43
- 3
4
votes
2 answers
When is the find() method actually necessary?
I've noticed code samples like the following that use the find() method.
{% for entry in craft.entries.section('blog').limit(5).find() %}
{{ entry.title }}
{% endfor %}
I've noticed that this code sample…
Tim Knight
- 1,022
- 8
- 17
4
votes
1 answer
Migrating Craft site to another server --- throws 404 for all pages but homepage
I've been asked to migrate a Craft site from one server to another. The new server setup is the same as the server I'm migrating from. I moved all the files in the webroot directory over to the new server and imported the database. The homepage…
jwaymire
- 43
- 3
4
votes
3 answers
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)
KSPR
- 3,786
- 2
- 29
- 52