12
votes
Accepted
How can I print the name of every template being rendered in HTML comments, when in devMode?
So this sounded like a fun problem to solve... so I wrote the Template Comments plugin that does what you want:
This free plugin adds a HTML comment to demarcate {% block %}s and each Twig template ...
9
votes
Accepted
Craft 3: how to show the Yii Debug Toolbar?
There are two checkboxes in your user settings, go to your admin account -> preferences index.php?p=admin/myaccount and check the boxes
This is covered in detail in the Profiling your Website with ...
5
votes
Craft 3: how to show the Yii Debug Toolbar?
For anyone finding it annoying having to be authenticated to enable the debug bar, particularly when testing in multiple browsers, it’s easy to override this behaviour with a custom module.
Just add ...
5
votes
Craft 3: how to show the Yii Debug Toolbar?
Craft 3
If you enabled the debug toolbar in the user profile, but it still does not show on the frontend, AND you are running Craft not locally but on a different host (different IP), try adding this ...
4
votes
Accepted
Debugging with dump()/dd() within Twig templates
This bothered me too until I switched to PHPStorm and started using this: https://github.com/nystudio107/craft-autocomplete.
If that's not an option and you fancy extending Twig, you can use php's ...
4
votes
Accepted
Is it possible to display the debug bar while NOT logged in?
I don't think there is an option in craft to do that, but if you really wanted to do this you can create your module and add this code inside the init function.
$request = Craft::$app->getRequest()...
3
votes
Assets (images) return a 404 on the front-end
Just had a similar issue with a colleague. Double check your folder permissions. It might be the case that Craft isn’t allowed to write the transformed files to your assets folder.
Something like ...
3
votes
Accepted
How to add a custom panel to the debug bar?
I'm not sure this is the proper way to do it but I got this working.
I used the Yii\Application::EVENT_BEFORE_REQUEST event in my plugin's
init() method:
<?php
namespace my\namespace;
use craft\...
3
votes
Accepted
Discount Code applies to cart successfully but doesn't do anything. Am I missing something?
The reason for the discount not being applied is that nearly all your products have not been marked as promotable (by looking at your database):
Screenshot: http://jmp.sh/3FAK6NH
No sales or ...
3
votes
Accepted
What's the template command to print available tokens?
Stick {{ dump(_context) }} in a template file to print out all the available values.
{{ dump(_context|keys) }} Outputs the keys of the array without going through it recursively.
3
votes
Accepted
Error after downgrading from Pro to Personal
I was only able to answer this because the OP sent a support ticket to and was able to look at their database. :)
When the site was setup in Craft Pro trial mode, the content was built out with ...
2
votes
What are the minimum permissions to show the Craft debug toolbar?
The debug toolbar is available to Admin users only, see https://craftcms.com/features/all#debug-toolbar
There's no way of customising this, the line of code that enforces it can be seen at https://...
2
votes
Debugging Craft CMS templates on Visual Studio Code
There are so many Extensions available on visual studio code. You can install for the language snippets, for auto-suggest code, and for checking syntax. If you are looking for the debug page load ...
2
votes
Error handling in Craft
The usual method for debugging a Craft site is to pull down a copy of the production database content, import it into your local development database and run a local copy of the site's code on your ...
2
votes
Invalid field uid
I had the same thing it was an old Entry Instructions field that was a Craft 2 plugin. Search for the invalid UID in your /config/project folder - that is where I located mine. It will show up in a ...
2
votes
evaluateDynamicContent() is disallowed
As the debug toolbar is build-in, you do not have to add it with composer.
You can enable the build-in debug toolbar in the upper right corner on your control panel.
Click on your user account
Tab: ...
2
votes
Debug Toolbar Not Displaying on frontend
This can happen if the HTML on the site’s front end is malformed. e.g. you have an opening body tag, but you’re missing the closing.
View the source on the page and run it through an HTML validator to ...
1
vote
Debug Toolbar Not Displaying on frontend
Maybe too obvious question, but.. did you check that checkmarks are set correctly for the debug tool in the account settings(My Account -> Preferences)?
Also, devMode is off/on on your website?
1
vote
Debug Toolbar Not Displaying on frontend
clearing caches / Forced browser reload is something that helps me out when it comes down to render changes..
1
vote
Accepted
Invalid field uid
The only place that message appears in the Craft CMS codebase is here.
So, the most likely cause is that something (Craft itself or a plugin/custom module) is calling the setFieldUid() method on a ...
1
vote
How can I print the name of every template being rendered in HTML comments, when in devMode?
I think the answer is "no". There is no config or existing plugin that adds the debugging information I want.
1
vote
Random Fatal errors header already sent
Solved: this turned out to be a WHM/CPanel bug that was loading imagick module twice.
Known fixes were found here: https://forums.cpanel.net/threads/php-warning-module-already-loaded-in-unknown-on-...
1
vote
How can I debug `craft\web\User::_validateUserAgentAndIp()` warnings
Most likely since it's a production site, it's from bots/scripts hitting the site's login page probing for vulnerabilities.
I'd suggest changing the cpTrigger config setting and see if the ...
1
vote
Yii Toolbar triggering mixed content warning in CP
On a multi-site setup, you need to use the multi-site array syntax for the siteUrl config setting like so:
'siteUrl' => [
'siteHandle1' => 'https://foo.com/',
'siteHandle2' => 'https:...
1
vote
Assets (images) return a 404 on the front-end
Not a direct answer to your question, but I keep a pretty up to date Nginx config for Craft here: Nginx-Craft that may be useful to you at some point.
Glad you got it sorted.
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
debugging × 35templating × 7
craft3 × 5
plugin-development × 4
control-panel × 3
yii × 3
devmode × 3
plugins × 2
image × 2
craft4 × 2
entries × 1
assets × 1
plugin-craftcommerce × 1
users × 1
redactor × 1
error-message × 1
admin × 1
multi-site × 1
craft2 × 1
performance × 1
richtext × 1
permissions × 1
array × 1
404 × 1
session × 1