{"id":13430060,"url":"https://github.com/jamesej/lyniconanc","last_synced_at":"2025-04-23T14:15:33.588Z","repository":{"id":25258050,"uuid":"80025910","full_name":"jamesej/lyniconanc","owner":"jamesej","description":"Lynicon CMS for ASP.Net Core for .Net Standard 2.0/2.1 and .Net 4.6.1/4.6","archived":false,"fork":false,"pushed_at":"2022-12-08T05:22:30.000Z","size":11239,"stargazers_count":191,"open_issues_count":4,"forks_count":28,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-23T14:15:23.645Z","etag":null,"topics":["asp-net-core","c-sharp-library","cms","cms-framework"],"latest_commit_sha":null,"homepage":"http://www.lynicon.com","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jamesej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-25T15:13:30.000Z","updated_at":"2024-12-18T09:53:22.000Z","dependencies_parsed_at":"2022-08-19T15:20:43.500Z","dependency_job_id":null,"html_url":"https://github.com/jamesej/lyniconanc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesej%2Flyniconanc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesej%2Flyniconanc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesej%2Flyniconanc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamesej%2Flyniconanc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamesej","download_url":"https://codeload.github.com/jamesej/lyniconanc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250447979,"owners_count":21432165,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asp-net-core","c-sharp-library","cms","cms-framework"],"created_at":"2024-07-31T02:00:49.662Z","updated_at":"2025-04-23T14:15:33.568Z","avatar_url":"https://github.com/jamesej.png","language":"C#","funding_links":[],"categories":["Frameworks, Libraries and Tools","others","C# #","框架, 库和工具","Awesome ASP.NET Core / Dotnet Core OpenSource CMS platforms","CMS"],"sub_categories":["CMS","内容管理系统CMS"],"readme":"# Lynicon CMS/DMS\n[![nuget](https://img.shields.io/nuget/v/LyniconANC.svg)](https://www.nuget.org/packages/LyniconANC/)\n\n*For ASP.Net Core 2.0/2.1 (.Net Standard 2.0, .Net 4.6.1 and .Net Standard 1.6, .Net 4.6)*\n\n![Lynicon CMS](https://www.lynicon.com/images/lynicon/twitter-logo.png)\n\nNow we believe the most powerful CMS on .Net Core.\n\n*It can be this easy to add content management to your site*\n\n\u003cpre style=\"width:49%; float:left; margin-right:2%;\"\u003e\nroutes.MapRoute(\"articles\", \"article/index\", new { controller = \"Pages\", action = \"Index\" });\n\npublic IActionResult Index()\n{\n  var data = new ModelType();\n  return View(data);\n}\n\u003c/pre\u003e\n\n\u003cpre style=\"width:49%;\"\u003e\nroutes.\u003ci\u003eMapDataRoute\u0026lt;ModelType\u0026gt;\u003c/i\u003e(\"articles\", \"article/\u003ci\u003e{_0}\u003c/i\u003e\", new { controller = \"Pages\", action = \"Index\" });\n\npublic IActionResult Index(\u003ci\u003eModelType data\u003c/i\u003e)\n{\n  return View(data);\n}\n\n\u003c/pre\u003e\n\n## Introduction\n\nIn tune with the .Net Core philosophy, Lynicon is a composable and\nunopinionated CMS which is lightweight and low impact yet full featured. It supports\nfully structured content (i.e. JSON structures) defined as C# classes which can have properties which are subtypes\nor 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 for\ncontent, content relationship is defined by foreign key fields as in a relational database,\nwith built-in facilities for traversing these relationships in both directions. Content\nnavigation is done via a powerful filtering/search system, or via the site itself.\n\nContent storage is highly flexible, it can be run without a database, with a SQL or other database,\nor customised to use almost any data source.\n\nDelivered as a Nuget package or library, it will not get in the way of you using any other technology, or\nforce you to use its features, and can even be added into existing projects. It is\nhighly extensible with a powerful module system allowing you to remove unneeded features\nto decrease complexity and increase efficiency.\n\nThe content editor is shown alongside the page being edited so the effects of content\nchanges are immediately visible. The rest of the backend is very straightforward as it\ndoes not attempt to provide the generally unneeded facilities to change content structure\nor front-end layout, this is done in code.\n\nThis CMS project provides the essential CMS functionality for Lynicon in\nASP.Net Core, perfectly adequate for a smaller site or application. \nThere is an MVC 5 version [here](https://github.com/jamesej/lynicon). \nThe project site is [here](http://www.lynicon.com), and this project builds a\nNuGet package whose page on Nuget is [here](https://www.nuget.org/packages/LyniconANC).\nDocumentation on Confluence is [here](https://lynicon.atlassian.net/wiki/display/DOC/ASP.Net+Core+Version).  We welcome feedback to info@lynicon.com.\n\nWe have now released a module package supplying the major features needed\nfor a larger-scale CMS including caching, search, publishing,\nurl management etc.\nThis is available [here](http://www.lynicon.com/lynicon-base)\n(closed source/paid for)\n\n## Table of Contents\n\n- [Lynicon CMS/DMS](#lynicon-cmsdms)\n  - [Introduction](#introduction)\n  - [Table of Contents](#table-of-contents)\n  - [Setup](#setup)\n  - [How Tos](#how-tos)\n    - [Log in as admin](#log-in-as-admin)\n    - [Create a content-managed route, controller \u0026 view](#create-a-content-managed-route-controller--view)\n    - [Add and edit content items](#add-and-edit-content-items)\n    - [Use HTML snippets, images, links etc in your content class](#use-html-snippets-images-links-etc-in-your-content-class)\n    - [Use lists and subtypes in your content class](#use-lists-and-subtypes-in-your-content-class)\n    - [Link to other content items in your content class](#link-to-other-content-items-in-your-content-class)\n    - [Filter, search and report on content](#filter-search-and-report-on-content)\n    - [Use the content API to create a list of items dynamically](#use-the-content-api-to-create-a-list-of-items-dynamically)\n    - [Use property source redirection to create site-wide fields with values constant across the site](#use-property-source-redirection-to-create-site-wide-fields-with-values-constant-across-the-site)\n    - [Administer site users](#administer-site-users)\n    - [Run without a database](#run-without-a-database)\n    - [Use as a JSON API](#use-as-a-json-api)\n  - [Running the tests](#running-the-tests)\n  - [Contributing](#contributing)\n\n## Setup\n\nBecause .net core 2.0 has breaking changes, the repository contains two branches, `Core1.1` for .net core 1.1, and `master` is now .net 2.0. Make\nsure you check out the right branch.\n\nOnce you have cloned the repository, you will need to get the test site working on your machine.\nSet the connection string in appsettings.json\n![Appsettings](https://www.lynicon.com/install/ANC17_ConnectionString.jpg)\n\nYou can now set up the database by running the test site from the command line (a handy feature of\nan ASP.Net Core site!). Open a command window as Administrator and go to the \\src\\LyniconANC.Release\ndirectory. Now run `dotnet run -- --lynicon initialize-database`.\n\nThen you can set up the CMS admin user. Run `dotnet run -- --lynicon initialize-admin --password p4ssw0rd`.\n![Initialize](https://www.lynicon.com/install/ANC2_InitializeProject.jpg)\n\nYou can now run the site and login with the password you set up (the email is admin@lynicon-user.com)\n\nIf you would like to populate your database with sample content, there is a script at `\\src\\LyniconANC.Release\\Areas\\Lynicon\\Admin\\SQL\\TilesSiteContentSetup.sql`\nwhich will create example content for the test site.\n\n## How Tos\n\n### Log in as admin\n\nLynicon configures it's own customised ASP.Net Identity implementation. This means you can log\nin via the (slightly modified) template code login page, using the admin email (admin@lynicon-user)\nand the password you configured above. Alternatively you can use Lynicon's built in\nlogin page at `/Lynicon/Login`\n\n### Create a content-managed route, controller \u0026 view\n\nIn Lynicon, you define a route as supporting content management, which then\npasses an instance of a content class into the controller, which\npasses it on to the view to display. This is described further\nin the [online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/42598494/Content+Routing).\n\nFor examples, look in the [Startup.cs file](src/LyniconANC.Release/Startup.cs),\n[TileContent.cs file](src/LyniconANC.Release/Models/TileContent.cs) and\n[TileController.cs](src/LyniconANC.Release/Controllers/TileController.cs).\n\n### Add and edit content items\n\nContent items are listed and can be added at /lynicon/items.\nContent items can be edited by visiting a url with which the content item\nis associated while logged in with the appropriate rights. The content editor\npanel is shown.\nThis is described in detail in the [online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/42795022/User+Manual)\n\n### Use HTML snippets, images, links etc in your content class\n\nSince Lynicon uses C# classes to define the content schema, it provides standard classes\nsuch as HtmlMin, Image, Link for storing data required in content management. This is described\nin the [online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/42926142/Predefined+content+subtypes).\nThe built-in asset handling system allows upload of images or other assets through a\nWindows Explorer-style popup to a specified folder in the site.\n\n### Use lists and subtypes in your content class\n\nContent classes in Lynicon can have properties of an arbitrary subtype, or List\u003cT\u003e properties\nof arbitrary type T. The content editor manages this automatically. You can create custom editors\nfor subtypes using the MVC templating system, by adding to the templates named after various\ncontent subtypes which already exist in `Areas/Lynicon/Views/Shared/EditorTemplates`.\nThis is described in detail in the [online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/42795058/Customising+Editors)\n\n### Link to other content items in your content class\n\nAnother standard property class in Lynicon is Reference\u003cT\u003e. This stores the id of another content\nitem in your content class. It appears in the editor as a drop-down list of content items of\ntype T. In code you can retrieve the referenced content item (actually, it's summary, see below)\nas a property on Reference\u003cT\u003e or you can get all content items with a reference to another item.\nExamples can be seen in [Tile.cshtml](src/LyniconANC.Release/Views/Tile/Tile.cshtml)\nand [TileMaterialContent.cs](src/LyniconANC.Release/Models/TileMaterialContent.cs).\nSee the [online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/42598512/Relations) for more depth.\n\n### Filter, search and report on content\n\nLynicon contains a page with various filters for creating, viewing, locating and reporting\non content. This is at `/lynicon/items/list` or reached by clicking the Filter button\non the bottom control bar on CMS pages. You can build custom filters which can be added to\nthe list available on this page. See the [online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/43057157/The+Filter+Page)\n\n### Use the content API to create a list of items dynamically\n\nLynicon has a clean and powerful content API you can use in code to retrieve content directly. You can\nsee an example in [HomeContent.cs](src/LyniconANC.Release/Models/HomeContent.cs). Generally when working with\ncontent objects external to building the page that displays them, you use a [Summary Type](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/42664002/Summaries)\nwhich contains the subset of the full content object's properties for efficiency. The content API uses\nlinq for filtering, can run queries across multiple data sources and lets you retrieve all content whose content\ntype implements an interface or inherits from a base type.\n\n### Use property source redirection to create site-wide fields with values constant across the site\n\nLynicon has a powerful means of combining content from different sources in order to build a content item. One\nuse of this is to have a content item storing site-wide values, and have its fields be mapped into every\ncontent 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 the\nsite and using this property source redirection method to map fields on the base type to a single shared content\nitem.  You can see how the base type is set up at [TilesPageBase.cs](src/LyniconANC.Release/Models/TilesPageBase.cs).\nThe shared fields are held in [CommonContent.cs](src/LyniconANC.Release/Models/CommonContent.cs).\n\n### Administer site users\n\nLynicon has an admin page at `/lynicon/users` which allows you to administer site users if you have admin\nprivileges.  See [the online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/42827792/The+Users+Page)\nfor more on this.\n\n### Run without a database\n\nThe (closed-source but free) Lynicon.Extra package on [Nuget](https://www.nuget.org/packages/LyniconANC.Extra/) provides\nthe Storeless module which converts Lynicon to run with CMS data in memory, with backup persistence to a JSON file.\nSee [the online manual](https://lynicon.atlassian.net/wiki/spaces/LAC/pages/73957380/Storeless) for how to set this\nup - it's very simple and reduces hosting costs while making Lynicon run super fast for websites up to 500 or 1000 pages.\n\n### Use as a JSON API\n\nIf you want to get your content as JSON (or any other standard web format), the combination of ASP.Net Core and\nLynicon makes this very easy and flexible.\n\nFor any content-routed page, you can simply request it with Accept header set to application/json and you will\nget the content as JSON.\n\nYou can also query across all content items of content type T:\n\n* Add a data route typed as `List\u003cT\u003e` [(see the Startup.cs file in the test project)](src/LyniconANC.Release/startup.cs)\n* In the controller/action this points to, ensure there's an action parameter `List\u003cT\u003e data`. [(see ApiController)](src/LyniconANC.Release/Controllers/ApiController.cs)\n* In the action method return `Ok(data)` (or the result of any code which processes the data)\n\nIn the example you can now call /api/tiles with any standard OData filtering, paging or sorting parameters to receive\na json array of tile content serialized to JSON.\n\n## Running the tests\n\nThe tests should appear in the Test Explorer as normal in Visual Studio. If they are not\nthere this is likely an issue with the XUnit test framework. Sometimes such\nissues can be resolved by cleaning and rebuilding the solution,\nand closing and reopening Visual Studio.\n\nTests can also be run as normal in .net core on the command line\nby going to the top-level installation directory\nin a command window and running `dotnet test`.\n\n## Contributing\n\nWe welcome all pull requests, comments, issues etc. You can also get in touch at [info@lynicon.com](mailto:info@lynicon.com)\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesej%2Flyniconanc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamesej%2Flyniconanc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamesej%2Flyniconanc/lists"}