Skip to content

Commit

Permalink
Merge branch 'release/v6.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
artistro08 committed Feb 15, 2023
2 parents 5884975 + 20cc8ec commit f07d797
Show file tree
Hide file tree
Showing 29 changed files with 725 additions and 17 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ Once you've seeded the theme, head over to the content settings in the backend a

## Documentation
Documentation can be found [here](https://artistro08.gitbook.io/tailor-starter-documentation/)
> #### NOTE:
> Docs are a work in progress

#### Contributing

Expand Down
3 changes: 3 additions & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
* [Events Column](pages/blocks/section/events-column.md)
* [Products Column](pages/blocks/section/products-column.md)
* [Form Column](pages/blocks/section/form-column.md)
* [Search Column](pages/blocks/section/search-column.md)
* [Posts Section](pages/blocks/posts-section.md)
* [Events Section](pages/blocks/events-section.md)
* [Products Section](pages/blocks/products-section.md)
* [Form Section](pages/blocks/form-section.md)
* [Search Section](pages/blocks/search-section.md)
* [Creating Blocks](pages/blocks/creating-blocks.md)
* [Editing Blocks](pages/blocks/editing-blocks.md)
* [Menus](menus/README.md)
Expand All @@ -36,6 +38,7 @@
* [Cart](shop/cart.md)
* [Forms](forms/README.md)
* [Submissions](forms/submissions.md)
* [Search](search.md)
* [Icons](icons.md)
* [Settings](settings.md)
* [Seed Data](seed-data.md)
18 changes: 15 additions & 3 deletions docs/pages/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

## Introduction

Pages are Tailor Blueprint entries designed to display the content throughout the theme. The following files are used to display pages

The idea behind the pages is that anyone can create anything based anything. There are two types of pages defined in the [`page.yaml`](https://github.com/artistro08/tailor-starter/blob/main/seeds/blueprints/content/page/page.yaml) blueprint, listed below:
Pages are Tailor Blueprint entries designed to display the content throughout the theme. The idea behind the pages is that anyone can create anything based anything. There are three types of pages defined in the [`page.yaml`](https://github.com/artistro08/tailor-starter/blob/main/seeds/blueprints/content/page/page.yaml) blueprint, listed below:



Expand Down Expand Up @@ -35,6 +33,16 @@ These pages are more powerful. You can build pages exactly how you want. They su
* SEO & OG Tag information provided by the [`seo_fields.yaml`](https://github.com/artistro08/tailor-starter/blob/main/seeds/blueprints/content/mixins/builder/general\_options/seo\_fields.yaml) file
* Header, Body, and Footer code areas provided by the [`code_fields.yaml`](https://github.com/artistro08/tailor-starter/blob/main/seeds/blueprints/content/mixins/builder/general\_options/code\_fields.yaml) file.

### Search Pages

Search Pages return search content from a [Search Section](blocks/search-section.md) block or from the Global Search. They support the following content:

* An Image field used to display behind the title
* SEO & OG Tag information provided by the [`seo_fields.yaml`](https://github.com/artistro08/tailor-starter/blob/main/seeds/blueprints/content/mixins/builder/general\_options/seo\_fields.yaml) file
* Header, Body, and Footer code areas provided by the [`code_fields.yaml`](https://github.com/artistro08/tailor-starter/blob/main/seeds/blueprints/content/mixins/builder/general\_options/code\_fields.yaml) file

These page types can keep data structure as well, so they can have any child (or be a child)

## Template Files

The files below are used to display content throughout the site. Below is an explanation of what each file does and how things are rendered. 
Expand Down Expand Up @@ -63,6 +71,10 @@ This file is used to display the homepage from the settings. It's almost a carbo
* [Events Section](blocks/events-section.md)
* [Form Section](blocks/form-section.md)

#### `search/*`

[These files](https://github.com/artistro08/tailor-starter/tree/main/partials/search) include the search results from a query. They return all front facing post types. They are used by the [Search Section](blocks/search-section.md) block.

### Blueprints

#### `builder/sections/*`
Expand Down
24 changes: 18 additions & 6 deletions docs/pages/blocks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,14 @@ Below is a file structure with annotations to explain what each block blueprint
┃ ┣ <a data-footnote-ref href="#user-content-fn-17">products.yaml</a>
┃ ┣ <a data-footnote-ref href="#user-content-fn-18">products_column.yaml</a>
┃ ┗ <a data-footnote-ref href="#user-content-fn-19">products_common.yaml</a>
┣ search/
┃ ┣ <a data-footnote-ref href="#user-content-fn-20">search_column.yaml</a>
┃ ┣ <a data-footnote-ref href="#user-content-fn-21">search_common.yaml</a>
┃ ┗ <a data-footnote-ref href="#user-content-fn-22">search.yaml</a>
┣ section/
┃ ┗ <a data-footnote-ref href="#user-content-fn-20">section.yaml</a>
┣ <a data-footnote-ref href="#user-content-fn-21">blog_builder.yaml</a>
┗ <a data-footnote-ref href="#user-content-fn-22">builder.yaml</a>
┃ ┗ <a data-footnote-ref href="#user-content-fn-23">section.yaml</a>
┣ <a data-footnote-ref href="#user-content-fn-24">blog_builder.yaml</a>
┗ <a data-footnote-ref href="#user-content-fn-25">builder.yaml</a>
</code></pre>

## Block Types
Expand All @@ -67,6 +71,7 @@ The Section block types are as follows:
* [Events](events-section.md)
* [Products](products-section.md)
* [Form](form-section.md)
* [Search](search-section.md)

### Colum Blocks

Expand All @@ -79,6 +84,7 @@ The Column block types are as follows:
* [Events](section/events-column.md)
* [Products](section/products-column.md)
* [Forms](section/form-column.md)
* [Search](search-section.md)



Expand Down Expand Up @@ -124,10 +130,16 @@ The Column block types are as follows:

[^19]: Contains common fields in the product section and column blocks

[^20]: Shows a section block with columns
[^20]: Shows a Search block in a column

[^21]: Used to build the page in the Blog Posts entry type
[^21]: Contains common fields in the search section and column blocks

[^22]: Shows a Search block in a Section

[^23]: Shows a section block with columns

[^22]: Used to build pages&#x20;
[^24]: Used to build the page in the Blog Posts entry type



[^25]: Used to build pages&#x20;
16 changes: 16 additions & 0 deletions docs/pages/blocks/search-section.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Search Section

This section is used to display a search field. You can configure the searchable entry types and set a field placeholder for the search field.&#x20;

By default, it uses the [Default Search Page](../../settings.md#search-tab) in the Settings if no page is set.&#x20;

The section's tag name is either `section` or the `section.html_tag` in the [Advanced Tab](section/advanced-tab.md) fields if you have it set. The Advanced Tab fields also add an ID attribute and CSS Classes that you specify. You can also adjust the Bootstrap container type as well in this tab.&#x20;

You can also adjust the spacing before and after using the switches from `section.disable_top_spacing`, and `section.disable_bottom_spacing` respectfully.&#x20;

### Files Used

The following files are used to display this content

* ``[`builder/search/*`](https://github.com/artistro08/tailor-starter/tree/main/seeds/blueprints/content/mixins/builder/search) blueprint files used in the `builder.yaml` file
* ``[`search/*`](https://github.com/artistro08/tailor-starter/tree/main/partials/search) partial files used to render search&#x20;
2 changes: 1 addition & 1 deletion docs/pages/blocks/section/form-column.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Form Column

The Form Column Block displays forms from the [Form ](../../../forms/)entry type according to specified settings. This is a carbon copy of the [Posts Section](../posts-section.md) block except it has column attributes.
The Form Column Block displays forms from the [Form ](../../../forms/)entry type according to specified settings. This is a carbon copy of the [Form Section ](../form-section.md)block except it has column attributes.

### Files Used

Expand Down
11 changes: 11 additions & 0 deletions docs/pages/blocks/section/search-column.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Search Column

The Search Column Block displays a search field according to specified settings. This is a carbon copy of the [Search Section](../search-section.md) block except it has column attributes.

### Files Used

The following files are used to display this content

* `builder/search/*` included in the `section.yaml` file
* ``[`builder/column/search.htm`](https://github.com/artistro08/tailor-starter/blob/main/partials/builder/columns/search.htm) partial used to display the search block.

32 changes: 32 additions & 0 deletions docs/search.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Search

## Introduction

Search allows you to search any front facing content on the site. It is disabled by default.&#x20;

In order to use the search, you'll need create a [Search Page](pages/#search-pages) and set it as default in the [Search Settings ](settings.md#search-tab)

## How Search Works

The search query from either a [Search Section](pages/blocks/search-section.md) block or Global Search is used to search all titles of entry content. You can specify what to search by configuring the block or settings to do so.&#x20;

### Global Search

Global search is defined in the navbar. It's used to search content globally and is different from the Search Blocks.&#x20;

## Template Files

The files below are used to display content throughout the site. Below is an explanation of what each file does and how things are rendered.&#x20;

### Partials

#### `search/*`

[These files](https://github.com/artistro08/tailor-starter/tree/main/partials/search) are used to return search content from the search query.&#x20;

### Blueprints

#### `blueprints/search/*`

[These files](https://github.com/artistro08/tailor-starter/tree/main/seeds/blueprints/content/mixins/builder/search) are used to render the top level Section blocks in the Dynamic Page Builder

13 changes: 13 additions & 0 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,22 @@ This tab allows you to do the following
* Enable the Blog
* If disabled, the Blog navigation item will be hidden.
* Will also disable the posts builder blocks
* Enable Search
* If disabled the search blocks and backend navigation items will be hidden.&#x20;

> Note: if any of the switches are turned off on this page, you'll need to refresh the backend to see the changes.&#x20;
## Search Tab

This tab is used to configure search settings. The following is configurable:

* Default Search Page (Required)
* Enable Global Search (in Navbar)
* Global Items to Search For
* Lets you specify which items you want searchable throughout the site.&#x20;

By default, search is disabled since you have to create a [Search Page](pages/#search-pages) for it.&#x20;

## Global Code Tab

This tab is used to place code snippets in their respective areas of the site.
Expand Down
47 changes: 47 additions & 0 deletions pages/page.htm
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,52 @@ <h1>{{ page.title }}</h1>
{% partial 'builder/items' section=section %}
{% endfor %}
{% endif %}

{% if page.entry_type == 'search' %}
{% if settings.enable_search == true %}
{% set searchTerms = get() %}
<header class="hero bg-dark overflow-hidden d-flex align-items-center text-light position-relative py-4 mb-4">
<div class="container position-relative" style="z-index: 1">
<div class="row">
<div class="col-12 text-center">
<h1 class="mb-4">Search Results for "{{ searchTerms.term }}"</h1>
</div>
<div class="row">
<div class="col-12 col-lg-6 mx-auto">
<form action="{{ searchPage }}" method="get">
<div class="input-group mb-3">
<input type="text" name="term" class="form-control" placeholder="{{ section.search_field_placeholder }}" aria-label="{{ section.search_field_placeholder }}" value="{{ searchTerms.term }}">
{% for searchTerm,searchValue in searchTerms %}
{% if searchTerm != "term" %}
<input type="hidden" name="{{ searchTerm }}" value="true">
{% endif %}
{% endfor %}
<input type="hidden" name="global" value="{{ searchTerms.global == "true" ? "true" : "false" }}">
<button class="btn btn-primary d-flex align-items-center justify-content-center" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</button>
</div>
</form>
</div>
</div>
</div>
</div>
{% if page.image|length %}
<div class="hero-media position-absolute bg-dark position-absolute top-0 start-0 bottom-0 end-0 w-100 opacity-50" style="z-index: 0">
<img src="{{ page.image|media|resize(1920) }}" alt="{{ page.title }}" class="w-100 h-100" style="object-fit: cover; ">
</div>
{% endif %}
</header>
<section>
<div class="container">
{% partial 'search/search_results' section=section searchTerms=searchTerms %}
</div>
</section>
{% else %}
{% do abort('404') %}
{% endif %}
{% endif %}
{% endif %}
{% endif %}
15 changes: 15 additions & 0 deletions partials/builder/columns/search.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{% set searchPage = column.search_page|length ? 'page'|page({fullslug: column.search_page.fullslug }) : 'page'|page({fullslug: settings.default_search_page.fullslug }) %}
<form action="{{ searchPage }}" method="get">
<div class="input-group mb-3">
<input type="text" name="term" class="form-control" placeholder="{{ column.search_field_placeholder }}" aria-label="{{ column.search_field_placeholder }}">
{% for entry in column.entries_to_search %}
<input type="hidden" name="{{ entry }}" value="true">
{% endfor %}
<input type="hidden" name="global" value="false">
<button class="btn btn-primary" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</button>
</div>
</form>
4 changes: 4 additions & 0 deletions partials/builder/items.htm
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@
{# Form #}
{% if section.content_group == 'form' %}
{% partial 'builder/sections/form' section=section %}
{% endif %}
{# Search #}
{% if section.content_group == 'search' %}
{% partial 'builder/sections/search' section=section %}
{% endif %}
35 changes: 35 additions & 0 deletions partials/builder/sections/search.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
[global settings]
handle = "Content\Settings"
==
{% if settings.enable_search == true %}
<{{ section.html_tag == "default" ? "section" : section.html_tag }}
{{ section.html_anchor|length ? 'id="' ~ section.html_anchor ~ '"' }}
class="{% if section.css_classes|length %}
{% for class in section.css_classes|split(',') %}
{{ class ~ ' ' }}
{% endfor %}
{% endif %}
{{ section.style == 'light' ? 'bg-light' }}
{{ section.style == 'dark' ? 'bg-dark text-white' }}
{{ section.disable_top_spacing == true ? 'pt-0' : "pt-4" }}
{{ section.disable_bottom_spacing == true ? 'pb-0' : "pb-4" }}"
>
<div class="{{ section.container_style }}">
{% set searchPage = section.search_page|length ? 'page'|page({fullslug: section.search_page.fullslug }) : 'page'|page({fullslug: settings.default_search_page.fullslug }) %}
<form action="{{ searchPage }}" method="get">
<div class="input-group mb-3">
<input type="text" name="term" class="form-control" placeholder="{{ section.search_field_placeholder }}" aria-label="{{ section.search_field_placeholder }}">
{% for entry in section.entries_to_search %}
<input type="hidden" name="{{ entry }}" value="true">
{% endfor %}
<input type="hidden" name="global" value="false">
<button class="btn btn-primary" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</button>
</div>
</form>
</div>
</{{ section.html_tag == "default" ? "section" : section.html_tag }}>
{% endif %}
7 changes: 7 additions & 0 deletions partials/builder/sections/section.htm
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,13 @@
{% if column.content_group == "form" %}
{% partial 'builder/columns/form' column = column %}
{% endif %}

{# Search Column Group #}
{% if settings.enable_search == true %}
{% if column.content_group == "search" %}
{% partial 'builder/columns/search' column = column %}
{% endif %}
{% endif %}
</div>
{% endfor %}
</div>
Expand Down
22 changes: 22 additions & 0 deletions partials/header.htm
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,28 @@
{% endif %}
{% endfor %}
</ul>
{% if settings.enable_search %}
{% if settings.enable_global_search %}
<div class="ms-auto me-2">
{% set searchPage = 'page'|page({fullslug: settings.default_search_page.fullslug }) %}
{% set globalSearchTerms = get() %}
<form action="{{ searchPage }}" method="get">
<div class="input-group">
<input type="text" name="term" class="form-control" placeholder="{{ settings.search_field_placeholder }}" aria-label="{{ settings.search_field_placeholder }}" value="{{ globalSearchTerms.global == "true" ? globalSearchTerms.term }}">
{% for entry in settings.entries_to_search %}
<input type="hidden" name="{{ entry }}" value="true">
{% endfor %}
<input type="hidden" name="global" value="true">
<button class="btn btn-primary" type="submit">
<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill="currentColor" class="bi bi-search" viewBox="0 0 16 16">
<path d="M11.742 10.344a6.5 6.5 0 1 0-1.397 1.398h-.001c.03.04.062.078.098.115l3.85 3.85a1 1 0 0 0 1.415-1.414l-3.85-3.85a1.007 1.007 0 0 0-.115-.1zM12 6.5a5.5 5.5 0 1 1-11 0 5.5 5.5 0 0 1 11 0z"/>
</svg>
</button>
</div>
</form>
</div>
{% endif %}
{% endif %}
</div>
{% if settings.enable_shop %}
<div class="me-1 ms-auto order-3 order-lg-4" id="global-cart-button">
Expand Down
Loading

0 comments on commit f07d797

Please sign in to comment.