Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inserting multiple blocks in page has errors #81

Open
SplicedWeb opened this issue Jun 11, 2019 · 11 comments
Open

Inserting multiple blocks in page has errors #81

SplicedWeb opened this issue Jun 11, 2019 · 11 comments
Labels

Comments

@SplicedWeb
Copy link

Inserted
{% component 'contenteditor' file="filename_in_content1.htm" %}

Then later on page
{% component 'contenteditor' file="filename_in_content2.htm" fixture="h3" class="media" %}

Then again later on page
{% component 'contenteditor' file="filename_in_content3.htm" tools="left-align,right-align" %}

the 3rd instance is rendered as h3 ?

@Samuell1 Samuell1 added the bug label Jul 15, 2019
@Samuell1
Copy link
Owner

@SplicedWeb For temporary fix you can create other component and use only that for fixtures. I wasnt able to find a fix for this for now. Looks like components in octobercms are sharing properties together and that is the issue.

@SplicedWeb
Copy link
Author

Thanks Samuell1, I'm not sure I understand your fix though.

@Samuell1
Copy link
Owner

Like this. Just adding ContentEditor component in page and using this component name in your code.

obrázok

@SplicedWeb
Copy link
Author

Thanks so much for clarifying

@PubliAlex
Copy link
Contributor

another solution is to declare a fixture="" to the third element, otherwise, it will get the fixture of the last used element. Same for class

{% component 'contenteditor' file="filename_in_content1.htm" %}

{% component 'contenteditor' file="filename_in_content2.htm" fixture="h3" class="media" %}

{% component 'contenteditor' file="filename_in_content3.htm" tools="left-align,right-align" fixture="" class="" %}

@Samuell1
Copy link
Owner

@PubliAlex yep or that i was thinking to separate fixture and main editor to different components to prevent this issue but it will be backwards incompatible.

@jonathan-hc
Copy link

I just posted #101 and it looks like my problem is related. I have more than 10 instances of contentbuilder in my template in some cases, but I'm inserting the component in the layout only once. I do that because I don't want the entire HTML to be edited, only the text within individual h? or p tags Do I need to add the component 10 times in that case? That seems very impractical.

@Samuell1
Copy link
Owner

@jonathan-hc Yes, its because one component in page is same component it doesnt initialize per tag, i tried to somehow to find a solution but still nothing.

@Conobi
Copy link

Conobi commented Jul 30, 2020

I don't want the entire HTML to be edited, only the text within individual h? or p tags Do I need to add the component 10 times in that case? That seems very impractical.

Same issue here, it would be so cool to have a simpler syntax for editing a single tag, a bit like does this plugin: https://octobercms.com/plugin/fw-editme

@Samuell1 Samuell1 pinned this issue Nov 22, 2020
@PubliAlex
Copy link
Contributor

PubliAlex commented Jun 23, 2022

Another issue related to multiple blocks, it instanciate StylePalette multiple times :

image

As a result, styles are displayed multiple times :

image

EDIT : I add a precision, it does that when the content editor is called inside partials, cause, for each partials, the renderCount variable restart to 1. That variable should be more "global" and not restart for the whole page

@PubliAlex
Copy link
Contributor

Created a PR #117 that fix the issue of multiple StylePalette

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants