Skip to content

Instantly share code, notes, and snippets.

@Duaner
Duaner / new-slice.md
Last active April 18, 2017 14:52
Include New slices in your nodejs project

#Define


"new-slice" : {
    "type" : "Slice",
    //No repeatable zone
    "non-repeat" : {
      "titre" : {
        "type" : "StructuredText"
      }
 },
@Duaner
Duaner / Import with i18n
Created April 28, 2017 10:20
Import i18n
The export with i18n introduce a new element : The group Lang
The group lang is an id of a translation of a document for exemple a document in english and its translations have the same groupLang ID.
Create a new document for a group lang :
If you want to create a new document for an existing groupLang. For exemple, I've created a document in english wich is my master lang and i want to import a new translation in french
You just have to add in your import zip a document with the filename new_$GrouplangId_$Lang (for exemple new_WKq0ph4AACEA4M9B_fr-fr.json)
Create a new groupLang with all its translation
You can also import a new group of translation by importing multiple document with an arbitrary goupLang setted.
For exemple if i want to import a new english document and its translation i will name my documents.
{
"Main": {
"uid": {
"type": "UID",
"config": {
"label": "uid"
}
},
"title": {
"type": "StructuredText",
{
"Headings" : {
"title" : {
"type" : "StructuredText",
"fieldset" : "Main title",
"config" : {
"single" : "heading1",
"placeholder" : "As displayed when with the content"
}
},
{
"Main" : {
"full_name" : {
"type" : "StructuredText",
"fieldset" : "Full name",
"config" : {
"single" : "heading1"
}
},
"first_name" : {
{
"Blog Post" : {
"body" : {
"type" : "StructuredText",
"config" : {
"placeholder" : "Start writing your blog post here...",
"minHeight" : "400px",
"imageConstraint" : {
"width" : 640.0
}
{
"Main" : {
"title" : {
"fieldset" : "Title",
"type" : "StructuredText",
"config" : {
"single" : "heading1,em,strong"
}
},
"content" : {
@Duaner
Duaner / Laterooms Integration field gist
Last active November 23, 2017 12:52
Laterooms Integration field gist
{
"results_size": 10,
"results": [
{
"id": "the_principal_manchester",
"title": "The Principal Manchester",
"description": "Oxford Street, Manchester, M60 7HA",
"image_url" : "https://static.laterooms.com/hotelphotos/laterooms/66065/gallery/the-principal-manchester-manchester_081220161053048074.jpg",
"last_update": 1509364426938,
"blob": {
@Duaner
Duaner / made_gist.json
Last active January 22, 2018 17:33
Made Integration field Gist
{
"results": [ {
"blob": {
"description": "Today's price:£179",
"image_url": "https://res-4.cloudinary.com/made-com/image/upload/b_transparent,c_pad,d_made.svg,dpr_1.0,f_auto,h_161,q_auto:best,w_217/v4/catalog/product/catalog/a/c/3/1/ac3157841845462bab9f56333dab9dbb477e69cc_BENJNS042BLU_UK_Jenson_Bench_oak_and_mineral_blue_PL.jpg",
"sku": 0,
"title": "Jenson Bench, Oak and Mineral Blue"
},
"description": "Today's price:£179",
"id": "0",
{
"results_size": 3,
"results": [
{
"id": "category-1",
"title": "My category 1",
"description": "Description for My category",
"image_url": "https://prismic-io.s3.amazonaws.com/disrupt-coffee-images%2F42836fc6-77dc-48d5-9931-4c163662a904_brasil-product.png",
"last_update": 1509364426938,
"blob": {