FriendsOfTYPO3 / frontend_editing

TYPO3 CMS Frontend Editing
https://friendsoftypo3.github.io/frontend_editing/
102 stars 39 forks source link

Can't edit custom content elements, add new elements around them or in an empty page #262

Closed mickenorlen closed 3 years ago

mickenorlen commented 6 years ago

Hey guys, Micke here, I thought i'd make a more detailed report of the issues I've found.

I'm using the bootstrap_package, https://github.com/benjaminkott/bootstrap_package from the official distribution as foundation for my installation.

When creating a new (empty) page

Html source for my empty page with and without frontend_editing enabled: https://gist.github.com/mickenorlen/54b72d305b6df06f5c6be5a61debc0a8

When core content elements already exist

Html source for the page with content elements with and without frontend_editing enabled: https://gist.github.com/mickenorlen/1c1e563886137d98d4c8ffa45ef85740

Thanks.

ko-je commented 6 years ago

Hey Mike,

have you written in your TypoScript colPos correct?

styles.content.getLeft < styles.content.get styles.content.getLeft.select.where = colPos=1

If you use {#colPos}, it doesn't work.

https://github.com/FriendsOfTYPO3/frontend_editing/commit/5fd299152d7d112e2541278e0582c9795a61af11

Bye

mickenorlen commented 6 years ago

Not sure if you're talking about the backend layouts pageTS, in that case it doesn't seem like thats the problem.

I use the layouts from the bootstrap package that look like this: https://github.com/benjaminkott/bootstrap_package/tree/master/Configuration/PageTS/Mod/WebLayout/BackendLayouts

In the example I used default, but just checked also in the special_start and its the same problem.

These backend layouts are included in ext_localconf by:

// Add BackendLayouts BackendLayouts for the BackendLayout DataProvider
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/Configuration/PageTS/Mod/WebLayout/BackendLayouts.txt">');
}

https://github.com/benjaminkott/bootstrap_package/blob/master/ext_localconf.php

If you're talking about the typoscript for the content elements they look for example like this: https://github.com/benjaminkott/bootstrap_package/blob/master/Configuration/TypoScript/ContentElement/Audio.typoscript

And the lib.contentelement the element is based on looks like this in the template analyzer: image

Thanks

ko-je commented 6 years ago

I think this is the problem.

in frontend_editing is a condition to need only colPos. Look this Link, please. https://github.com/FriendsOfTYPO3/frontend_editing/blob/4b8d5761ad15d0e587fd45d851b23833eb647dfe/Classes/Hook/ContentObjectRendererHook.php#L59

in bootsstap_package will use {#colPos} https://github.com/benjaminkott/bootstrap_package/blob/8d0645739e5a8d0decb5a20becac72509955b20b/Configuration/TypoScript/Helper/DynamicContent.typoscript#L77

If you change the line 77 in DynamicContent.typoscript it will work. The point is all condition in ContentObjectRendererHook.php must true!

mickenorlen commented 6 years ago

Thanks! With this change I can now add elements to an empty page. However, I still cannot edit the custom elements and there are no placeholders for new elements around them either. Not sure how these are recognized?

ko-je commented 6 years ago

https://github.com/FriendsOfTYPO3/frontend_editing/blob/master/Configuration/TypoScript/setup.ts#L9 I hope this link help. :-)

mickenorlen commented 6 years ago

Hi, sry for late reply,

I talked to benjamin kott of the bootstrap package and he said the following:

the final implementation is not chosen yet, as soon as frontend_editing finds its way to the core it will get compabilbe until then, no support is planned also they are using an outdated identifier https://github.com/FriendsOfTYPO3/frontend_editing/blob/master/Configuration/TypoScript/setup.ts#L9

lib.fluidContent is only available for backwards compatibility since 8.6 correct identifier would be lib.contentElement, working implementations can be seen here https://github.com/benjaminkott/bootstrap_package/blob/master/Configuration/TypoScript/ContentElement/Text.typoscript#L6 https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/fluid_styled_content/Configuration/TypoScript/ContentElement/Text.txt#L6

so basicly their code is broken

Do you think this could somehow be fixed soon? Thanks again

xima-wla commented 6 years ago

This is still a bug even when bootstrap_package extension is not in use. On a blank page I just can add new content elements via drag & drop in header area but not in content area. When I create a new content element in content area in the backend I can drag some content elements in frontend editing.

xima-wla commented 6 years ago

Found a solution for that.

content_0 < styles.content.get
content_0.select.where = colPos=0

You have to specify explicitly the colPos 0 for styles.content.get

mabolek commented 5 years ago

@mickenorlen Does @xima-wla's solution work for you?

mickenorlen commented 5 years ago

I'm not so active in that project anymore, but I'll remember to test it when I'm working next time. Thanks

MattiasNilsson commented 3 years ago

The solution have been verified by me and works like a charm.