Giter VIP home page Giter VIP logo

plugins's Introduction

👉 Visit the DatoCMS homepage or see What is DatoCMS?


DatoCMS plugins repository

This repository provides samples of DatoCMS plugins developed using the Plugins SDK.

List of examples

  • Star rating editor: A plugin that presents integer fields as star rating widgets
  • Yandex Translate: Makes it easier to automatically translate your content into secondary languages
  • Sidebar Todos: Add To-Do lists to your records sidebar
  • Tag editor: A plugin that transforms any string and JSON field into a tag editor
  • Lorem ipsum generator: Makes it easier to automatically fill your textual fields with dummy content
  • Sidebar notes: Add Post-it notes to your records sidebar
  • Conditional fields: Show/hide fields when you toggle a checkbox boolean field
  • Shopify product: Allows users to search and select Shopify products
  • Commerce Layer: Allows users to search and select Commerce Layer SKUs
  • Field Anchor: Creates a sidebar anchor menu that links to your fields
  • SEO Analysis: Runs SEO/Readability analysis using YoastSEO.js on your frontend everytime you make a change to the content of a record.
  • Rich Text TinyMCE: Custom TinyMCE configuration for multi-paragraph fields.
  • Table editor: A plugin that transforms any JSON field into a table editor
  • Web Previews: Shows links to the matching webpage previews on selected records

What is DatoCMS?

DatoCMS is the REST & GraphQL Headless CMS for the modern web.

Trusted by over 25,000 enterprise businesses, agency partners, and individuals across the world, DatoCMS users create online content at scale from a central hub and distribute it via API. We ❤️ our developers, content editors and marketers!

Quick links:

Our featured repos:

Or see all our public repos

plugins's People

Contributors

acasazza avatar anshumansworld avatar arcataroger avatar evangelinepapanicola avatar fconforti avatar isoadro avatar jbmoelker avatar kind84 avatar marcelofinamorvieira avatar matjack1 avatar matteodem avatar romainfrancony avatar ruisaraiva19 avatar sistrall avatar souljuse avatar stefanoverna avatar wbobeirne avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

plugins's Issues

React front-end table rendering

Hi there. Can you provide any example or sample source code how to properly render this JSON field on the front end into HTML table? Thanks

Usage with modular field

Hey!

I have a model (market) that I would like to display linked "kits" for.

However, the structure of the kit means the link back to market is from kit->modularField->market.

Is it possible for me to display those posts or is that kind of structure a limitation in the plugin?

Conditional Fields: non-exposure warning when used twice on a field

I have Conditional Fields on a boolean, and while the plugin works fine, there's a perpetual error:

ADD-ON MISSING!
The Conditional fields plugin is not exposing the add-on "conditionalFields" anymore. Please remove this addon or consult the plugin author to sort this out!

Since I can't hide fields by default, I need to be able to hide some fields and show others, and I think the only way I can do that is by using the plugin twice on a field (seen below) and that's triggering the error – though the plugin does what I need it to do despite it.

I think, given that the plugin still works, this use case could be accommodated? Or maybe the UI of it could be revised so that showing and hiding could be done in one operation.

conditionalFields

[Table] Cursor jumps back and forward whilst editing cell values

Hello! One of our content editors reported a bug with the table editor plugin:

Whenever we try to edit a cell's existing value, the cursor randomly goes to the end of the line:

CleanShot.2023-03-30.at.13.21.11.mp4

Please let me know if you need anymore information! 😄

[Character counter] Add plugin to field without validation

Hi @stefanoverna

Could it be possible to add the plugin to fields that do not have a length validation.

In our case we don't have length validation but display a recommended length, it would be really usefull to have the character counter to show up so the user known how close to the recommended size he is.

I will probably try to put together a pull request if I got the time.

Thanks

How to separate tags when querying

Hey, so the output from GraphQL is something like:

[
  "Print",
  "Branding",
  "Web Design",
  "Development"
]

How do I turn this into an array?

Tag Editor

Hey, so the output from GraphQL is something like:

"[\n  \"Print\",\n  \"Branding\",\n  \"Web Design\",\n  \"Development\"\n]"

How do I turn this into an array with strings? Like:

[
  'Print',
  'Branding',
  'Web Design',
  'Development',
]

Conditional fields plugin: target field(s) with localization enabled are always shown

If you have localization enabled on the target field, it will always show up. Whether or not the conditional field is checked.

You can reprodouce this by:

  1. Creating a new model
  2. Add text field with localization disabled
  3. Add boolean field with the conditional field addon
  4. Everything should now work correctly
  5. Go back to the model and enable localization on the text field
  6. Now the text field is always shown

[Table] Renaming a Column will change the order of properties in object

Hey, I'm running into a bug in production concerning the Table plugin:

Whenever I rename a column, the order of the data being returned by Dato API changes.

Example Table:

Column A Column B Column C
Value 1 Value 2 Value 3

API returns:

{
  "columns": [
    "Column A",
    "Column B",
    "Column C"
  ],
  "data": [
    {
      "Column A": "Value 1",
      "Column B": "Value 2",
      "Column C": "Value 3"
    }
  ]
}

However, if we rename Column B to Column B2 through the Table Editor, the API result will be:

{
  "columns": [
    "Column A",
    "Column B",
    "Column C"
  ],
  "data": [
    {
      "Column A": "Value 1",
      "Column C": "Value 3",
      "Column B2": "Value 2"
    }
  ]
}

[Web Previews] Do not reload the plugin on each save if only one of the front-ends are generating errors

Hi, this is an enhancement request.

I was getting an issue where the side-by-side preview would fully reload and reset to the published link (instead of draft) on every content save (see #94).

Since then I isolated the issue and realized that it was caused by a secondary front-end link that was failing.
ScreenShot 2023-08-16 at 8 51 56 PM

That front-end link refers to "localhost" so the side-by-side preview would only work properly when my dev server was running.

So the enhancement request would be to isolate the errors from each front-end link and make sure they do not impact the side-by-side preview.

As an alternative, errors could be ignored if the front-end host is "localhost".

Hope this is comprehensive, thanks.

ConditionalField plugin doesn't work with dato migration

I'm trying to run a migration with your plugin, the addon is being installed perfectly but somehow it won't implement the plugin to the specific targetFieldsApiKey.

  await client.fields.create(pageLinkBlock.id, {
    label: 'Render as button',
    apiKey: 'ti_render_as_button',
    fieldType: 'boolean',
    defaultValue: false,
    appearance: {
      editor: 'boolean',
      parameters: {},
      addons: [
        {
          id: conditionalFieldsPlugin.id,
          parameters: {
            invert: false,
            targetFieldsApiKey: ['ti_button_style'],
          },
          fieldExtension: 'conditionalFields',
        },
      ],
    },
  })

I've also tried manually adding it to dato and the addons was exactly the same as the code above.
Thanks in advanced!
ConditionalFields

[Web Previews] Side-by-side iframe reloads on every save and resets to "published" view

Hi, I'm unsure if the issue comes from an update or my setup.

I do not have a "Content Security Policy" and the site previews in the sidebar as expected.

The issue comes up when I save or publish the record. The panel reloads and resets to the default "published" view.

Note: I have tried to add a "Content Security Policy" as per the README, thinking that could be the source of the issue, but that didn't work. The iframe could not connect anymore and was giving the error Refused to frame '<URL>' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'self' https://plugins-cdn.datocms.com".

Here is a video repro:
https://github.com/datocms/plugins/assets/46095852/5256ee86-1bf9-4e65-a17f-36f3ab723e8d

Shopify plugins — can't add store keys

On a fresh install of the “Shopify product JSON” plugin, I can’t save my Shopify access keys in order to use this plugin.

The "Shopify product JSON" plugin isn't a Dato plugin. So I tried all the other Shopify plugins, and they all give the same error. This includes the official Dato Shopify plugin ("Shopify product").

image

[Shopify Product] Make JSON Available for Query

Hi! Rather than the Shopify Product only returning the name of the selected product for querying from GQL, is it possible to return all the fields requested from the Shopify API, such as the imageUrl, productType, etc...?

Based on the docs, I assumed this involves changing the overrideFieldExtensions, but I am not totally clear on how...

Plugin stopped working

Hi there,

it seems like the Plugin doesn't work anymore for us. We constantly get this error message.

Screenshot 2023-01-17 at 11 54 40

Screenshot 2023-01-17 at 11 55 56

This might or might not be related to the most recent API version deprecation of Shopify?

Not sure if we're the only ones experiencing this from today on?

Edit: the plugin in question is plugins/shopify-product/

Please help @stefanoverna
Bernd

[Table Editor] GraphQL results order

First: Nice plugin.

But when i change the table, row are sorted different.

Table in Editor

| Years | Chrome | Mozilla | Safari |

| 1995 | 100 | 150 | 200 |

Output:
{Chrome: 100, Mozilla: 150, Safari: 200, Years: 1995}

[Table Editor] Support for links

Hey there, we've been using table editor for a while and we have an occurring need from the plugin. We want to be able to add links to the table content.

There are possible solutions to this, here are some we thought of.

  1. Structured Text syntax

image

2. Html Editor syntax

image

Currently, we are overcoming this issue by using the Markdown syntax but it's very error prone and it's focused on manual parsing.

As in
[Duck Duck Go](https://duckduckgo.com)
My favorite search engine is Duck Duck Go.

Is there a plan to add link support to the table plugin? If not do you have any suggestions?
Cheers

[Table Editor] There is no way to remove a row altogether.

Hi! When we do extensive data manipulation in Dato, we need to remove a row from the table. To my knowledge, there is no row deletion feature in the plugin at the moment. Is there a plan to add this feature? It would be great if we could remove a row as well as a column.
Cheers

Working with non-boolean field types - should I create a new plugin or rather extend this one?

Hi!
First of all, thank you for this handy plugin!

The system I am currently working on has a requirement to enable showing certain fields depending on other field values (not only boolean values, as currently here). I noticed, that the current code after some tweaks would allow to achieve such behaviour.

Yet, I'm not sure if I should fork this plugin and submit a new one with very similar codebase allowing such behaviour, or is it good idea to stay with the current plugin and commit a pull request, which would extend it's possibilities.

I'd like to know - straight fro the authors - which solution would be better for further development - thank you in advance! :)

[Web Previews] Allow to configure the allow attribute of the iframe

Hi,

When using web previews we want to have a bit more control over the iframe that is used to render the preview in the sidebar. Specifically we want to allow some browser features (like clipboard-write).

The easiest solution is to add configuration to specify the allow attribute in the plugin configuration (see: https://developer.mozilla.org/en-US/docs/Web/HTTP/Permissions_Policy).

Additionally we could also work with toggles or features to enable or disable. I can make a PR for both solutions, WDYT?

Regards

SEO/Readability Analysis plugin not doing anything

The Yoast SEO section is not visible on the content editor page.

These are the steps I took:

I created an SEO-readability-metadata API endpoint in my Next.js app, which is successfully returning the data in the required fields mentioned in the documentation. The returning object includes the following:

Locale
Slug
Permalink URL
Title
Description
Content

You can check the page at https://blog.decommerce.com/api/seo-readability-metadata?itemId=63145745.
2) I added the frontend metadata endpoint, https://blog.decommerce.com/api/seo-readability-metadata, inside the "Frontend metadata endpoint URL" field to save the settings.

However, even after completing these steps, the Yoast SEO section is still not showing when I go to the content editing page.
image

Implement nested conditionals in Conditional fields

A ( conditional plugin )
-B ( conditional plugin )
--C
When you have a field (C) which is nested inside a conditional field (B), that is inside another conditional field (A) then C will sometimes show if B is on, and A is off.

Web Previews - Unable to generate more complex url structures

Hi! I've got a Model where the Records' urls are based on a "Single link" field (called category) as well as the slug field, so for example I'm trying to do:

    case 'article':
      return `/${item.attributes.category.slug}/all/${item.attributes.slug}`;

Unfortunately, item.attributes.category seems to return the category ID rather than the object, so I can't access the category's slug.

Is there a workaround for this? I can't think of a way to get the article category slug here, other than by performing a GraphQL query in my preview-links endpoint which doesn't feel optimal.

Thanks in advance!

Add reload button on WebPreviews sidebar panel

Hi,

The new sidebar panel is awesome but we would like to have a reload button on it. Not everyone manages to implement the subscribed queries (because of complexity) so it would be handy to have a button that allows a content editor to reload the preview window.

Thanks!

[Character Counter] on Metadata

Hi @stefanoverna

This is a simple but great plugin that makes lots os scenes on the DatoCMS UI.
It's possible to add the counter to the Title and Description fields on the Metadata box?
Screenshot 2022-12-07 at 16 54 01

Could be very useful

Thanks

[Disabled Field] Some fields editors are not disabled when the plugin is toggled on for a field

Hello,

The Disabled field plugin describes that it can be used with any field:

https://www.datocms.com/marketplace/plugins/i/datocms-plugin-disabled-field

However, it seems that it does not work with some more specific editors like json or boolean_radio_group.

I was wondering whether these fields not working is an oversight or a decision?

We are 'indexing' some data into Dato in order to have faster fetches and give some extra context to our editors. We'd prefer that this data would only be changed by the scripts that sync data between services and were considering the disabled field as an option for doing that.

[Shopify Product] strange API issues

Not sure what's going on but the Shopify Product plugin (v. 0.1.4)

  • reports Storefront API tokens not being for the domain when they are ('The API key seems to be invalid for the specified Shopify domain!')
  • fail to fetch product data either completely ('API call failed!' on initialization) or partially, so some products cannot be found while others are (this one is really weird)

I've tested the same queries and tokens with API clients, and the keys I'd like to use are fine (they're actually active elsewhere doing much the same thing the plugins are, with no problems). I've also double-checked the permissions those tokens have, and they're what the plugin asks for.

Things were working up to a few days ago – and the problem seems to be limited exclusively to Dato, I can't reproduce the issues anywhere else (is Shopify rate-limiting hits from the Dato domain? Do we need a specific api version called within the plugin now?).

Right now I've gotten rid of the plugins, and instead having editors input product handles by hand, which is a much less fun experience but at least I know that'll work (as long as the handle exists).

I wish I had more info for you, but there are no errors logged to console that I could send. If you need any information let me know, and if anyone else is having the same troubles.

Conditional fields - implement inverted relationships

Right now, a slave field is shown when the master boolean field is set to true, and hidden when it's false

Would be great to be able to define inverted relationships, for example: show slave field when master boolean is false (and vice versa).

Perhaps you could just supply the field api key, prefixed with a !, for example: !github, facebook, !twitter

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.