Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Lynicon CMS for ASP.Net Core for .Net Standard 2.0/2.1 and .Net 4.6.1/4.6

License

NotificationsYou must be signed in to change notification settings

jamesej/lyniconanc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nuget

For ASP.Net Core 2.0/2.1 (.Net Standard 2.0, .Net 4.6.1 and .Net Standard 1.6, .Net 4.6)

Lynicon CMS

Now we believe the most powerful CMS on .Net Core.

It can be this easy to add content management to your site

routes.MapRoute("articles", "article/index", new { controller = "Pages", action = "Index" });public IActionResult Index(){  var data = new ModelType();  return View(data);}
routes.MapDataRoute<ModelType>("articles", "article/{_0}", new { controller = "Pages", action = "Index" });public IActionResult Index(ModelType data){  return View(data);}

Introduction

In tune with the .Net Core philosophy, Lynicon is a composable andunopinionated CMS which is lightweight and low impact yet full featured. It supportsfully structured content (i.e. JSON structures) defined as C# classes which can have properties which are subtypesor lists. Generally it maps one content item to a page, but it is trivial to set up as headless. It has no assumed tree structure forcontent, content relationship is defined by foreign key fields as in a relational database,with built-in facilities for traversing these relationships in both directions. Contentnavigation is done via a powerful filtering/search system, or via the site itself.

Content storage is highly flexible, it can be run without a database, with a SQL or other database,or customised to use almost any data source.

Delivered as a Nuget package or library, it will not get in the way of you using any other technology, orforce you to use its features, and can even be added into existing projects. It ishighly extensible with a powerful module system allowing you to remove unneeded featuresto decrease complexity and increase efficiency.

The content editor is shown alongside the page being edited so the effects of contentchanges are immediately visible. The rest of the backend is very straightforward as itdoes not attempt to provide the generally unneeded facilities to change content structureor front-end layout, this is done in code.

This CMS project provides the essential CMS functionality for Lynicon inASP.Net Core, perfectly adequate for a smaller site or application.There is an MVC 5 versionhere.The project site ishere, and this project builds aNuGet package whose page on Nuget ishere.Documentation on Confluence ishere. We welcome feedback toinfo@lynicon.com.

We have now released a module package supplying the major features neededfor a larger-scale CMS including caching, search, publishing,url management etc.This is availablehere(closed source/paid for)

Table of Contents

Setup

Because .net core 2.0 has breaking changes, the repository contains two branches,Core1.1 for .net core 1.1, andmaster is now .net 2.0. Makesure you check out the right branch.

Once you have cloned the repository, you will need to get the test site working on your machine.Set the connection string in appsettings.jsonAppsettings

You can now set up the database by running the test site from the command line (a handy feature ofan ASP.Net Core site!). Open a command window as Administrator and go to the \src\LyniconANC.Releasedirectory. Now rundotnet run -- --lynicon initialize-database.

Then you can set up the CMS admin user. Rundotnet run -- --lynicon initialize-admin --password p4ssw0rd.Initialize

You can now run the site and login with the password you set up (the email isadmin@lynicon-user.com)

If you would like to populate your database with sample content, there is a script at\src\LyniconANC.Release\Areas\Lynicon\Admin\SQL\TilesSiteContentSetup.sqlwhich will create example content for the test site.

How Tos

Log in as admin

Lynicon configures it's own customised ASP.Net Identity implementation. This means you can login via the (slightly modified) template code login page, using the admin email (admin@lynicon-user)and the password you configured above. Alternatively you can use Lynicon's built inlogin page at/Lynicon/Login

Create a content-managed route, controller & view

In Lynicon, you define a route as supporting content management, which thenpasses an instance of a content class into the controller, whichpasses it on to the view to display. This is described furtherin theonline manual.

For examples, look in theStartup.cs file,TileContent.cs file andTileController.cs.

Add and edit content items

Content items are listed and can be added at /lynicon/items.Content items can be edited by visiting a url with which the content itemis associated while logged in with the appropriate rights. The content editorpanel is shown.This is described in detail in theonline manual

Use HTML snippets, images, links etc in your content class

Since Lynicon uses C# classes to define the content schema, it provides standard classessuch as HtmlMin, Image, Link for storing data required in content management. This is describedin theonline manual.The built-in asset handling system allows upload of images or other assets through aWindows Explorer-style popup to a specified folder in the site.

Use lists and subtypes in your content class

Content classes in Lynicon can have properties of an arbitrary subtype, or List propertiesof arbitrary type T. The content editor manages this automatically. You can create custom editorsfor subtypes using the MVC templating system, by adding to the templates named after variouscontent subtypes which already exist inAreas/Lynicon/Views/Shared/EditorTemplates.This is described in detail in theonline manual

Link to other content items in your content class

Another standard property class in Lynicon is Reference. This stores the id of another contentitem in your content class. It appears in the editor as a drop-down list of content items oftype T. In code you can retrieve the referenced content item (actually, it's summary, see below)as a property on Reference or you can get all content items with a reference to another item.Examples can be seen inTile.cshtmlandTileMaterialContent.cs.See theonline manual for more depth.

Filter, search and report on content

Lynicon contains a page with various filters for creating, viewing, locating and reportingon content. This is at/lynicon/items/list or reached by clicking the Filter buttonon the bottom control bar on CMS pages. You can build custom filters which can be added tothe list available on this page. See theonline manual

Use the content API to create a list of items dynamically

Lynicon has a clean and powerful content API you can use in code to retrieve content directly. You cansee an example inHomeContent.cs. Generally when working withcontent objects external to building the page that displays them, you use aSummary Typewhich contains the subset of the full content object's properties for efficiency. The content API useslinq for filtering, can run queries across multiple data sources and lets you retrieve all content whose contenttype implements an interface or inherits from a base type.

Use property source redirection to create site-wide fields with values constant across the site

Lynicon has a powerful means of combining content from different sources in order to build a content item. Oneuse of this is to have a content item storing site-wide values, and have its fields be mapped into everycontent item on the site, e.g. for the url of the logo on the top banner. This is done in the example site by having a shared base type for all content on thesite and using this property source redirection method to map fields on the base type to a single shared contentitem. You can see how the base type is set up atTilesPageBase.cs.The shared fields are held inCommonContent.cs.

Administer site users

Lynicon has an admin page at/lynicon/users which allows you to administer site users if you have adminprivileges. Seethe online manualfor more on this.

Run without a database

The (closed-source but free) Lynicon.Extra package onNuget providesthe Storeless module which converts Lynicon to run with CMS data in memory, with backup persistence to a JSON file.Seethe online manual for how to set thisup - it's very simple and reduces hosting costs while making Lynicon run super fast for websites up to 500 or 1000 pages.

Use as a JSON API

If you want to get your content as JSON (or any other standard web format), the combination of ASP.Net Core andLynicon makes this very easy and flexible.

For any content-routed page, you can simply request it with Accept header set to application/json and you willget the content as JSON.

You can also query across all content items of content type T:

In the example you can now call /api/tiles with any standard OData filtering, paging or sorting parameters to receivea json array of tile content serialized to JSON.

Running the tests

The tests should appear in the Test Explorer as normal in Visual Studio. If they are notthere this is likely an issue with the XUnit test framework. Sometimes suchissues can be resolved by cleaning and rebuilding the solution,and closing and reopening Visual Studio.

Tests can also be run as normal in .net core on the command lineby going to the top-level installation directoryin a command window and runningdotnet test.

Contributing

We welcome all pull requests, comments, issues etc. You can also get in touch atinfo@lynicon.com

About

Lynicon CMS for ASP.Net Core for .Net Standard 2.0/2.1 and .Net 4.6.1/4.6

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp