Skip to content

Create Custom Blocks and Custom Pages Inside module #1830

Answered by blakepell
AmirrezaTaleb asked this question in Q&A
Discussion options

You must be logged in to vote

I just figured this out today. In a blog post, one of the Piranha authors had an example of a RawHtmlBlock block which I found very useful. The tricky part was just figuring out where the files went in the Razor Library and then getting the right build action for them.

See the solution explorer where I laid this out:

  • rawhtml-block.css => Embedded resource (do not copy)
  • rawhtml-block.js => Embedded resource (do not copy)
  • RawHtmlBlock.cshtml => Content (do not copy)

Then, my extensions module that your startup would call to register this:

using Argus.Web.Cms.Models;
using Microsoft.AspNetCore.Builder;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.FileProviders;

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by AmirrezaTaleb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1827 on February 21, 2022 16:10.