11 votes

How do image focal points work in Craft 3?

While we’re piggybacking, here’s a snippet that goes one step further and generates the necessary CSS to position an untransformed image: {% set img = entry.headingImage.one %} {% if img %} {% ...
user avatar
7 votes

Server respond is very long (25s). Is there a way to optimize the perfomance?

Let me try to turn this into a more valuable StackExchange for others who will find it, since the original poster apparently got help and solved his problem without participating here. We can see so ...
user avatar
  • 1,697
6 votes

How can I try Craft Pro?

Douglas's answer is correct... Also, if you'd simply like to try Craft Pro before purchasing it, you can do so while running Craft in your local environment. https://craftcms.com/support/try-craft-...
user avatar
  • 23.6k
6 votes
Accepted

Can plugin have two links in admin navigation?

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 ...
user avatar
6 votes

Is there a tool to migrate Joomla/K2 entries into Craft?

I'm not sure there is anything specifically for importing from Joomla, but you could try the Import plugin. Depending on the data format, you may also be able to use the Feed Me plugin. Edit: ...
user avatar
6 votes

What if I continue my website using Craft CMS Pro trial?

They have answered this on the CraftCMS site: https://craftcms.com/support/license-enforcement Edition Enforcement Each time Craft phones home to check for updates, we check the incoming license to ...
user avatar
  • 449
6 votes
Accepted

How do image focal points work in Craft 3?

Focal points are used mainly for when Asset transforms (i.e. cropping) are performed in Craft. They tell Craft where it should focus on the image when performing these actions.
user avatar
  • 66.5k
6 votes
Accepted

Live preview + share button missing when switching to PRO licence

I've seen something similar happen. I don't know the cause of it, but the solution in the 2 cases I know of each has the same fix. What happened was that for some reason, the "preview targets" got ...
user avatar
5 votes
Accepted

Formatting Slug {postDate.month} to 2 characters

You should just be able to do: postDate|date('m') postDate by itself should give you a DateTime object which you can then apply the filter to.
user avatar
  • 4,519
5 votes

redirect index.php in urls on Craft site to NEVER show index.php

As another option that I usually do in addition to .htaccess, is to also add this to the array in craft/config/general.php file, and it'll stop Craft from ever adding the index.php. '...
user avatar
5 votes
Accepted

How do you get a section's ID

getSectionByHandle doesn't return an array, but a single SectionModel - so you need to remove the for loop: {% set enroll = craft.sections.getSectionByHandle('workshopEnrollments') %} {{ enroll.id }}...
user avatar
5 votes
Accepted

After upgrading to PHP 7 I started getting "storage folder isn't writable by PHP" errors

Try resetting the permissions of the storage folder: https://craftcms.com/docs/installing#step-2-set-the-permissions (It's possible that PHP was running with higher-than-default permissions in the ...
user avatar
  • 3,400
5 votes
Accepted

Passing JSON to Twig

The answer is to create a custom plugin that will read the json files from the folders in the public directory, parse the json, and pull them into the template. An alternative solution is to use ...
user avatar
5 votes

Seeking information on the largest Craft sites built

Stack Exchange is generally for more technical questions, so you might not get many replies here. Have you contacted the folks at Pixel & Tonic directly? You could also join the Craft CMS Slack. ...
user avatar
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 ...
user avatar
4 votes
Accepted

redirect index.php in urls on Craft site to NEVER show index.php

This came up in the Craft Slack not so long ago. You'd want something like this... # ------------------------------------------------------------ # Remove index.php # ---------------------------------...
user avatar
4 votes

Server respond is very long (25s). Is there a way to optimize the perfomance?

You have a lot of matrix blocks; I'm guessing that's why your output is slow. It looks like your initial query doesn't depend on any other input, so you could probably cache the whole thing. I would ...
user avatar
  • 6,477
4 votes
Accepted

Change page elements based on geolocation

Let's get the easy question out of the way first... Don't use Craft's localization to handle this task. While the localization feature is amazing and powerful, it doesn't fit the needs you're ...
user avatar
  • 23.6k
4 votes
Accepted

How to remove relationships between entries

A relationship field expects an array of element IDs. So to remove a user, you'd just get all the current IDs and remove the one you want to delete. // Get the current member IDs $members = $entry-&...
user avatar
  • 35.9k
4 votes
Accepted

Excluding an include template

There may be a better way, including adding exclusions as an array and checking if the segment exists in the array, but what about wrapping it in an if tag? This seems to work. {% if craft.request....
user avatar
3 votes

Can plugin have two links in admin navigation?

Do you mean have multiple tabbed content within your plugin admin area? If so yes that's possible you just need to add a tabs array in your template like so: {% set tabs = { tab1: { label: "Tab 1"|t,...
user avatar
  • 4,519
3 votes
Accepted

Create Plugin, Elementtype suggestion

You likely won't need to write a plugin at all – you can easily create different user groups (e.g. "Workers" and "Clients") from the Control Panel, and grant those groups different permissions. An ...
user avatar
3 votes

How can I try Craft Pro?

Assuming it is already installed and running, there should be a link to upgrade in the footer of the control panel which generates a modal window with options to buy or try. Keep in mind you will need ...
user avatar
3 votes
Accepted

Hide section on "Entries" tab

There’s no way to give a user group permission to create entries but not see those entries they created in the CP. The only way to achieve what you want would be to write a plugin that provides its ...
user avatar
3 votes

Detect device screen size in craft cms

I think you are going to struggle with this in Craft, you would need to do it through Javascript. Craft runs off PHP which is a server side scripting language, you need a client side scripting ...
user avatar
  • 4,519
3 votes
Accepted

Mutliple logouts required on Multiple App Servers

It sounds like your sessions are not being sticky. How many servers? Are you having to login multiple times as well to get things done? Apart from what Brad mentioned, couple things I'd try if you ...
user avatar
  • 6,477
3 votes

Change page elements based on geolocation

I think that you've outlined the process perfectly. To put the pieces together I would suggest that you create a small plugin (perhaps using the trusty BusinessLogic plugin as a starting point). To ...
user avatar
3 votes

How can I access disabled entries?

You would need to create a custom route in the Control Panel that matches the same basic routing as your entries. Then in the entry template, you need to add some extra code that pulls disabled ...
user avatar
3 votes
Accepted

Migrating Joomla K2 nested categories

Craft supports hierarchical, nested categories out of the box. It also supports hierarchical entries, assuming you used the Structure section type (and not a channel or single). Where Craft and ...
user avatar
  • 6,477
3 votes
Accepted

Equivalent of EE admin info code

Not exactly. But if you're looking for stats, devMode does some query profiling right in the console: I'm not sure if you're looking for a 1-1 correlation but you can obtain whether or not the server ...
user avatar
  • 6,477

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