Most Popular
1500 questions
4
votes
1 answer
Fatal error: Allowed memory size of 134mb exhausted
I have a template in my control panel (technically a plugin, but it's just one template) which is running out of memory:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
to allocate 78 bytes) in
…
darylknight
- 3,290
- 18
- 42
4
votes
2 answers
Can images embedded in a Rich Text field be resized on output?
I see how to use Image Transforms when the image tag is its own field but don't see a way to handle images within Rich Text fields or force a size on upload.
I need to have the image dimensions match the size the client sized the image to in the…
smartpill
- 107
- 1
- 6
4
votes
2 answers
How to transform German umlauts when creating slugs?
First of all, I want to thank you for creating Craft. It's really one of the best content management systems I have ever worked with.
I encountered an issue while working on a multilingual site: German Umlauts are not automatically transliterated (Ä…
Christoph Kepper
- 107
- 1
- 5
4
votes
1 answer
Set SuperTableFields programatically
I'm trying to setup some Global fields in a migration.
I'm using the SuperTable Field from verbb which is similar to a matrix field.
I'd like to add several rows during migration but can't seem to get the combination right in order to set the field…
Piaras Hoban
- 350
- 1
- 8
4
votes
1 answer
Craft 3 Redactor Link no longer has target option
The option for opening a link in the Redactor WYSIWYG no longer includes a field for opening it in a new tab? I haven't been able to find any docs that indicate any options for the Redactor config file to add this back in?
Jay
- 1,042
- 7
- 24
4
votes
2 answers
"An unknown error occurred" in assets screen
I have a number of assets resources all set to upload to the same amazon s3 bucket. Two of my four assets resources show "An unknown error occurred" twice when I view them in /admin/assets.
The files in the folder do not show up. In the logs the…
Florian
- 428
- 3
- 11
4
votes
1 answer
Check if a field a included in a Matrix block
Situation: I have a matrix with about 10 block types, 3 of which have a certain field. I want to check if the current block has that field.
The field in question is a dropdown with values in all 3 options.
I've tried:
{{ attribute(block,…
Jan Henckens
- 335
- 1
- 11
4
votes
3 answers
How do I "register" a service in a Craft 3 plugin?
In Craft 2, services were auto-loaded when using the craft()->plugin_serviceName->myMethodName() signature, but it seems like there's a catch in Craft 3, when using the new MyPlugin::getInstance()->myServiceName->myMethod().
I'm working on a…
August Miller
- 3,380
- 9
- 25
4
votes
1 answer
Craft CMS 3 - Entries field, getURL
Just migrating a site from 2 to 3 and stuck on this little call, cannot find anything in the docs at all.
Matrix field, Entries.
Cannot for the life of me find the equivalent/new way in the docs.…
moondawg
- 333
- 1
- 9
4
votes
1 answer
How do I properly set assets paths?
I'm having a problem getting my asset URLs to print properly in templates. The site is using a multi-environment configuration (dev/stage/live) with localized content (en/es/da) and shared assets. Here are the config and settings.
In the config…
Douglas McDonald
- 13,457
- 24
- 57
4
votes
1 answer
Getting info on the currently logged in user
Trying to get the currently logged in user's groups. Trying to get at that by using the user ID. I am currently testing as Admin - user number 1.
Craft::$app->getUser()->id
Returns a user ID (11) that does not exist in the Users table. The Users…
Eric Snyder
- 531
- 6
- 14
4
votes
1 answer
Cannot post data to a plugin controller action
I have a form in one of my templates
I also created a simple plugin like…
Paul Timoce
- 45
- 5
4
votes
1 answer
How to get entries between a time
I'm using Craft 3 and I would like to do the following thing:
There is a start date and an end date filed in entry, is it possible to get entries that are between these two dates in PHP?
Thank you!
yu xia
- 397
- 2
- 14
4
votes
1 answer
Craft 3: Get Data from a custom Table via createCommand()
In Craft 2 you could creat a query with:
craft()->db->createCommand()->select() .... etc.
But in Craft 3 there is no select() Method in Craft::$app->db->createCommand().
Am I overlooking something?
Leonardo
- 451
- 3
- 13
4
votes
2 answers
Restrict Permissions Per Entry Rather Than Per Section
Working in Craft 3, I have a requirement to restrict user access (in the CP) per Entry rather than per Section.
In this case Users in Craft will belong to Department (Channel) and Resources (Channel). They should only be able to administer the…
Ian Young
- 584
- 3
- 9