- Updating Pages with Children so that their children are displayed and clickable - Adding Featured Image to Pages

Torey Heinz committed Jul 03, 2018
commit 7e7badf22aa92bc11bdd5df89b6c8f459a30a269
Showing 8 changed files with 90 additions and 17 deletions
app/views/pages/layouts/page-with-children.liquid +35 -0
@@ @@ -0,0 +1,35 @@
+ ---
+ title: Page with Children Shown
+ slug: page-with-children
+ position: 99
+ listed: false
+ published: false
+ is_layout: true
+ ---
+ {% capture 'featured_image' %}{% editable_file 'featured_image', block: 'main' %}{% endeditable_file %}{% endcapture %}
+ {% extends "layouts/application" %}
+ {% block main %}
+ <div class="row">
+ <div class="column content page">
+ <h1 class="text-center">{% editable_text "heading", line_break: false, format: 'raw', rows: 1 %}{% endeditable_text %}</h1>
+ {% if featured_image != blank %}
+ <div class="featured_image">
+ <img class="thumbnail" title="{{ page.title }}" alt="{{ page.title }}" src="{{ featured_image | resize: '400x>', optimize: 80 }}">
+ </div>
+ {% endif %}
+ {% editable_text content %}Lorem ipsum{% endeditable_text %}
+ <hr>
+ <div class="row small-up-2 medium-up-3 large-up-4" data-equalizer>
+ {% for child in page.children %}
+ <div class="column column-block">
+ <div class="card clickable" data-url="{{ child.fullpath }}">
+ <div class="title card-divider text-center" data-equalizer-watch>
+ <p><a href="{{ child.fullpath }}">{{ child.editable_elements.main.heading }}</a></p>
+ </div>
+ </div>
+ </div>
+ {% endfor %}
+ </div>
+ </div>
+ </div>
+ {% endblock %}
app/views/pages/layouts/page.liquid +23 -0
@@ @@ -0,0 +1,23 @@
+ ---
+ title: Page
+ slug: page
+ position: 99
+ listed: false
+ published: false
+ is_layout: true
+ ---
+ {% capture 'featured_image' %}{% editable_file 'featured_image', block: 'main' %}{% endeditable_file %}{% endcapture %}
+ {% extends "layouts/application" %}
+ {% block main %}
+ <div class="row">
+ <div class="column content page">
+ <h1 class="text-center">{% editable_text "heading", line_break: false, format: 'raw', rows: 1 %}{% endeditable_text %}</h1>
+ {% if featured_image != blank %}
+ <div class="featured_image">
+ <img class="thumbnail" title="{{ page.title }}" alt="{{ page.title }}" src="{{ featured_image | resize: '400x>', optimize: 80 }}">
+ </div>
+ {% endif %}
+ {% editable_text content %}Lorem ipsum{% endeditable_text %}
+ </div>
+ </div>
+ {% endblock %}
app/views/pages/materials.liquid +3 -3
@@ @@ -7,10 +7,10 @@ published: true
is_layout: false
seo_title: Materials
editable_elements:
- main/content: "<h4>Material Choices</h4><div>We can provide raw or machined ferrous
+ main/content: "<div>We can provide raw or machined ferrous
and non-ferrous castings produced in most commercially available processes.<br></div><div><br></div><div>We
also supply CNC and screw machined parts in common and exotic materials for industrial
use.</div><div><br></div><div>Streamline your Supply Chain with Choice Castings!<br></div>"
- main/heading: ''
+ main/heading: 'Choice Material Choices'
---
- {% extends "layouts/application" %}
\ No newline at end of file
+ {% extends "layouts/page-with-children" %}
app/views/pages/products.liquid +5 -5
@@ @@ -7,7 +7,7 @@ published: true
is_layout: false
seo_title: InStock Items
editable_elements:
- main/heading: ''
+ main/heading: 'Choice Items'
main/content: <p class="wysiwyg-text-align-center">We supply various engineered
metal products</p>
---
@@ @@ -15,17 +15,17 @@ editable_elements:
{% block main %}
<div class="row">
<div class="column content page">
- <h1>{% editable_text "heading", line_break: false, format: 'raw', rows: 1 %}{% endeditable_text %}</h1>
+ <h1 class="text-center">{% editable_text "heading", line_break: false, format: 'raw', rows: 1 %}{% endeditable_text %}</h1>
{% editable_text content %}Lorem ipsum{% endeditable_text %}
<div class="rowexpanded">
- <div class="row wide small-up-2 large-up-4 text-center gutter-small">
+ <div class="row wide small-up-2 large-up-4 text-center gutter-small" data-equalizer>
{% editable_model products %}
{% for product in contents.products %}
- <div class="column">
+ <div class="column column-block">
<div class="card clickable" data-url="{% path_to product %}">
<img src="{{ product.image.url | resize: '200x200#' }}">
<div class="title card-divider" data-equalizer-watch>
- <p class="lead">{{ product.title }}</p>
+ <p>{{ product.title }}</p>
</div>
</div>
</div>
app/views/pages/solutions.liquid +5 -4
@@ @@ -7,8 +7,9 @@ published: true
is_layout: false
seo_title: Solutions
editable_elements:
- main/content: We will assure that you get what you need, when you need it and how
- you need it.&nbsp; Provided by one of our quality manufacturing options!<br>
- main/heading: ''
+ main/content: <p>We will assure that you get what you need, when you need it and how
+ you need it.&nbsp; Provided by one of our quality manufacturing options!</p>
+ main/heading: 'Choice Solutions'
---
- {% extends "layouts/application" %}
\ No newline at end of file
+ {% extends "layouts/page-with-children" %}
+
app/views/pages/solutions/casting-sourcing.liquid +3 -3
@@ @@ -7,8 +7,7 @@ published: true
is_layout: false
seo_title: Casting Sourcing
editable_elements:
- main/content: <h4><img class="wysiwyg-float-right" title="produkt4_small.gif" alt="undefined"
- src="/samples/assets/produkt4_small.gif"></h4><p>Choice Castings has built a network
+ main/content: <p>Choice Castings has built a network
of high quality and competitive sources to produce and machine industrial castings.<br><br>Our
experience and know-how combined with significant buying power with our vendors
assure you of excellent value and exceptional service.<br><br>We provide support
@@ @@ -17,5 +16,6 @@ editable_elements:
being met while meeting your goals, whether it is to improve quality, shorten
lead-times or reduce pricing.<br><br>We look forward to your call or email!<br></p>
main/heading: Casting Sourcing
+ main/featured_image: /samples/assets/produkt4_small.gif
---
- {% extends "layouts/application" %}
\ No newline at end of file
+ {% extends "layouts/page" %}
app/views/pages/solutions/processing-and-performance-simulations.liquid +2 -2
@@ @@ -17,6 +17,6 @@ editable_elements:
tooling, which tends to be far more costly and time consuming.<br><br>Provide
us with samples, drawings or digital files - and we can help you design a sound
casting and engineered component.<br></p>"
- main/heading: ''
+ main/heading: 'Processing & Performance Simulations'
---
- {% extends "layouts/application" %}
\ No newline at end of file
+ {% extends "layouts/application" %}
public/stylesheets/app.scss +14 -0
@@ @@ -66,6 +66,16 @@ html {
@include breakpoint(small only) {
// font-size: 1.2rem;
}
+
+ .featured_image {
+ float: left;
+ margin: 0 rem-calc(8) rem-calc(8) 0;
+
+ img {
+ border: solid 4px #fefefe;
+ box-shadow: 0 0 0 1px rgba(10, 10, 10, 0.2);
+ }
+ }
}
.row.wide {
@@ @@ -189,6 +199,10 @@ body.index {
font-weight: bold;
font-size: rem-calc(28);
}
+
+ a {
+ color: $white;
+ }
}
}