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}
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()
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 ...
8
votes
Accepted
Possible to speed up infinite scrolling?
You could open up the console and paste this then scroll to the bottom once.
After that, this will keep scrolling to the #footer every time a response from the getMoreElements request comes in.
$(...
7
votes
Accepted
Show field handles on control panel
Original answer, for Craft 2:
There's a plugin called CP Field Links which will display field handles and provide easy access to field (and entry type) settings. Please note that the plugin requires ...
7
votes
Accepted
Twig url() function returns CP path when called from plugin
Right, url() (and UrlHelper::getUrl(), which url() maps to) will create a URL to either a front-end page or a CP page, depending on where it is being called from.
If you want to get a front-end URL ...
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 ...
6
votes
Accepted
How do I properly use Twig syntax in dynamic title/URL fields?
After chatting with The Honorable Brad Bell I learned that the sample tags in the field's label are showing some shorthand references to a few variables. (The {slug} reference for example.)
All I ...
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.
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 ...
5
votes
Accepted
Filter entries by entry type in the CP?
What you can do is to create additional entry sources using the modifyEntrySources hook.
This is a very simple example, that will add a heading and two sources to the end of the
sources list (below ...
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
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 ...
5
votes
Accepted
How can I add images to field instructions?
This works with standard markdown code...

You can use either a full URL, or a local path to the image.
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 (...
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'),
...
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\....
5
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 -> <...
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 ...
4
votes
Accepted
Change Save entry to Publish possible?
Use JavaScript to find the button and change the text. Fortunately, the Craft CP contains jQuery, so it should be fairly easy.
This plugin should help speed up the process... Your JavaScript will get ...
4
votes
Blank entry page in CP
Had the same issue running OS X running native Apache. It could be PHP config issue. Increase the max_nesting_level to something like 200. Add/edit the following line in your php.ini:
xdebug....
4
votes
Accepted
On Entry Creation Redirect
You'd have to write a custom plugin, that adds an event listener for the entries.saveEntry event.
The event listener should go into your plugin's primary class' init method. You'll need to make sure ...
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.
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 ...
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 ...
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 ...
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 &...
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 ...
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/...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
control-panel × 424plugin-development × 61
craft3 × 37
entries × 36
assets × 27
admin × 27
users × 25
templating × 20
plugins × 19
login × 17
matrix × 13
search × 13
error-message × 13
config × 12
localization × 11
categories × 10
entry × 10
permissions × 10
field × 9
performance × 8
session × 8
cp-dashboard × 8
redirect × 7
language × 7
garnish × 7