Skip to content

Commit

Permalink
[#45] Adds Call To Action block
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuapease committed Oct 1, 2024
1 parent 7993662 commit 9e9eff5
Show file tree
Hide file tree
Showing 7 changed files with 202 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
color: null
fieldLayouts:
1c969fb9-3597-4082-8e64-34c1c9d9a30e:
tabs:
-
elementCondition: null
elements:
-
autocapitalize: true
autocomplete: false
autocorrect: true
class: null
dateAdded: '2024-10-01T00:05:01+00:00'
disabled: false
elementCondition: null
id: null
includeInCards: false
inputType: null
instructions: null
label: null
max: null
min: null
name: null
orientation: null
placeholder: null
providesThumbs: false
readonly: false
requirable: false
size: null
step: null
tip: null
title: null
type: craft\fieldlayoutelements\entries\EntryTitleField
uid: eee9050d-ab79-46d2-87ee-878855f72e52
userCondition: null
warning: null
width: 100
-
dateAdded: '2024-10-01T13:11:53+00:00'
elementCondition: null
fieldUid: c52a9170-652b-4d92-a226-69894b1822ed # Rich Text: Simple
handle: null
includeInCards: false
instructions: null
label: Description
providesThumbs: false
required: false
tip: null
type: craft\fieldlayoutelements\CustomField
uid: ba1291b5-b2a2-4ca5-b843-6373de152e83
userCondition: null
warning: null
width: 100
-
dateAdded: '2024-10-01T00:12:31+00:00'
elementCondition: null
type: craft\fieldlayoutelements\HorizontalRule
uid: 484dde25-62c7-4238-aea8-6b652747f0e5
userCondition: null
-
dateAdded: '2024-10-01T00:08:26+00:00'
elementCondition: null
fieldUid: 69fe4c18-21c9-4a3d-8fce-9988d3f741e4 # Link
handle: null
includeInCards: false
instructions: null
label: null
providesThumbs: false
required: false
tip: null
type: craft\fieldlayoutelements\CustomField
uid: 773dfd43-62a1-4bb4-91fa-9856f06fc1a2
userCondition: null
warning: null
width: 25
-
dateAdded: '2024-10-01T00:12:31+00:00'
elementCondition: null
fieldUid: 167784f4-27c4-45bc-bcf4-eee051e54bd6 # Open Link In New Window
handle: null
includeInCards: false
instructions: null
label: null
providesThumbs: false
required: false
tip: null
type: craft\fieldlayoutelements\CustomField
uid: f7e9ad77-240d-4431-8815-e37e8c5edd16
userCondition: null
warning: null
width: 25
-
dateAdded: '2024-10-01T00:12:31+00:00'
elementCondition: null
fieldUid: b80d8ac7-5039-4535-afa5-82ec086e2f61 # Link Text
handle: null
includeInCards: false
instructions: null
label: null
providesThumbs: false
required: false
tip: null
type: craft\fieldlayoutelements\CustomField
uid: 72e64fac-8f30-4d15-970d-6ae71bfafa56
userCondition: null
warning: null
width: 50
name: Content
uid: 8f12bd58-cd2c-4be0-9371-9e66d9828ff5
userCondition: null
handle: callToAction
hasTitleField: true
icon: diagram-next
name: 'Call To Action'
showSlugField: true
showStatusField: true
slugTranslationKeyFormat: null
slugTranslationMethod: site
titleFormat: ''
titleTranslationKeyFormat: null
titleTranslationMethod: site
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ settings:
- 896b8f2a-ed0c-42c9-b5fd-ba8668fc6784 # Rich Text
- 7ced3e9d-9b54-47f6-8103-e5c3a4fbaf9c # Card Grid
- 3bcf7ddb-71e7-4115-868c-815b3611b34c # Text With Media
- 534ccdd8-7abd-4300-a102-71885b21c126 # Call To Action
includeTableView: false
maxEntries: null
minEntries: null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
columnSuffix: null
handle: richTextSimple
instructions: null
name: 'Rich Text: Simple'
searchable: false
settings:
availableTransforms: ''
availableVolumes: '*'
ckeConfig: b7e66782-af96-4012-9e17-914134073ced # Simple
createButtonLabel: null
defaultTransform: null
enableSourceEditingForNonAdmins: false
purifierConfig: null
purifyHtml: true
showUnpermittedFiles: false
showUnpermittedVolumes: false
showWordCount: false
wordLimit: null
translationKeyFormat: null
translationMethod: none
type: craft\ckeditor\Field
4 changes: 3 additions & 1 deletion config/project/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dateModified: 1727740506
dateModified: 1727788818
email:
fromEmail: $SYSTEM_EMAIL_FROM
fromName: 'Viget Craft Starter'
Expand Down Expand Up @@ -32,6 +32,7 @@ meta:
35b563a0-4662-40b9-b885-a8450a2868d9: 'Viget Craft Starter' # Viget Craft Starter
55cc26b6-8b49-47de-bbe7-5908da6f4545: 'Video Url' # Video Url
69fe4c18-21c9-4a3d-8fce-9988d3f741e4: Link # Link
534ccdd8-7abd-4300-a102-71885b21c126: 'Call To Action' # Call To Action
570fb481-ad97-46db-8bad-f7b0fd90e831: Image # Image
805d8826-faed-4186-9b88-f509eb9b07e6: 'Viget Craft Starter' # Viget Craft Starter
896b8f2a-ed0c-42c9-b5fd-ba8668fc6784: 'Rich Text' # Rich Text
Expand All @@ -42,6 +43,7 @@ meta:
ac3b0590-d417-429e-aa1f-96be3c79a5b0: 'Media Type' # Media Type
b7e66782-af96-4012-9e17-914134073ced: Simple # Simple
b80d8ac7-5039-4535-afa5-82ec086e2f61: 'Link Text' # Link Text
c52a9170-652b-4d92-a226-69894b1822ed: 'Rich Text: Simple' # Rich Text: Simple
cd489d3c-f914-475c-a270-ab926e4e7485: 'Rich Text' # Rich Text
d7f9c488-b14d-48c2-b6fc-d616b7a9f49f: 'Show Media On' # Show Media On
plugins:
Expand Down
10 changes: 10 additions & 0 deletions templates/_blocks/_callToAction.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{# @var \craft\elements\Entry|null block #}
{% set block = block ?? null %}

{{ include('_components/call-to-action.twig', {
title: block.title,
text: block.richTextSimple,
href: block.href,
linkText: block.linkText,
newWindow: block.newWindow,
}) }}
35 changes: 35 additions & 0 deletions templates/_components/call-to-action.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{# @var string|null title #}
{% set title = title ?? null %}

{# @var string|null text #}
{% set text = text ?? null %}

{# @var string|null href #}
{% set href = href ?? null %}

{# @var string|null linkText #}
{% set linkText = linkText ?? null %}

{# @var boolean|null newWindow #}
{% set newWindow = newWindow ?? null %}

<div class="bg-neutral-100 py-48">
<div class="flex flex-col items-center gap-24 max-w-content px-16 mx-auto ">
{% if title %}
<h2 class="text-xl">{{ title }}</h2>
{% endif %}

{% if text %}
<div class="max-w-[640px]">{{ text }}</div>
{% endif %}

{% if href and linkText %}
{{ include('_components/button.twig', {
href,
newWindow,
text: linkText,
newWindow,
}) }}
{% endif %}
</div>
</div>
11 changes: 11 additions & 0 deletions templates/parts-kit/call-to-action/default.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends 'viget-parts-kit/layout.twig' %}

{% block main %}
{{ include('_components/call-to-action.twig', {
title: 'Lorem ipsum dolor sit amet',
text: 'Lorem ipsum dolor sit amet, consectetur adipiscing e lit. Nulla facilisi. Nulla facilisi. Nulla facilisi.',
href: '#TEST',
linkText: 'Button',
newWindow: true,
}) }}
{% endblock %}

0 comments on commit 9e9eff5

Please sign in to comment.