Most Popular
1500 questions
4
votes
1 answer
Does Twigs 'addGlobal' exist in Craft?
I know Craft gives us access to Twigs getTwig template service; so when I attempt to use the addGlobal function like so:
craft()->templates->getTwig()->addGlobal('var', $var);
... nothing happens. No errors. I had hoped putting this in my plugins…
Mark Notton
- 2,337
- 1
- 15
- 30
4
votes
1 answer
Override admin local name
I changed the language locale to Hungarian, but the translation for the singles looks a bit funny. Is there an easy way to override it with my version?
Singles are translated to "Egyedülállók" but that 99% of the time here means a single person and…
Tibor Szasz
- 356
- 1
- 9
4
votes
1 answer
How do I use Guzzle to send a post request from my plugin?
I have a plugin that listens for new users to be created. I am then sending that user to system "B" via an API call.
All is working fine the old fashion way, I am curious how to accomplish the same using Guzzle.
$client = new…
Damon
- 4,706
- 1
- 20
- 36
4
votes
1 answer
Generating pending image transforms stuck
My image transform task always gets stuck halfway through so that I have to "repair" the task as per this guide. Im trying to convert about 150 images (amounts to ~300 steps). Resetting the task within the database does work but it's not a permanent…
Sören Kampschroer
- 143
- 4
4
votes
2 answers
Newbie: Trying to understand includeCssFile
I'm a newbie to Craft and am working with a raw version of Craft CMS 2.6.2903 on localhost and am trying to understand some of the basics. The problem that I am encountering at the moment is to do with the Twig includeCssFile command.
I want to…
Crafty Cockney
- 83
- 7
4
votes
2 answers
Adding new locale - hangs at Step 3 'ResaveAllElements'
I've looked at every option I can think of so hoping that someone can assist. We're on a dedicated server with full root access.
We've got a relatively small site that now needs a Spanish locale adding. When I go to add it, everything seems to be…
JonnyT
- 324
- 2
- 10
4
votes
1 answer
Image Transform Problems, Timeouts, Stuck Transforms
We are seeing the following symptoms:
We routinely encounter stuck Generating pending image transforms tasks and have to manually mark the tasks as failed using SQL in the table craft_tasks.
Broken image links on pages that use image transforms.…
Jay Haase
- 265
- 2
- 9
4
votes
1 answer
Foreign Key column pointing to `craft_relations` table
I am writing a plugin with a Record. I want the primary key of the table to also be a foreign key relating to the craft_relations table. Ordinarily, I would add something like this...
public function defineRelations()
{
return array(
…
Lindsey D
- 23,974
- 5
- 53
- 110
4
votes
1 answer
How can I populate some records after my plugin is installed?
When I install the plugin, I need to automatically create a few records. How can I have my plugin automatically create those records when it is installed?
Jason McCallister
- 2,336
- 14
- 27
4
votes
2 answers
How to output the matrix block type name in Craft? Possible feature request
Is it possible to output the block type name in Craft for each matrix block in your field?
Currently Craft just lists the name of each field within the block, but we are using generic field names (Width, depth etc), so in those instances there is no…
Jamie Wade
- 3,644
- 2
- 16
- 32
4
votes
3 answers
Trouble with curly braces in Entry URL Format / renderObjectTemplate
This works:
{{ craft.entries.section('products').relatedTo(object).first.uri }}/{slug}
However, in this case, I need to use the extended relatedTo property, which includes curly braces:
{{ craft.entries({relatedTo: {targetElement: object, field:…
Tim Kelty
- 3,081
- 1
- 18
- 29
4
votes
1 answer
How to build a transactional email platform with Craft
I am building a transactional email platform for my users.
Users will subscribe to a digital program and receive daily emails depending on their profile and parameters.
This email sending will be:
- time based
- and user subscription based
…
Miguel Bocquier
- 972
- 1
- 7
- 19
4
votes
2 answers
Query only returning 100 records at a time?
I am trying to export data from a database to a csv file, I am using the code below to retrieve the data from the DB, but it only returns 100 rows, how can I fix that?
$criteria =…
user2997606
- 509
- 4
- 12
4
votes
1 answer
Check if an order has been refunded in a template?
What’s the best way to check if an order has been refunded in a template?
For example, you may want to:
Add a message to the order/invoice template if a refund has been successful.
Determine the status of the refund; perhaps displaying a different…
James
- 1,138
- 8
- 20
4
votes
1 answer
Default price in Craft Commerce
I have a Product Type where every product has the same price. What are some good ways to avoid having to enter this same price for every product?
Marion Newlevant
- 12,047
- 22
- 55