verbb / expanded-singles

Craft CMS plugin to list Singles in the sidebar when editing Entries.
MIT License
53 stars 6 forks source link

Single pages not shown when creating an internal link with Redactor #6

Closed shoored closed 6 years ago

shoored commented 7 years ago

When I enable the plugin and set 'Expanded Singles' on, whenever I want to link to a Single Entry page from within Redactor, no Singles are shown in the Redactor link-dialog. Only Channel or Structures.

When I disable the plugin, the Single entries are again shown in the Redactor link-dialog.

lukeyouell commented 6 years ago

I've just noticed this too

svenjungnickel commented 6 years ago

Thank @shoored and @lukeyouell for the issue. I fixed it in the latest version for craft-2 and craft-3. Can you download and check if the issue still exists? Thanks.

lukeyouell commented 6 years ago

hey @svenjungnickel it now adds 'Singles' to the bottom of the list, this doesn't match the behaviour expected from the plugin and in my opinion could confuse clients. Unless I'm missing something?

svenjungnickel commented 6 years ago

Hey @lukeyouell. Which version are you using? Craft 2 or Craft 3? If you're using the Craft 3 version, did you install it via composer using the dev tag composer require verbb/cp-nav:dev-craft-3?

lukeyouell commented 6 years ago

@svenjungnickel I'm using the latest version of Craft 2

svenjungnickel commented 6 years ago

Just tested it. It appears for me at the top of the modal view. Can you provide some more details @lukeyouell, maybe a screenshot, config settings which differ from the default etc.?

lukeyouell commented 6 years ago

There are no config settings that differ from default. I've attached a screenshot displaying the singles at the bottom of the list.

screen shot 2017-11-29 at 11 03 47
svenjungnickel commented 6 years ago

Thanks. Seems a bit odd. But I will dive into it and try to figure out what that occurs. I will come back to you.

shoored commented 6 years ago

Thanks @svenjungnickel for the fix! This works correctly on my local Craft2 environment, version 2.6.2991

image

svenjungnickel commented 6 years ago

@shoored thanks for your reply. That shows me that it worked at least for some one :D @lukeyouell do you have other plugins installed which adjust the entry selection modal? Which Craft2 version are you using?

engram-design commented 6 years ago

@shoored @lukeyouell Just chiming in here after a decent amount of diving into how things are working (or not working!). Prefacing this by saying this is all working correctly in Craft 3.

In Craft 2, the available sections are prepared in its own private function, which check to see if sections have URLs. If entries don't have a URL, you obviously shouldn't be able to link to them. However, this is overriding the default entry index behaviour, and you'll notice your channel/structure headings aren't even being shown on the modal entry selector in a Redactor field.

After much investigation, its sad to say there is nothing we can do about this in Craft 2, short of getting P&T to change their code for the Rich Text field to accomodate for us. As such, we've had to disable Expanded Singles' functionality in the context of a modal window - when in use through Redactor, or an Entry select field. We can't have one working without negatively affecting the other.

Sorry there's no real solution to this, but we argue having your singles available to select (even if under the 'Singles' menu), is better than not being able to select them at all. We'll look at creating a PR to Craft 2 and see how we go with coming up with a solution...

engram-design commented 6 years ago

This has been fixed in the latest master for Craft 2. Its not really possible to fix this in Craft 2 I'm afraid. Closing for now.