Cue-Front-Developer-Guide-1.6.Pdf
Total Page:16
File Type:pdf, Size:1020Kb
CUE Front Developer Guide 1.6.1-2 Table of Contents 1 Introduction.......................................................................................................................................... 6 1.1 CUE Front for Designers........................................................................................................7 1.1.1 What is Patternlab?...................................................................................................8 1.1.2 What is Twig?............................................................................................................8 1.2 CUE Front for Developers......................................................................................................8 1.2.1 What is a Recipe?...................................................................................................10 1.2.2 What is GraphQL?.................................................................................................. 10 1.2.3 What Does the Cleaver Do?................................................................................... 11 1.3 The CUE Front Start Pack................................................................................................... 12 2 Getting Started...................................................................................................................................13 2.1 Quick Start for Test/Development........................................................................................ 13 2.1.1 Installing Docker......................................................................................................14 2.1.2 Getting a Publication Pack......................................................................................16 2.1.3 Getting the CUE Front start pack............................................................................17 2.1.4 Installing the CUE Front Components.....................................................................17 2.1.5 Starting CUE Front..................................................................................................20 2.1.6 Scaling CUE Front with Docker.............................................................................. 22 2.1.7 Managing the CUE Front Containers......................................................................22 2.2 Quick Start for Designers.....................................................................................................24 2.2.1 Installing for Designers............................................................................................24 2.2.2 Starting the CUE Front Design Tools..................................................................... 25 3 Upgrading...........................................................................................................................................26 3.1 Upgrade Procedure.............................................................................................................. 26 3.1.1 Upgrading Cook, Cleaver and Fridge..................................................................... 27 4 Using CUE Front............................................................................................................................... 28 4.1 Updating a GraphQL Schema..............................................................................................28 4.2 Working with GraphQL......................................................................................................... 29 4.2.1 The GraphiQL Editor............................................................................................... 30 4.2.2 Understanding CUE Front GraphQL Queries..........................................................33 4.2.3 Naming GraphQL Queries.......................................................................................35 4.3 Working With Twig and Patternlab.......................................................................................36 4.3.1 Patternlab Conventions........................................................................................... 37 4.4 Managing Multiple Publications............................................................................................ 39 4.4.1 Shared Templates and Styles.................................................................................39 4.4.2 Separate Templates and Styles.............................................................................. 41 4.5 Extending CUE Front........................................................................................................... 42 4.6 CUE Front Development Environment................................................................................. 43 5 Using the Fridge................................................................................................................................ 44 5.1 Fridge as Cook Proxy.......................................................................................................... 44 5.1.1 Configuring the Fridge as a Cook Proxy.................................................................45 5.2 Fridge as Content Store Proxy.............................................................................................46 5.2.1 Configuring the Fridge as a Content Store Proxy................................................... 46 5.2.2 Using the Fridge as a Cache.................................................................................. 47 6 Using Data Sources...........................................................................................................................49 6.1 Configuration.........................................................................................................................50 6.2 Creating a Data Source........................................................................................................50 6.2.1 Data Source Context...............................................................................................53 6.2.2 Using Filter Aliases................................................................................................. 53 6.3 Using a Data Source............................................................................................................54 6.3.1 The extendedDatasource Function......................................................................... 55 6.3.2 Datasource Function Parameters............................................................................55 6.3.3 Changing The Data Source Context....................................................................... 57 6.4 Data Source Reference........................................................................................................57 6.4.1 Query....................................................................................................................... 58 6.4.2 And.......................................................................................................................... 58 6.4.3 Or.............................................................................................................................59 6.4.4 Not........................................................................................................................... 59 6.4.5 Publication............................................................................................................... 59 6.4.6 Section.....................................................................................................................59 6.4.7 Author...................................................................................................................... 60 6.4.8 Type.........................................................................................................................61 6.4.9 Tag...........................................................................................................................61 6.4.10 Shared Tags..........................................................................................................62 6.4.11 Field....................................................................................................................... 62 6.4.12 Related.................................................................................................................. 62 6.4.13 WithRelationToMe................................................................................................. 64 6.4.14 WithRelationTo...................................................................................................... 65 7 Working with the Recipe................................................................................................................... 66 7.1 Configuring Recipe Extensions............................................................................................ 66 7.1.1 Configuring Image Content Types.......................................................................... 67 7.1.2 Configuring Story Element Types........................................................................... 67 7.2 Making a Recipe Extension..................................................................................................68 7.2.1 The Recipe Object.................................................................................................. 70 7.2.2 The Context Object................................................................................................. 70 7.2.3 Extension Configuration.........................................................................................