You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to create a custom archive + post type for a FAQ-Area on my site (razor pages).
Following the docs I created a FAQArchive and an FAQPost
namespace landingpage.Models.PageTypes
{
[PageType(Title = "FAQ Archive", UseBlocks = false, IsArchive = true)]
public class FAQArchive : Page<FAQArchive>
{
public PostArchive<FAQPost> Archive { get; set; }
}
//var model = await api.Pages.GetByIdAsync<SimpleArchive>(id);
//model.Archive = await api.Archives.GetByIdAsync<SimplePost>(...);
}
namespace landingpage.Models.PostTypes
{
[PostType(Title = "FAQ Entry")]
public class FAQPost : Post<FAQPost>
{
}
}
I can create a page with the FAQArchive-Type and add posts of type FAQPost - so far, so good.
Now when I navigate to the page (either preview or not) the page stays empty. I already tried to create a custom .cshtml file for my types but with no success.
So what is missing to complete my task ?? Do I need to setup some routing? Where would I place the view markup to have a custom rendering of my archive and its posts?
kind regards
The text was updated successfully, but these errors were encountered:
Hi there. By default all pages are routed to ~/page, all posts to ~/post and all archives to ~/archive. To add a specific route for a content type you either use the PageTypeRouteAttribute or PostTypeRouteAttribute. More information on this can be found in the documentation, here for page types: https://piranhacms.org/docs/content/pages
Hello,
I'm trying to create a custom archive + post type for a FAQ-Area on my site (razor pages).
Following the docs I created a FAQArchive and an FAQPost
I can create a page with the FAQArchive-Type and add posts of type FAQPost - so far, so good.
Now when I navigate to the page (either preview or not) the page stays empty. I already tried to create a custom .cshtml file for my types but with no success.
So what is missing to complete my task ?? Do I need to setup some routing? Where would I place the view markup to have a custom rendering of my archive and its posts?
kind regards
The text was updated successfully, but these errors were encountered: