Best Headless CMS for relational content? - reactjs

TLDR: Looking for a headless CMS that does the following:
Allows you to create new relational models (Songs) for a content type in the UI for creating that content type (Post)
First class slug support by slugifying the title automatically
First class author support by attaching the author who is signed in automatically to content types
GraphQL
I've been trying to find a good headless CMS, and the options that I've looked at are lacking in one way or another. This will be for a music blog, and each post will have an array of Songs and each Song has an Artist (all of which I'd like to be relational).
I tried Strapi and Prismic and both don't seem to allow you to add a related Song to Post unless the Song was previously created. Similarly, you can't add an Artist to a Song without the Artist previously being created. This makes creating a Post a very cumbersome thing to set up all of the other content types before being able to create a Post.
Anyone know of any good options that will pop up a modal or some other good UX if you need to create relational data on the fly when creating another content type? I tried GraphCMS which got me VERY close, but doesn't seem to have first-class support for some other things I'd like (automatic slug generation and automatic Author linking to content types they created).

You are right, with Prismic you need to create the related documents (for instance your Artist) in order to be able to refer to him/her in their Songs.
I noted that as a feature request for the Product team, but the editing experience might become unclear for Editors if you start creating new documents from a document that you are editing...
Maybe you could just open another tab to create the linked Artist, then attach it to the song when you finished on that tab?
About Author: We recommend to create Authors as entities that you make a Content Relationship to in your Post document.
This is because it's hard to assign an Author to a document (is it the person who published the last version of the article, or the one who last edited the document before it was published, or the one who create the first published version of the documents (the other might just have corrected a few typos)
Also, it allows you to add more meta-data about the Author: Have an Avatar image, Role, Team, etc.
Other than that, on the Prismic side, it seems to fit your other requirements. Let us know which tool you chose eventually!

Related

Approach for building a Gallery of images (ParentalKey vs StreamField)

I'm trying to decide between using ParentalKey or StreamField, in this case, with the purpose of adding an image gallery to a page.
We don't need any other information than the image itself (given that the image will be anyway a wagtailimages.Image model's instance, so the alt text is already handled there).
Any thoughts on what is better to make it easier for the editor to work even if maintaining around 50 images per page?
And about good practices and code maintainability?
Would you prefer a third party package for the image gallery? (even if that blocks you from upgrading to wagtail 4?)
Would your opinion change if instead of a single image, we needed some more fields?
Many thanks!
For an image gallery, the first recommendation would be to use the Collections feature. You can get pretty far with the nested collection system and even add extra meta data if needed by adding a model that relates to the collection.
If that is not suitable, ParentalKey/InlinePanel would be my next pick. For simple relationships you get all the benefits of StreamField such as re-ordering, add/remove items but with solid database integrity and usage stats working out of the box.
Only go to StreamField if you need to have optional data set against each image. For example if you have an image list but images could be an Image with a RichText OR just an image.
Unfortunately, managing large sets of images is not great (outside of collections) so you may find you need to build a seperate UI for this. If that ends up being the case you will find migration of data already in model relations being easier to do or maybe not even needed with something like ModelAdmin.
Hope it goes well, be sure to write a blog post about what you end up doing.
I would use the ParentalKey with InlinePanel for that. It shows you all the images as a list in a more compact way than the StreamField. One can reorder this list.
A StreamField is more expandable in the future. You could add new blocks, like videos or quotes or whatever at any point. If you define each block as StructBlock, you will be able to add whatever you want in the future to these blocks without loosing existing data (also true for the ParentalKey model).
I would not use Collections for image slideshows as you won’t be able to sort the imagas in a collection via the CMS, right? Collections are meant to keep order in the backend, I think.

Wagtail editor deletes content

An intern created a Wagtail site at our company. I am in charge to fill a page with our Terms And Conditions. This is hard because Wagtail is deleting or skipping content. There is a pattern to this behavior. Perhaps it gets triggered by the specific structure this content has. For now, being new to Wagtail, it does not feel very trustworthy if Wagtail randomly deletes content. Up to the pattern: There are articles that have the following structure:
A5.3 It's not allowed to use our Services for:
a. bla;
b. foo;
c. foo cookie jar;
A5.4 Regarding article
The a-c parts always get deleted by Wagtail. Sometimes it holds it quite some time but if I make a few edits, those a-c parts get erased.
Has anyone a clue why Wagtail is doing this?
Kind regards and thank you for helping me out.
Bram

Creating a Android catalog

Anyone seen an android app created with App Inventor that is a catalog?
I want to create app with a static DB, when a user selects a number it will display the item name, details about the item and image of that item.
I suggest this easy way if you're a beginner at programming in general and you know a bit of HTML and Javascript.
Have your database in JSON, most database management systems will export your tables in JSON format.
And here is how to insert your javascript in App inventor
http://puravidaapps.com/javascript.php
Using a javascript library will make the process even easier.
Let me suggest to store your data in a csv file. Just add it as asset into your project and import it using the File component. Your catalog could be displayed using a listpicker component.
Start doing the tutorials to learn the basics of App Inventor. Also take a look at How to work with Lists by Saj
How to work with Lists and Lists of lists (pdf) by appinventor.org
My suggestion would be to use a list stored in an online database like firebase or a custom tinyWebDB. That way you can change the items, their prices, descriptions without having to build the app all over again. As a bonus, you could use that database to track purchases. If by static DB you mean a database on the device like tinyDB, I would still recommend using lists because they are so easy to work with.
You could have 3 paired lists. One list could be for images, one for the description, and one for the name. Then when a user picks the item number, say 3, you display item 3 of names, item 3 of descriptions, and item 3 of images.

CakePHP show and hide form fields dynamically

I have a CakePHP website used by multiple clients. Each client shall be able to see slightly different input fields in forms. This is due to client preferences.
A simplified example:
Clients should be able to look up books from a big list. While some clients prefer to look up by author, others might want to look up by publish date or title. But each client should only see one input field in his search page. I don't want to bother the client with too many choices.
While creating different themes and switching them for each client is an option, it quickly becomes a lot of work if we are talking about many views and many input fields. Same for placing lots of if/else in the view files.
The Controller logic could be shared for all clients, as an empty or not existing input field will be ignored by my controller when looking up books.
Optimal I have some kind of dynamic configuration which states for each client which input field to show or hide on which page.
Let me know any suggestions on this or what is a good CakePHP way to achieve this.
If I get this right just use an element per client:
echo $this->element('client_forms/' . $clientIdentifier);

Find where and how objects are used in Salesforce.com

I have recently taken up salesforce.com and i have very little idea about its workings and stuff. Recently i was going through some of the stuff and i had a doubt...
Is there any way through which i can find out where an particular field/ object/ visualforce page has been used in an application. For example lets say i have a field labeled Sales, i want to be able to find where that particular field is used, under which object, and the object in which visualforce page/ Apex class, and the visualforce page/ Apex class is used in which application.
Hope i have made my Q clear.
Thanking everyone for their help
It's not really a programming question, you might be better off asking about administrative stuff like that on salesforce.stackexchange.com.
If you have a test environment (sandbox) - you could always try deleting the field there ;) I'm kidding but if you'll try it the page should display you a list where the field is being used.
Similar thing could be achieved by creating a changeset, adding that field to it and then checking dependencies.
But probably the best way would require some preparations upfront. Read about Force.com IDE (or Eclipse IDE) and how to use it to download files that represent your object definitions, page layouts, classes, visualforce pages, reports... This is great as backup but also will let you search the files (Ctrl+H in Eclipse or just use whatever you want once you have the files locally). Search for API name of the field (similar to My_Custom_Field__c should be most effective.
Pretty old thread but adding another option. I have a free and open source app that scans the fields in your Org and returns the components it's used in (Workflows, Processes, Page Layouts, Apex etc).
Keep in mind that returning fields in Apex and VF is not 100% accurate, as a field with the same API name on different objects would return as being found in a class, even though it might not (as others have mentioned).
Also, it can take quite a while to run on large Orgs.
App: http://schemalister.herokuapp.com/
Source Code: https://github.com/benedwards44/schemalister

Resources