This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Single Story | |
- questions (type: Blocks) | |
-- [component]question | |
--- answers (type: Blocks) | |
---- [component]answer | |
----- name (type: text) | |
---- [component]answer | |
----- name (type: text) | |
---- [component]answer | |
----- name (type: text) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div class="uk-flex"> | |
<input class="uk-margin-right" v-model="model.color" type="color" /> | |
<input class="uk-width-1-1" v-model="model.color" /></div>`, | |
methods: { | |
initWith() { | |
return { | |
plugin: 'example_plugin', | |
color: '#f40000' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const StoryblokClient = require('storyblok-js-client') | |
const Storyblok = new StoryblokClient({ | |
oauthToken: 'YOUR_OAUTH_TOKEN' | |
}) | |
let start = async function() { | |
for (var i = 0; i < 20; i++) { | |
await Storyblok.get('spaces/YOUR_SPACE_ID/stories/YOUR_STORY_ID') | |
console.log(i) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div><div v-if="tinyLoaded"><plugin-mce :value=model.content @input=handleInput :config=config></plugin-mce></editor></div></div>`, | |
data() { | |
return { | |
config: { | |
plugins: 'fullscreen link lists code visualblocks', | |
menubar: false, | |
toolbar: 'styleselect | link | numlist bullist | removeformat code', | |
style_formats: [{ title: 'Block', items: [{ title: 'Paragraph', format: 'p' }, { title: 'Header 1', format: 'h1' }, { title: 'Header 2', format: 'h2' }, { title: 'Header 3', format: 'h3' }, { title: 'Header 4', format: 'h4' }, { title: 'Header 5', format: 'h5' }, { title: 'Header 6', format: 'h6' }, { title: 'Blockquote', format: 'blockquote' }] }, { title: 'Inline', items: [{ title: 'Bold', icon: 'bold', format: 'bold' }, { title: 'Italic', icon: 'italic', format: 'italic' }] }, { title: 'Alignment', items: [{ title: 'Text Right', icon: 'alignright', selector: 'p, div, blockquote', classes: 'text-right' } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// About | |
// This script exports all stories as XML in a specific folder | |
// ------- | |
// How to install? | |
// 1. Create a folder for the project and inside a "data" folder | |
// 2. $ npm init | |
// 3. $ npm install storyblok-js-client --save | |
// 4. Exchange SPACE_ID and YOUR_OAUTH2_TOKEN and optionally startWith to export only one specific folder | |
// 5. $ node xml-export.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Promise = require('bluebird') | |
const path = require('path') | |
exports.createPages = ({ graphql, boundActionCreators }) => { | |
const { createPage } = boundActionCreators | |
return new Promise((resolve, reject) => { | |
const storyblokEntry = path.resolve('src/templates/storyblok-entry.js') | |
graphql( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Fieldtype = { | |
mixins: [window.Storyblok.plugin], | |
template: `<div><textarea class="uk-width-1-1" v-model="model.rte_content" ref="mytextarea" id="mytextarea">Hello, World!</textarea></div>`, | |
methods: { | |
initWith() { | |
return { | |
plugin: 'atlas_rte', | |
rte_content: 'Hello world!' | |
} | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Instructions: | |
1. Install the dependencies with "npm init" and "npm install storyblok-js-client http" | |
1. Create a content type with a "message" field type | |
2. Exchange oauthToken (from the my account section of Storyblok) and spaceId | |
3. Start the server with "node index.js" and execute following curl request | |
curl -X POST \ | |
http://127.0.0.1:3020 \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Promise = require('bluebird') | |
const path = require('path') | |
exports.createPages = ({ graphql, boundActionCreators }) => { | |
const { createPage } = boundActionCreators | |
return new Promise((resolve, reject) => { | |
const storyblokEntry = path.resolve('src/templates/storyblok-entry.js') | |
graphql( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fetch('https://api.storyblok.com/v1/cdn/datasource_entries?datasource=github-repositories&token=' + window.storyblok.config.accessToken) | |
.then(response => response.json()) | |
.then(myJson => { | |
console.log(myJson) | |
}) |