Skip to content

About

A workspace for inspecting and visualizing Umbraco document JSON.

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

UmbContentInspector

A sample project with a workspace view for inspecting and visualizing Umbraco document JSON for admin users in Umbraco 16.

Purpose

Having a demo project that shows how you can add an extra Workspace View to the content section, allows you to add a JSON (debug) information when editing Umbraco documents for admin users only.

The "Magic" happens in the workspace conditions of the manifest file where we specify we only want this workspace view to show on the Document Workspace and only show this when the current logged in user is an admin user.

const workspaceViews: Array<ManifestWorkspaceView> = [
    {
        type: 'workspaceView',
        alias: 'contentinspector.jsonView',
        name: 'Json viewer for content inspector',
        js: () => import('./jsonview.ts'),
        weight: -200,
        meta: {
            icon: 'icon-script',
            pathname: 'temp',
            label: 'JSON'
        },
        conditions: [
            {
                alias: 'Umb.Condition.WorkspaceAlias',
                match: 'Umb.Workspace.Document',
            },
            {
                alias: 'Umb.Condition.CurrentUser.IsAdmin'
            },
            
        ],
    },
];

Try yourself

Download this Repository and run ContentInspector.Site. When logged in as admin you should see a nice extra workspace view that shows the json structure of the document

Image

Admin Login

User: admin@test.com

Password: test123456

Editor Login

User: editor@test.com

Password: test123456

About

A workspace for inspecting and visualizing Umbraco document JSON.

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages