Coder Social home page Coder Social logo

lombiq / orchard-json-editor Goto Github PK

View Code? Open in Web Editor NEW
4.0 9.0 2.0 1.83 MB

Orchard Core module for displaying a JSON Editor like on jsoneditoronline.org.

License: BSD 3-Clause "New" or "Revised" License

C# 84.24% HTML 15.13% SCSS 0.63%
orchard orchard-cms orchard-core orchard-module

orchard-json-editor's Introduction

Lombiq JSON Editor for Orchard Core

Lombiq.JsonEditor NuGet Lombiq.JsonEditor.Tests.UI NuGet

About

Orchard Core module for displaying a JSON Editor like on jsoneditoronline.org. Watch a demo video of it from the Orchard Community Meeting here.

Do you want to quickly try out this project and see it in action? Check it out in our Open-Source Orchard Core Extensions full Orchard Core solution and also see our other useful Orchard Core-related open-source projects!

Documentation

JSON Editor

You can use the JSON editor either as a content field by adding a Json Field to your content type, or by invoking the "JsonEditor" shape with the below tag helper:

<json-editor 
    content="@viewModel.SomeObjectOrJToken"
    options="@viewModel.JsonEditorOptions"
    name="@Html.NameFor(model => model.SomeObjectOrJToken)"></json-editor>

or

<json-editor 
    json="@viewModel.SerializedJsonString"
    options="@viewModel.JsonEditorOptions"
    name="@Html.NameFor(model => model.SerializedJsonString)"></json-editor>

The properties are:

  • Content ("content"): An object or JToken that will be serialized via Newtonsoft Json.Net.
  • SerializedJson ("json"): An already serialized string that can be used as an alternative to Content. Both shouldn't be used, but in case they are, Content takes precedence.
  • Options ("options"): A JsonEditorOptions object that contains configuration for the JSON editor. See the XML documentation of the JsonEditorOptions for more information.
  • InputName ("name"): The HTML name of the associated hidden <input> element.

All attributes are optional. If neither content nor json is set, an empty object is taken as the content.

JSON Content Editor

The module also provides an editor for content items. This can be used to directly edit a content item as JSON data. This tool can be useful to inspect how the content item is serialized in the YesSql database without directly accessing the database or exporting the content item via deployment. It can also be used to edit properties that currently don't have an editor.

When the module is enabled, a new Edit as JSON entry is added to the actions dropdown in the admin dashboard's content item listing:

actions menu

Clicking on it encodes the content item as JSON and displays it in the JSON editor:

JSON content editor

This still requires edit permission to the content item, so the security is the same as the regular content item editor. Clicking Publish deserializes the received JSON into a ContentItem and publishes it.

Dependencies

This module has the following dependencies:

Contributing and support

Bug reports, feature requests, comments, questions, code contributions and love letters are warmly welcome. You can send them to us via GitHub issues and pull requests. Please adhere to our open-source guidelines while doing so.

This project is developed by Lombiq Technologies. Commercial-grade support is available through Lombiq.

orchard-json-editor's People

Contributors

0liver avatar barthamark avatar demeszabolcs avatar dependabot[bot] avatar dministro avatar domonkosgabor avatar luko6 avatar mzole avatar piedone avatar porgabi avatar psichorex avatar sarahelsaig avatar wasnk avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

orchard-json-editor's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.