Closed (fixed)
Project:
Frontend Editing
Version:
1.6.0
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
15 Mar 2024 at 07:17 UTC
Updated:
22 Apr 2024 at 16:42 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
sirclickalotUpdate
Forgive me, it turned out that with v1.6x I just needed to add some extra CSS to deal with the
:hoverstate...Manic jiggling
HOWEVER, this then resulted in a whole lot more 'jiggling' ! ...
Conclusion
Would it be a good idea to simply allow us to exempt entire regions from Front End Editing?
That seems to me to be a much more efficient than always including it and then having to override and hide it.
Thanks
Comment #3
a.dmitriiev commentedIn this issue https://www.drupal.org/project/frontend_editing/issues/3436377 there were improvements done, please try 1.x-dev version and check if it helps to improve the behavior.
Frontend editing works on entity level, so unfortunately, there is no context about the block or region where the content is included. Adding actions or not is decided by entity type and bundle only, as it is the only thing that is available in the rendered view of the entity. It is also possible, of course, to add view mode of the entity as a condition, so that for some view modes the links are added and for some not, but not for regions.
Comment #4
a.dmitriiev commentedI think this issue is related to https://www.drupal.org/project/frontend_editing/issues/3427666 . My guess from the previous comment was correct. I have checked https://www.drupal.org/project/ptoc module and it uses a special view mode
ptocfor the paragraphs in the sidebar. So it seems that what is needed is skip adding frontend editing links for this view mode, and this will fix the problem.I will add setting or a hook, where entity's view mode will be taken into account when deciding whether to show the links or not.
Comment #6
a.dmitriiev commentedI have added view display on the entity to the context of hook that decides whether frontend editing is allowed for current bundle or not. Here is an example how the hook can help:
Please check MR and add the hook to your custom module, this should help.
Comment #7
sirclickalotI have implemented that hook in my custom module...
I have check the markup of the sidebar region to be sure that the view mode used in indeed 'ptoc'..
<div class="contextual-region paragraph paragraph--type--sections paragraph--view-mode--ptoc">The hook triggers a fatal error...
Have I misundertood or got something wrong?
Thanks!
Comment #8
a.dmitriiev commentedAre you using the code from MR https://git.drupalcode.org/project/frontend_editing/-/merge_requests/53/... ? This change to alter hook is not yet in any stable version. When you confirm that it is solid solution and it works, I will add it to the next release.
Comment #9
sirclickalotAh sorry, I had not applied the patch.
I have now and I am seeing something different this time and it turns out that this happens even if DO NOT implement the hook!
Comment #10
a.dmitriiev commentedI have updated MR, please try once again.
Comment #11
sirclickalotIn attempting to path with latest, I am seeing a message saying "Cannot apply 1 hunk"...
To be clear, I rolled back from the applying the previous release of the previous '53' patch.
Comment #12
a.dmitriiev commentedPlease try patch from the diff directly: https://git.drupalcode.org/project/frontend_editing/-/merge_requests/53....
Comment #13
sirclickalotPatch applied, no errors now but still no disablement in my sidebar ;-(
Markup
Module code
Comment #14
a.dmitriiev commentedHave you cleared the caches after you have created the hook implementation in your custom module?
Comment #15
sirclickalotYes, cleared cache several times but no hooking in it seems.
Comment #16
a.dmitriiev commentedOk, I have installed ptoc module. The example of alter hook usage was wrong, it of course should be like this:
Please confirm, then I will merge MR
Comment #17
sirclickalot@a.dmitriiev yep, that's got it!
Thank you!
Comment #19
a.dmitriiev commentedComment #20
a.dmitriiev commentedAdded to 1.6.2 release
Comment #23
sirclickalot