Skip to main content
Share Your Experience: Take the 2024 Developer Survey
20 votes
Accepted

{parent.uri}/{slug}

To pull off the same functionality in Craft 3, you could use something like this: {entry.last().uri}/{parent.uri}/{slug}
Brad Bell's user avatar
  • 67.5k
11 votes

Is there a way to detect if a action is triggered from a control panel form?

If anyone comes here looking for this answer for Craft 3 the function you are looking for is Craft::$app->getRequest()->getIsCpRequest()
nfourtythree's user avatar
9 votes

Why is the cpresources folder so big?

Craft CMS 3 uses Yii2 Asset Bundles for AdminCP resources. This lets it handle dependencies such as certain scripts not loading before jQuery, for example. Remember that many Craft CMS 3 components ...
andrew.welch's user avatar
  • 11.6k
6 votes

Live Preview not working

Another cause of Live Preview not working that can be a pain to debug, because there are no 'errors' as such is your .htaccess setup. For example, on one site we had the following .htaccess entry to ...
billythekid's user avatar
6 votes
Accepted

Is there a way to detect if a action is triggered from a control panel form?

Yes there is, craft()->request->isCpRequest() returns whether the request is from the CP or not.
carlcs's user avatar
  • 36.3k
6 votes

/admin/actions/users/login 404

What server provisioner are you using? Forge? Something else? If it's Forge, it's most likely this: https://twitter.com/nystudio107/status/895726366477344772 Also here are some Nginx configs (with ...
andrew.welch's user avatar
  • 11.6k
6 votes
Accepted

Login Page Logo and Site Icon with Project Config

System Settings don't support rebranding via Project Sync, however if you place your assets in the following locations and commit to GIT you can get similar results. Login Page Logo -> <...
Regan Lawton's user avatar
5 votes
Accepted

Is there a way to see the total number of entries in a channel in the CP?

You're looking for the Content Stats plugin by Will Browar: https://github.com/wbrowar/contentstats
Lindsey D's user avatar
  • 24k
5 votes

Cannot enable Craft plugin in control panel

My guess is it's a case sensitivity issue with the main plugin class/file name (some operating systems have case sensitive filesystems and some don't). You can review the requirements for how things ...
Brad Bell's user avatar
  • 67.5k
5 votes
Accepted

How can I add images to field instructions?

This works with standard markdown code... ![Alt text](/path/to/image.png) You can use either a full URL, or a local path to the image.
Lindsey D's user avatar
  • 24k
5 votes
Accepted

Customize Admin Sidebar Menu Items?

Craft does not offer this functionality natively. Luckily there's a few plugins out there that will help your users navigate around a bit easier: In the CP Nav https://github.com/engram-design/CPNav (...
Chase Giunta's user avatar
5 votes
Accepted

ElementType CP section does not display table

You haven't defined any sources for your ElementType. <?php public function getSources($context = null) { $sources = [ '*' => [ 'label' => Craft::t('All entries'), ...
Fred Carlsen's user avatar
  • 2,997
5 votes
Accepted

/admin/actions/users/login 404

So I looked into this a bunch more tonight to satisfy my curiosity, and here's what is happening. The default rewrite rule that Forge is apparently adding is this: if ($request_uri ~* "^(.*/)index\....
andrew.welch's user avatar
  • 11.6k
5 votes
Accepted

Displaying notification in control panel

Craft's JS/UI framework "Garnish" is largely undocumented, but exploring the Craft object it exposes in the console, I found a few methods that might be useful: // Good for confirmations (...
August Miller's user avatar
5 votes

How to modify the login panel

You can add a logo to the login page by uploading one to Settings → General Login Page Logo. If you need further tweaking, you could use the Control Panel CSS plugin. I wouldn't recommend modifying ...
Oli's user avatar
  • 7,495
5 votes

Plugin "Typed Link Field" -> Alternative for Craft 5?

You can somewhat replicate it in 5 with an Entry Type and conditional fields that only expose the particular field based on the value ofa dropdown for type selection. I'm not sure how efficient that ...
Matt Wilcox's user avatar
  • 3,209
4 votes
Accepted

Log in as different users in backend front end at the same time?

You can use "incognito mode" in your browser, or you use another browser or computer for this type of front end testing.
carlcs's user avatar
  • 36.3k
4 votes
Accepted

Settings in Admin Panel Blank

There's a chance that one of your plugins is causing this behavior. Go into your craft_plugins table, and change the value of enabled to 0 for every single plugin. If your Settings page is then ...
Lindsey D's user avatar
  • 24k
4 votes
Accepted

YouTube video embeds in rich text field not saving

My guess is you're running into one of two issues. You're bumping into your php.ini file's max_intput_vars and/or post_max_size limitations. Your server has something like Suhosin or mod_security ...
Brad Bell's user avatar
  • 67.5k
4 votes

Triggering JavaScript from back-end event

When an entry is saved, an Entry saved. flash message is set and displayed by Craft. You could use the Control Panel JS plugin to write a script to detect this flash message and perform your desired ...
Steve Rowling's user avatar
4 votes
Accepted

How can I dynamically remove some unwanted formatting tags inside rich text fields?

Not a "real" answer because it won't fix your actual content, but I wrote a plugin that would make it easy to remedy your issue on the front end (i.e. in the template) – To remove all <h1> and &...
Mats Mikkel Rummelhoff's user avatar
4 votes
Accepted

The file does not appear to be an image. Bug?

That error will occur if the fileinfo extension or imagick (ImageMagick) extension are not configured with a comprehensive list of file MIME types (the "magic file", as they refer to it, I think), or ...
Brandon Kelly's user avatar
4 votes
Accepted

Control panel field name & instructions translations

If your main language site is dutch for example, you can do that using your own php files locale and naming them according the other locales languages, en.php, fr.php and put those files in craft/...
Barbara Cinotti's user avatar
4 votes
Accepted

Filter entries in the CP based on custom permission

After some digging I came up with some answers myself. For future reference, here they are: Is the event triggered by the CP: if(craft()->request->isCpRequest()){} Check the logged in user's ...
Tom De Smet's user avatar
  • 1,456
4 votes
Accepted

Control Panel Date Format

Craft 2 The Date/Time formatting in the Control Panel is based on what locale you're using when you're viewing the Control Panel. If you have eb_gb as a locale defined under Settings->Sites->Locales,...
Brad Bell's user avatar
  • 67.5k
4 votes
Accepted

Craft incredibly slow site performance

It turned out this was the culprit. Craft was doing a deprecationerrors query (https://github.com/craftcms/cms/issues/2539). Turning devMode to false fixed this. Hope this helps someone...
Hassan Mahmood's user avatar
4 votes
Accepted

Unable to create a "Single" entry

You should create a new single in the "Section" area of the settings page. It should just create the single after you have created the section.
Clark Nelson's user avatar
4 votes
Accepted

Bad Request Unable to verify your data submission and unstyled CP

There isn't really enough information here to give a full answer, but 'Bad Request Unable to verify your data submission' means that Craft is not getting supplied the correct CSRF token. To confirm, ...
Jeremy Daalder's user avatar
4 votes

How to modify the login panel

I solved this by adding a module that is supposed to act as a sitemodule with different functions I use over most of my projects. Inside that module you register an asset bundle that ultimately adds a ...
MisterMike's user avatar
3 votes
Accepted

URI not shown anymore for structures?

For each entry type, there is now an easy way to manage what columns are shown. From the admin, if you choose Entries from the main navigation, and then go to the entry type in question, you should ...
Gavin Anderegg's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible