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.3k
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.4k
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. $(...
Bill Criswell's user avatar
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 ...
Mats Mikkel Rummelhoff's user avatar
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 ...
Brandon Kelly's user avatar
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

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 ...
Erik Reagan'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.2k
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.4k
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 ...
carlcs's user avatar
  • 36.2k
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
  • 23.9k
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.3k
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
  • 23.9k
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.4k
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 -> <...
Regan Lawton'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,410
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 ...
Lindsey D's user avatar
  • 23.9k
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....
biko's user avatar
  • 660
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 ...
Mats Mikkel Rummelhoff's user avatar
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.2k
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
  • 23.9k
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.3k
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

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