// Models/Contact.cs
using Piranha.AttributeBuilder;
using Piranha.Models;

namespace YourProjectNamespace.Models
{
    [PageType(Title = "Contact Page", UseBlocks = false)]
    public class Contact : Page<Contact>
    {
        // Add any properties you want for the contact page content here
        [Region]
        public string Address { get; set; }

        [Region]
        public string PhoneNumber { get; set; }

        // Add more properties as needed...
    }
}

Create the Razor view for the Contact page:

<!-- Views/Contact.cshtml -->
@inherits Piranha.AspNetCore.Page
@{
    Layout = "_Layout"; // Use your desired layout or "_Layout.cshtml"
}

@section meta {
    <meta name="description" content="@Model.MetaDescription">
}

@section title {
    <title>@Model.Title</title>
}

@section content {
    <h1>@Model.Title</h1>

    <p>Address: @Model.Address</p>
    <p>Phone: @Model.PhoneNumber</p>

    <!-- Add more content here as needed... -->
}

Register the Contact content page model in Piranha CMS: In your Startup.cs file, make sure to add the following code inside the ConfigureServices method to register the Contact content page model with Piranha CMS.

// Startup.cs
using YourProjectNamespace.Models; // Add the namespace of your Contact model

public void ConfigureServices(IServiceCollection services)
{
    // Other services registration

    // Add Piranha CMS
    services.AddPiranha(options =>
    {
        // Other Piranha configuration settings

        // Register the Contact content page model
        options.AddPageType<Contact>();
    });

    // Other configurations
}

With these steps, you have set up a basic Piranha CMS content page for the contact page. You can now create pages based on the “Contact Page” content type using the Piranha CMS admin interface, and the Razor view will render the content you provide for the address, phone number, and other properties. Remember to customize the Razor view and content model as per your specific requirements.