cofoundry-cms / cofoundry

Cofoundry is an extensible and flexible .NET Core CMS & application framework focusing on code first development
https://www.cofoundry.org
MIT License
835 stars 146 forks source link

Unable to Edit/Delete template region #549

Closed akash0234 closed 2 months ago

akash0234 commented 2 months ago

image

There is no icon cming to modify the region block. i have await Cofoundry.Template.CustomEntityRegion("Body").AllowMultipleBlocks().EmptyContentMinHeight(500).InvokeAsync()

set in my page template

HeyJoel commented 2 months ago

Your block code references custom entity regions, but the screen shot looks like you're ediing a regular page. Did you mean to use Cofoundry.Template.Region?:

@(await Cofoundry.Template.Region("Body")
    .AllowMultipleBlocks()
    .EmptyContentMinHeight(500)
    .InvokeAsync())

See Page Templates vs Custom Entity Pages.

Custom entity regions will only be editable on a custom entity page. You can also add regular regions to custom entity pages, in which case you'll get two edit buttons in the UI, one to edit the page template and one to edit the custom entity page.

akash0234 commented 2 months ago

Its a Custom Entity Page.. Blog Details ,, In the details page I have Template.Region("Body") as well as CustomEntityRegion I can see edit Template and Edit Page Button Below But onclick its not showing overlay buttons

HeyJoel commented 2 months ago

The Simple Site example works just fine for me and contains both custom entity pages and regular page templates, so perhaps you can see if this works for you and use it as a reference.

You're not providing enough information here to resolve the issue. I suggest that you try and create a minimal reproducable example, or just strip back your page to the basic html only and gradually introduce code to see where the issue is e.g. regions, css, javascript.

Some other things to think about:

akash0234 commented 2 months ago

Coundry .Net 6.

It used to work properly. I can see regions in the Blog details Admin. I dont see any errors in the console except some are not being loaded... I'm using chrome

Although I Can see my contents those are coming properly, Just cant edit them

akash0234 commented 2 months ago

I don't know how but

Somehow calling async functions inside custom Entity details page causing This button disappearance issue,

image

Finaly When i used normal ajax with no async code It started working like before..

image

I'm Closing the thread.. Thanks for your quick replies. ur awesome as always

HeyJoel commented 2 months ago

I think the problem is that you are assigning window.onload rather than binding with addEventListener. Unfortunately it looks like we're doing the same internally so you're overwriting our event binding. We should fix that in our code but I'll have a proper look tomorrow and verify.

HeyJoel commented 2 months ago

Ok, yes that was the problem and it's now fixed in v0.12.1. Thanks for responding with your solution, it triggered the fix.