texnixe
February 13, 2016, 10:05pm
2
Let me answer the difference between templates and blueprints by quoting myself:
Well, the most obvious distinction between blueprints and templates is:
blueprints are only needed if you use the panel, they determine what sort of content a user can add via the panel, they have a yaml-structure and can be regarded as a sort of template for the panel view. Or as is says in the docs:
Blueprints are the counterpart of each of your templates. They create individual forms in the panel which make it easy to insert the required data. Blueprints offer a wide set of options to customize those forms and even provide help to panel users while they enter data.
templates determine what sort of content is displayed on a page and how the content in the text files is displayed. They are created by using a mixture of PHP and HTML.
Both template and blueprint have the same name as the corresponding text file.
When you add a new page in the panel, choosing a blueprint is the same as choosing a template, cause the file gets a name that determines the template that is used to parse the contents.
In some cases, however, you may have a blueprint for page but not a template, i.e.if you do a one pager.
You can restrict the templates that can be used for a page/subpage in the blueprint: http://getkirby.com/docs/panel/blueprints/page-settings#templates-for-subpages . On the site level, you would do that via a site.php blueprint.
So if you want to change the way your content is displayed on the website, you need to modify your template.
To put the text before the slider, you need to put this part:
<div class="container">
<?php echo kirbytext($page->text()) ?>
</div>
before this bit:
<div id="slideshow">
<?php foreach($page->images()->sortBy('sort', 'desc')->flip() as $img): ?>
<div class="item"><img src="<?php echo $img->url() ?>" alt="<?php echo $img->title() ?>" title="<?php echo $img->title() ?>" data-description="<?php echo $img->description() ?>"></div>
<?php endforeach ?>
</div>
BTW: to make your code more readable, could you pls. enclose it within three backticks at the beginning and the end of the code block in a separate line. I have edited your code above. To see how this works, you can click on the pencil icon to get into editing mode.