forked from projects/fipamo
added styled page layout selector, page renders selected layout
This commit is contained in:
parent
a8355b2da4
commit
49e53a9638
8 changed files with 53 additions and 33 deletions
|
@ -173,7 +173,7 @@ class Render
|
||||||
"menu" => $this->menu,
|
"menu" => $this->menu,
|
||||||
];
|
];
|
||||||
} else {
|
} else {
|
||||||
$template = $this->theme . "/page.twig";
|
$template = $this->theme . "/" . $page["layout"] . ".twig";
|
||||||
$location =
|
$location =
|
||||||
"../public/" . $page["path"] . "/" . $page["slug"] . ".html";
|
"../public/" . $page["path"] . "/" . $page["slug"] . ".html";
|
||||||
$dir = "../public/" . $page["path"];
|
$dir = "../public/" . $page["path"];
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block stylesheets %}
|
{% block stylesheets %}
|
||||||
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=adfdf">
|
<link rel="stylesheet" type="text/css" href="/assets/css/dash.css?=dfdfd">
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block mainContent %}
|
{% block mainContent %}
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<div id="post-options">
|
<div id="post-options">
|
||||||
<button id="option-menu-pin" class="option-inactive post-option-btn" data-active="{{ menu }}" title='Pin to Menu'>
|
<button id="option-menu-pin" class="option-inactive post-option-btn" data-active="{{ menu }}" title='Pin to Menu'>
|
||||||
<svg id="option-page-icon" viewbox="0 0 20 20" class="icons">
|
<svg id="option-page-icon" viewbox="0 0 20 20" class="icons">
|
||||||
<use id="option-page-icon" xlink:href="/assets/images/global/sprite.svg#entypo-add-to-list"/>
|
<use id="option-page-icon" xlink:href="/assets/images/global/sprite.svg#entypo-add-to-list"/>
|
||||||
</svg>
|
</svg>
|
||||||
|
@ -32,8 +32,9 @@
|
||||||
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-eye"/>
|
<use id="option-published-icon" xlink:href="/assets/images/global/sprite.svg#entypo-eye"/>
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
<label>View Template</label>
|
<div id="layouts">
|
||||||
<select>
|
<label>Page Layouts</label>
|
||||||
|
<select id="page-templates">
|
||||||
{% for view in views %}
|
{% for view in views %}
|
||||||
{% if view == page['layout'] %}
|
{% if view == page['layout'] %}
|
||||||
<option value={{ view }} selected>{{ view }}</option>
|
<option value={{ view }} selected>{{ view }}</option>
|
||||||
|
@ -43,4 +44,6 @@
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</select>
|
</select>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
|
@ -12,6 +12,7 @@
|
||||||
</section>
|
</section>
|
||||||
<article>
|
<article>
|
||||||
<div class="page">
|
<div class="page">
|
||||||
|
THIS IS A CUSTOM TEMPLATE <br />
|
||||||
<p>{{content | raw}}</p>
|
<p>{{content | raw}}</p>
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
8
public/assets/scripts/dash.min.js
vendored
8
public/assets/scripts/dash.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -56,6 +56,7 @@ export default class PostActions {
|
||||||
"published",
|
"published",
|
||||||
document.getElementById("option-published").getAttribute("data-active")
|
document.getElementById("option-published").getAttribute("data-active")
|
||||||
);
|
);
|
||||||
|
pageInfo.append("layout", document.getElementById('page-templates').value);
|
||||||
pageInfo.append(
|
pageInfo.append(
|
||||||
"form_token",
|
"form_token",
|
||||||
document.getElementById("form_token").value
|
document.getElementById("form_token").value
|
||||||
|
|
|
@ -237,6 +237,21 @@
|
||||||
svg
|
svg
|
||||||
fill: $primary
|
fill: $primary
|
||||||
|
|
||||||
|
#layouts
|
||||||
|
padding: 7px 0 0 0
|
||||||
|
label
|
||||||
|
color: $primary
|
||||||
|
font-size: 1em
|
||||||
|
select
|
||||||
|
background: $primary
|
||||||
|
color: $secondary
|
||||||
|
border-radius: 3px
|
||||||
|
border-color: $primary
|
||||||
|
margin: 5px 0 0 0
|
||||||
|
width: 100%
|
||||||
|
padding: 5px
|
||||||
|
font-size: 1em
|
||||||
|
|
||||||
#featured-image-upload, #post-image-upload
|
#featured-image-upload, #post-image-upload
|
||||||
display: none
|
display: none
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue