Closed julien1619 closed 10 months ago
Hi @julien1619 !
It's a cool feature we want to have so thank you :) Do you think you can add a sample UI Element in the test application using this feature ?
Yes, I will add a Row component today ;)
It's done and tested :)
Very nice work 🚀 I have a suggestion about the element.
Maybe it could be nice to have a "2 columns" element instead. WDYTOT ?
That I cannot push on your branch, you can check this commit :
I tend to prefer the multi-columns one because our use case is to put multiple components (between 2 and 5) in columns on desktop. So my component doesn't limit the number of column, but it doesn't allow to put multiple elements inside one column.
One solution to have both way would be to have two components :
What do you think? I would understand if you prefer to keep it simple, but I think it could work well.
Yes it could be great. Can you check this commit ? It's done, I updated README and also add some borders in admin to understand the layout separations.
I still have an issue in Admin. If I use the column element in row element, the Shop template is used for the Column element.
Example :
It seems perfect to me!
I still have an issue in Admin. If I use the column element in row element, the Shop template is used for the Column element.
I will try to check this tomorrow, if you have a clue I get it 😉
I've found why. In fact the twig filter always render the shop element, not the admin one. When you try to render the row element, the column will be rendered with the front element. Here it is:
$template = $uiElement->getFrontRenderTemplate();
Maybe you can create the same filters than the existing ones but for the admin part and use it inside the column and row?
public function getFilters(): array
{
return [
new TwigFilter('monsieurbiz_richeditor_render_field', [$this, 'renderField'], ['is_safe' => ['html'], 'needs_context' => true]),
new TwigFilter('monsieurbiz_richeditor_render_elements', [$this, 'renderElements'], ['is_safe' => ['html'], 'needs_context' => true]),
new TwigFilter('monsieurbiz_richeditor_render_element', [$this, 'renderElement'], ['is_safe' => ['html'], 'needs_context' => true]),
+ new TwigFilter('monsieurbiz_richeditor_render_admin_field', [$this, 'renderAdminField'], ['is_safe' => ['html'], 'needs_context' => true]),
+ new TwigFilter('monsieurbiz_richeditor_render_admin_elements', [$this, 'renderAdminElements'], ['is_safe' => ['html'], 'needs_context' => true]),
+ new TwigFilter('monsieurbiz_richeditor_render_admin_element', [$this, 'renderAdminElement'], ['is_safe' => ['html'], 'needs_context' => true]),
];
}
It will be done automatically using the firewall context : https://github.com/monsieurbiz/SyliusRichEditorPlugin/pull/203/commits/4a0da1d99e958acaeef00e86c851532640a763dc
Test failed, we have 2 options :
I think we can close this one and merge the other one.
Thank you @julien1619 🚀
Hi everyone!
This PR aims to add the ability to use the rich editor inside another UIElement, it allows the user to create a row/column component.
To add this feature, two main changes were done:
closes #172