Giter Site home page Giter Site logo

Comments (4)

tidyui avatar tidyui commented on June 2, 2024

Could you share your startup code. If you have this line in your startup:

https://github.com/PiranhaCMS/piranha.core/blob/master/examples/RazorWeb/Program.cs#L66

And you remove the old PageTypes from the content type sync, they are considered orphans and will be deleted. Deleting PageTypes will effectively cascade the pages based on those.

Best regards

from piranha.core.

MiklosSi avatar MiklosSi commented on June 2, 2024

Yes, I have exactly as it was originally (as in the link above).
However, previously I made several pagetypes, but I added a new that did never show up and I consequently removed that last one. Before I removed that pagetype, I also tried to add it by adding the line with .AddType(typeof(PageTypeModel) without success.

All tables that start with Piranha_Pages*, except Piranha_PageTypes got empty as well as the tables that start with Piranha_Content*.
Piranha_BlockFields and Piranha_Blocks still have the data.

from piranha.core.

tidyui avatar tidyui commented on June 2, 2024

Since there's no code in the framework that deletes pages (unless explicitly calling api.Pages.DeleteAsync(...) besides removing PageTypes, the only explanation is that you at some point during the testing removed all PageTypes except the new one, thus deleting them. Then you reverted your code which inserted the old PageTypes again, but then the pages had already been deleted. I suggest that you remove the call to DeleteOrphans() until you've set up your solution.

Please also share your page type so we can take a look at why it's not importing correctly, this is usually due to some attribute missing on the class itself.

Regards

from piranha.core.

MiklosSi avatar MiklosSi commented on June 2, 2024

Ok, now I get it :)
If I remove the call DeleteOrphans() , this cannot happen again?
I don't have that pagetype left as I removed it. It was a very simple type, like a FAQ page. I could use existing blocks, but I wanted something that made difference in the front end.

It was like:

[PageType(Title = "FAQ page")]
public class FaqPageType  : Page<FaqPageType>
{
public class FaqRegion
    {
        [Field(Title = "Question")]
        public StringField Question { get; set; }
        [Field(Title = "Answer")]
        public StringField Answer { get; set; }
    }

    [Region(ListTitle = "List of FAQ")]
    public IList<FaqRegion> Faqs { get; set;}
}

Thank you for your prompt answers!

from piranha.core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.