diff --git a/public/stylesheets/vendors/help.min.css b/public/stylesheets/vendors/help.min.css index be1400b..4c64dfd 100755 --- a/public/stylesheets/vendors/help.min.css +++ b/public/stylesheets/vendors/help.min.css @@ -1 +1 @@ -#prismic-help *{outline:0}#prismic-help a{color:#68D496;text-decoration:none}#prismic-help a:hover{text-decoration:underline}#prismic-help code.tag{box-sizing:border-box;display:inline-block;font-size:16px;line-height:24px;padding:0 5px;color:#57bf83;background:#fafcfc;border-radius:4px;border:1px solid #f0f4f7}#prismic-help{margin:auto;background-color:#fff}#prismic-help header{color:#fff;background-image:linear-gradient(-180deg,#4545AE 0,#673AB7 100%);padding:35px 50px 0;line-height:1.6em;margin:auto;height:900px;position:relative}#prismic-help header .hero-curve{-webkit-clip-path:polygon(100% 100%,100% 0,0 100%);-moz-clip-path:polygon(100% 100%,100% 0,0 100%);-o-clip-path:polygon(100% 100%,100% 0,0 100%);clip-path:polygon(100% 100%,100% 0,0 100%);display:block;position:absolute;bottom:0;left:0;z-index:1;width:100%;height:300px;background-color:#fff}#prismic-help header nav{display:flex;justify-content:space-between;max-width:960px;margin:auto}#prismic-help header nav a{color:#fff;text-decoration:none;font-size:16px}#prismic-help header nav a.doc{color:#d8d8ff;display:flex}#prismic-help header nav a.doc img{margin-left:10px}#prismic-help header nav a strong{font-weight:700}#prismic-help header nav a:hover{text-decoration:underline}#prismic-help header .wrapper{max-width:500px;margin:70px auto 0;text-align:center}#prismic-help header h1{font-weight:700;font-size:26px;letter-spacing:.3}#prismic-help header .wrapper p{font-size:18px;font-weight:400;text-align:center;line-height:30px;letter-spacing:.3}#prismic-help header .flip-flap{width:960px;max-width:90%;position:absolute;left:50%;transform:translateX(-50%);bottom:40px;z-index:1;perspective:960px}#prismic-help header .flip-flap .flipper{transition:.6s;transform-style:preserve-3d;position:relative;animation-name:flipFlap;animation-duration:4s;animation-delay:2s;animation-iteration-count:1;animation-timing-function:ease-in-out}@-webkit-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@-moz-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@-o-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}#prismic-help header .flip-flap .gif,#prismic-help header .flip-flap .guide{backface-visibility:hidden}#prismic-help header .flip-flap .guide{padding:60px 80px 80px;box-sizing:border-box;background-color:#fff;box-shadow:0 10px 17px 0 rgba(44,49,126,.2);transform:rotateX(0);position:relative;z-index:2;border-radius:4px}#prismic-help header .flip-flap .gif{height:480px;background-image:url(../../../images/bb.gif);background-size:102%;background-position:-3px 90%;box-shadow:0 10px 17px 0 rgba(44,49,126,.2);transform:rotateX(180deg);position:absolute;top:-35px;left:0;right:0;bottom:0}#prismic-help header .guide a{color:#516677;text-decoration:none}#prismic-help header .guide a:hover{text-decoration:underline}#prismic-help section{max-width:800px;margin:auto;padding:100px 50px 50px}#prismic-help h1{margin:10px 0;font-size:28px;font-weight:500;letter-spacing:.5;line-height:52px;text-align:center}#prismic-help h2,#prismic-help h3{letter-spacing:.25;font-size:24px;color:#324150}#prismic-help h2{margin-bottom:30px;font-weight:600}#prismic-help h3{position:relative;margin-bottom:15px;font-weight:400;padding:0 0 0 45px}#prismic-help h3 span:first-child,#prismic-help ul li span:first-child{position:absolute;background:#FFCE80;border-radius:100%;padding:0 13px;font-weight:600;font-size:14px;color:#fff;left:0;top:3px}#prismic-help ul li span:first-child{top:20px;padding:0 10px}#prismic-help .guide ul li span:first-child{top:35px}#prismic-help h4{font-size:18px;line-height:32px;font-weight:600;letter-spacing:.18;margin-bottom:15px;color:#324150}#prismic-help section p{margin-bottom:40px}#prismic-help ul{list-style:none;padding:0;margin:0}#prismic-help ul li{align-items:center;color:#516677;font-size:16px;font-weight:700;position:relative;padding:35px 0 35px 45px;border-bottom:1px solid #E0EAF1}#prismic-help ul li img{position:absolute;right:0}#prismic-help ul li.done{opacity:.4}#prismic-help ul li.done:after{content:'Done!';position:absolute;right:0;font-weight:initial}#prismic-help ul li:last-child{border-bottom:none;padding-bottom:0}#prismic-help .source-code{position:relative;width:100%;margin:40px 0}#prismic-help .source-code code{box-sizing:border-box;width:100%;padding:20px;line-height:1.8rem}.hljs{display:block;overflow-x:auto;padding:.5em;background:#F1F6F8;border-radius:10px;font-size:16px;color:#506677}.hljs-doctag,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title{color:#506677;font-weight:400}.hljs-comment{color:#9AACBB}.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-deletion,.hljs-link,.hljs-literal,.hljs-meta,.hljs-name,.hljs-quote,.hljs-regexp,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-subst,.hljs-symbol,.hljs-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#506677}.hljs-string{color:#68D496}.hljs-emphasis{font-style:italic} +#prismic-help *{outline:0}#prismic-help a{color:#68D496;text-decoration:none}#prismic-help a:hover{text-decoration:underline}#prismic-help code.tag{box-sizing:border-box;display:inline-block;font-size:16px;line-height:24px;padding:0 5px;color:#57bf83;background:#fafcfc;border-radius:4px;border:1px solid #f0f4f7}#prismic-help{margin:auto;background-color:#fff}#prismic-help header{color:#fff;background-image:linear-gradient(-180deg,#4545AE 0,#673AB7 100%);padding:35px 50px 0;line-height:1.6em;margin:auto;height:900px;position:relative}#prismic-help header .hero-curve{-webkit-clip-path:polygon(100% 100%,100% 0,0 100%);-moz-clip-path:polygon(100% 100%,100% 0,0 100%);-o-clip-path:polygon(100% 100%,100% 0,0 100%);clip-path:polygon(100% 100%,100% 0,0 100%);display:block;position:absolute;bottom:0;left:0;z-index:1;width:100%;height:300px;background-color:#fff}#prismic-help header nav{display:flex;justify-content:space-between;max-width:960px;margin:auto}#prismic-help header nav a{color:#fff;text-decoration:none;font-size:16px}#prismic-help header nav a.doc{color:#d8d8ff;display:flex}#prismic-help header nav a.doc img{margin-left:10px}#prismic-help header nav a strong{font-weight:700}#prismic-help header nav a:hover{text-decoration:underline}#prismic-help header .wrapper{max-width:500px;margin:70px auto 0;text-align:center}#prismic-help header h1{font-weight:700;font-size:26px;letter-spacing:.3}#prismic-help header .wrapper p{font-size:18px;font-weight:400;text-align:center;line-height:30px;letter-spacing:.3}#prismic-help header .flip-flap{width:960px;max-width:90%;position:absolute;left:50%;transform:translateX(-50%);bottom:40px;z-index:1;perspective:960px}#prismic-help header .flip-flap .flipper{transition:.6s;transform-style:preserve-3d;position:relative;animation-name:flipFlap;animation-duration:4s;animation-delay:2s;animation-iteration-count:1;animation-timing-function:ease-in-out}@-webkit-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@-moz-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@-o-keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}@keyframes flipFlap{0%,100%{transform:rotateX(0)}10%,90%{transform:rotateX(180deg)}}#prismic-help header .flip-flap .gif,#prismic-help header .flip-flap .guide{backface-visibility:hidden}#prismic-help header .flip-flap .guide{padding:60px 80px 80px;box-sizing:border-box;background-color:#fff;box-shadow:0 10px 17px 0 rgba(44,49,126,.2);transform:rotateX(0);position:relative;z-index:2;border-radius:4px}#prismic-help header .flip-flap .gif{height:480px;background-image:url(../../../images/bb.gif);background-size:102%;background-position:-3px 90%;box-shadow:0 10px 17px 0 rgba(44,49,126,.2);transform:rotateX(180deg);position:absolute;top:-35px;left:0;right:0;bottom:0}#prismic-help header .guide a{color:#516677;text-decoration:none}#prismic-help header .guide a:hover{text-decoration:underline}#prismic-help section{max-width:800px;margin:auto;padding:100px 50px 50px}#prismic-help h1{margin:10px 0;font-size:28px;font-weight:500;letter-spacing:.5;line-height:52px;text-align:center}#prismic-help h2,#prismic-help h3{letter-spacing:.25;font-size:24px;color:#324150}#prismic-help h2{margin-bottom:30px;font-weight:600}#prismic-help h3{position:relative;margin-bottom:15px;font-weight:400;padding:0 0 0 45px}#prismic-help h3 span:first-child,#prismic-help ul li span:first-child{position:absolute;background:#FFCE80;border-radius:100%;padding:0 13px;font-weight:600;font-size:14px;color:#fff;left:0;top:3px}#prismic-help ul li span:first-child{top:20px;padding:0 10px}#prismic-help .guide ul li span:first-child{top:35px}#prismic-help h4{font-size:18px;line-height:32px;font-weight:600;letter-spacing:.18;margin-bottom:15px;color:#324150}#prismic-help section p{margin-bottom:40px}#prismic-help ul{list-style:none;padding:0;margin:0}#prismic-help ul li{align-items:center;color:#516677;font-size:16px;font-weight:700;position:relative;padding:35px 0 35px 45px;border-bottom:1px solid #E0EAF1}#prismic-help ul li img{position:absolute;right:0}#prismic-help ul li.done{opacity:.4}#prismic-help ul li.done:after{content:'Done!';position:absolute;right:0;font-weight:initial}#prismic-help ul li:last-child{border-bottom:none;padding-bottom:0}#prismic-help .source-code{position:relative;width:100%;margin:40px 0}#prismic-help .source-code code{box-sizing:border-box;width:100%;padding:20px;font-family:"Source Code Pro",monospace,serif;font-size: 14px;line-height: 24px;}#prismic-help .note{display:block;margin:20px 0;font-weight:700}#prismic-help .tag strong{font-weight:700;color:inherit}#prismic-help code strong{font-weight:700;color:#000}.hljs{display:block;overflow-x:auto;padding:.5em;background:#F1F6F8;border-radius:10px;font-size:16px;color:#506677}.hljs-doctag,.hljs-keyword,.hljs-name,.hljs-section,.hljs-selector-tag,.hljs-strong,.hljs-title{color:#506677;font-weight:400}.hljs-comment{color:#9AACBB}.hljs-addition,.hljs-attribute,.hljs-built_in,.hljs-bullet,.hljs-deletion,.hljs-link,.hljs-literal,.hljs-meta,.hljs-name,.hljs-quote,.hljs-regexp,.hljs-section,.hljs-selector-class,.hljs-selector-id,.hljs-subst,.hljs-symbol,.hljs-tag,.hljs-template-variable,.hljs-title,.hljs-type,.hljs-variable{color:#506677}.hljs-string{color:#68D496}.hljs-emphasis{font-style:italic} \ No newline at end of file diff --git a/resources/views/help.blade.php b/resources/views/help.blade.php index 8dd8414..fe8a9fe 100644 --- a/resources/views/help.blade.php +++ b/resources/views/help.blade.php @@ -5,6 +5,7 @@ + @@ -15,15 +16,15 @@

High five, you deserve it!

-

Grab a well deserved cup of coffee, you're two steps away from creating a page with dynamic content.

+

Grab a well deserved cup of coffee, you're steps away from creating a page with dynamic content.

@@ -53,52 +54,59 @@

1Bootstrap your project

If you haven't yet, create a prismic.io content repository. A repository is where your website’s content will live. Simply create one by choosing a repository name and a plan. We’ve got a variety of plans including our favorite, Free!

Add the repository URL to your configuration

-

Replace the repository url in your config file with your-repo-name.prismic.io

+

Replace the repository url in your prismic config file with your-repo-name.prismic.io.

-

-// In config/prismic.php
-"url" => "https://your-repo-name.prismic.io/api",
-                    
+
// In config/prismic.php
+"url" => "https://your-repo-name.prismic.io/api",
@endif

2Create a route and retrieve content

-

To add a page to your project, you need to first specify a route. The route contains the URL and performs queries for the needed content.
In the following example we set a "/page/{uid}" URL to fetch content of custom type "page" by its UID. The route then calls the "page" template and passes it the retrieved content.

+

+ To add a page to your project, you need to first specify a route. The route contains the URL and performs queries for the needed content. +
+ Note that you will need to include a UID field in your Custom Type in order for this to work. + In the following example we set a /page/:uid URL to fetch content of your custom type by its UID. The route then calls the page template and passes it the retrieved content. Make sure to replace <your-custom-type-id> below with the API ID of your Custom Type. + +

-

-// Add a new route in routes/web.php
+                
// Add a new route in routes/web.php
 Route::get('/page/{uid}', function ($uid, Request $request) {
     
-        // Query the page by the uid by using the getByUID function
-        $pageContent = $request['api']->getByUID('page', $uid);
-        // $pageContent is a document, or null if there is no match
+    // Query the page by the uid by using the getByUID function
+    $document = $request['api']->getByUID('<your-custom-type-id>', $uid);
+    // $document is the returned document object, or null if there is no match
 
-        // Render the page. 'page' is the name of your blade template view (resources/views/page.blade.php)
-        return view('page', [ 'pageContent' => $pageContent ]);
-});
-                
+ // Render the page. 'page' is the name of your blade template view (resources/views/page.blade.php) + return view('page', [ 'document' => $document ]); +});
+

To discover all the functions you can use to query your documents go to the prismic documentation.

+

3Fill a template

-

Now all that's left to be done is insert your content into the template.
You can get the content using the pageContent object we defined above. Each content field is accessed using the custom type API-ID and the field key defined in the custom type (for example 'page.image').

+

+ Now all that's left to be done is to insert your content into the template. +
+ You can get the content using the document variable we defined above. Each content field is accessed using the custom type API-ID and the content field API ID defined in the custom type. For example if you had a custom type with the API ID of page which has an image field with the API ID main_image, then you would use page.main_image. +

-

-{{-- Create template resources/views/page.blade.php --}}
+                
{{-- Create template resources/views/page.blade.php --}}
 @extends('layout')
 
 {{-- Create a content section --}}
 @section('content')
-        <div>
-                {{-- This is how to get an image into your template --}}
-                <img src="{{ $pageContent->getImage('{{'page.image'}}')->getUrl() }}" />
-                
-                {{-- This is how to get structured text fields into your template --}}
-                {!! $pageContent->getStructuredText('{{'page.title'}}')->asHtml($linkResolver) !!}
-                {!! $pageContent->getStructuredText('{{'page.description'}}')->asHtml($linkResolver) !!}
-        </div>
-@stop
-                
+ <div> + {{-- This is how to get an image into your template --}} + <img src="{{ $document->getImage('custom_type_id.image_field_id')->getUrl() }}" /> + + {{-- This is how to get structured text fields into your template --}} + {!! $document->getStructuredText('custom_type_id.title_field_id')->asHtml($linkResolver) !!} + {!! $document->getStructuredText('custom_type_id.description_field_id')->asHtml($linkResolver) !!} + </div> +@stop
+

To discover how to get all the different content fields, go to the prismic documentation.

\ No newline at end of file