Hot answers tagged

14

I might be shooting in the sky, but make sure that in your in your .htaccess you have RewriteBase / after RewriteEngine On


11

The cpTrigger config setting is what you're looking for.


10

The problem was actually Chrome using iOS emulation when viewing the site, thus spoofing the UA string into something different than the usual Chrome UA string when logging into the admin area. Solution (as suggested by @craftcms on Twitter) was to set: 'requireMatchingUserAgentForSession' => false In craft/config/general.php For whatever environment ...


9

The feature request for this has been very popular since day one, so hopefully it's something P&T adds to the core some day. For the interim I just published a small plugin called Reasons, which will add simple field/value based conditionals to entry type field layouts - pretty much exactly like the OP describes it. Download from GitHub: https://github....


9

Most likely wherever Apache/PHP is configured to save session files doesn't exist or isn't writable. If you've got the overridePhpSessionLocation config setting set to true, then that will be in craft/storage/runtime/sessions folder.


8

Yes, since Craft 2.3 you can edit the CP's index views for entries, assets, etc. from a plugin. Have a look at the documentation for the hooks defineAdditionalEntryTableAttributes and getEntryTableAttributeHtml to see some sample code. Making a little plugin for this is easy, simply copy and paste the above sample code into your primary plugin class and ...


7

Yii will check for the following server environment variables when determining if it’s an SSL request: HTTPS – should be set to “on”, “ON”, or “1”; or HTTP_X_FORWARDED_PROTO – should be set to “https” or “HTTPS” Apparently this is a common issue when running PHP on Nginx, since that HTTPS env variable is only an Apache convention. Here’s an article that ...


6

You can edit this in the general config https://craftcms.com/docs/config-settings#cpTrigger return array( 'cpTrigger' => new-url, );


6

The top links in the CP header are often called nav tabs. Beyond the "default" nav tab for your plugin (pointing to the plugin's CP section), it's possible to declare additional tabs via the modifyCpNav hook (added in Craft 2.3.2640): public function modifyCpNav(&$nav) { $nav['mypluginhandle-newsletter'] = array('label' => 'Newsletter', 'url' =&...


6

Yes. you can: Here I created a User group which has only access to the english part of the content. As you can see these are checkboxes. So you can grant access to multiple languages at once.


5

Good call Brad! Not sure why that didn't occur to me :) Here's how that's done: # Kill admin access RewriteCond %{REQUEST_URI} ^(.*)/admin RewriteRule ^(.*)$ - [F,L]


5

After doing some digging around I found the getDraftsByEntryId(entryId, locale) method of the craft.entryRevisions service that might help. The following should return the first draft of an entry. Note: there is a second argument for 'locale', which defaults to current locale if none provided. Also not sure whether 'first' or 'last' would be considered the ...


5

No, Craft doesn't offer conditionals in field layouts. Coming from Wordpress/ACF, I'd personally like to see something like that implemented in the future, but for now I can think of two possible workarounds for your specific scenario: Set up two different Entry Types for your "products" section, e.g. "Video" and "Image". Design identical field layouts for ...


5

Download and install a fresh copy of Craft from http://buildwithcraft.com somewhere (doesn't matter if it's the same computer your existing site is on or not). During installation, remember the password you entered when setting up the user. Open the database and look in the craft_users table. Copy what's in the password column for the user that the installer ...


5

If you don’t have access to another admin account, you could unlock the account directly in the database. Change the lock value to 0 for the account in the craft_users table.


5

Probably the name of the folder isn't the plugin handle. Check inside the plugin's folder to see if the actual plugin folder is inside there. For instance: forge@nys-production ~/nystudio107.com/craft/plugins (master) $ tree -L 1 craft-typogrify/ craft-typogrify/ ├── readme.md └── typogrify In this case, when the plugin is downloaded or cloned, the name of ...


4

There is nothing that will automatically sort blocks for you in the Control Panel. Without writing a plugin with some very fancy JavaScript, the only way to arrange blocks is manually. You can manually arrange your blocks by clicking & dragging the crosshairs in the upper-right corner of each block:


4

In case it helps someone, my issue was the permissions for the root index.php file...It was 666 (writeable by group) and when I switched that file permissions to 644, the installation was able to move forward.


4

That’s not possible, as tags are meant to be more of a “folksonomy” rather than a strict taxonomy. Sounds to me like categories would be a better fit for your needs. With those, the options are defined in advance, and chosen from the fields, rather than created from the fields. Update: We just updated the Categories and Tags feature page with a new video ...


4

Have you got your htaccess file working ok? By default the htaccess file is named incorrectly, it should be .htaccess nothtaccess`. You can read about renaming that file in the installation docs. As a quick test you could try: "/index.php/new-url" If that works it's your htaccess file.


4

Craft will automatically 'rotate' logs into new files as each current file reaches the maximum size (~1MB). This is why, if you look in /craft/storage/runtime/logs, you may see craft.log, craft.1.log, craft.2.log, etc. (I think Craft keeps a max of 5 files around before rotating them off into the ether.) At present, the max size, naming convention, and ...


4

You can use "incognito mode" in your browser, or you use another browser or computer for this type of front end testing.


4

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 accessible, cautiously re-enable each plugin one-by-one. This will help you hone in on which plugin may be causing the problem.


4

Inspired in part by Mats' detailed answer, I've written a plugin that does just this: MN Snitch Enjoy!


4

The CpSortableCustomColumns plugin lets you sort your element index tables on custom fields. Sounds like it does exactly what you want.


4

If you go to Craft Settings > General you can add a site icon in there plus a logo for the login page.


4

Absolutely! In fact, you've outlined the steps needed to do so... Rename craft folder Change $craftPath value in index.php That's it!


4

I'm an idiot. In the Settings area, I was expecting the plugin to show up in the Plugin section after uploading. Don't know why, but noticed last night that under the System section, there was a plugin option there. Once I went in there, and actually installed the plugin, it showed up under the Plugins section. sheesh


4

This is not actually my answer since it's from Andrew Welch on Twitter here: https://mobile.twitter.com/nystudio107/status/1063135843441954816 If you have access to MySQL, you can change the admin user password to secret using this hash: $2y$13$FfVKvo1W1N5Gsba3c19r8uz.x9R5NRQgRu8jmXvOjVCStg1sKGcoW


3

Nothing native in Craft that would do this, but I suppose you'd be able to .htaccess redirect all requests to your cpTrigger.


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