Skip to content

Commit

Permalink
[#45] Adds simple Rich Text block
Browse files Browse the repository at this point in the history
- Adds TW class for default site max width
  • Loading branch information
joshuapease committed Dec 18, 2024
1 parent 21d87a6 commit 6e53cc4
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ fieldLayouts:
userCondition: null
warning: null
width: 100
-
dateAdded: '2024-09-30T23:01:15+00:00'
elementCondition: null
fieldUid: 7bd21dd3-6b12-4163-8432-030ea6a3f8d3 # Page Blocks
handle: null
includeInCards: false
instructions: null
label: null
providesThumbs: false
required: false
tip: null
type: craft\fieldlayoutelements\CustomField
uid: c2b7fef9-1532-475d-88ab-66770a63c552
userCondition: null
warning: null
width: 100
name: Content
uid: a5f66f1f-782a-4b31-978c-9c9f79c9af26
userCondition: null
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
color: null
fieldLayouts:
e33f8044-cf16-4605-bc3d-09679348a498:
tabs:
-
elementCondition: null
elements:
-
autocapitalize: true
autocomplete: false
autocorrect: true
class: null
dateAdded: '2024-09-30T22:58:38+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: 205c8050-85f3-478e-b411-c7e6073f9b3e
userCondition: null
warning: null
width: 100
-
dateAdded: '2024-09-30T23:04:32+00:00'
elementCondition: null
fieldUid: cd489d3c-f914-475c-a270-ab926e4e7485 # Rich Text
handle: null
includeInCards: false
instructions: null
label: null
providesThumbs: false
required: false
tip: null
type: craft\fieldlayoutelements\CustomField
uid: 0fc08c7a-1dfa-40d0-b234-5540eae14b50
userCondition: null
warning: null
width: 100
name: Content
uid: b1d8412f-75ff-4e81-896b-ef3b9e203f18
userCondition: null
handle: richText
hasTitleField: false
icon: font-case
name: 'Rich Text'
showSlugField: false
showStatusField: true
slugTranslationKeyFormat: null
slugTranslationMethod: site
titleFormat: ''
titleTranslationKeyFormat: null
titleTranslationMethod: site
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
columnSuffix: null
handle: pageBlocks
instructions: null
name: 'Page Blocks'
searchable: false
settings:
createButtonLabel: 'New Block'
entryTypes:
- 896b8f2a-ed0c-42c9-b5fd-ba8668fc6784 # Rich Text
includeTableView: false
maxEntries: null
minEntries: null
pageSize: null
propagationKeyFormat: null
propagationMethod: all
showCardsInGrid: false
viewMode: blocks
translationKeyFormat: null
translationMethod: site
type: craft\fields\Matrix
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
columnSuffix: null
handle: richText
instructions: null
name: 'Rich Text'
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
5 changes: 4 additions & 1 deletion config/project/project.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dateModified: 1727737086
dateModified: 1727737653
email:
fromEmail: $SYSTEM_EMAIL_FROM
fromName: 'Viget Craft Starter'
Expand All @@ -22,11 +22,14 @@ fs:
meta:
__names__:
0e7762a5-2553-4c0d-b8af-9b43b59524bf: Home # Home
7bd21dd3-6b12-4163-8432-030ea6a3f8d3: 'Page Blocks' # Page Blocks
35b563a0-4662-40b9-b885-a8450a2868d9: 'Viget Craft Starter' # Viget Craft Starter
805d8826-faed-4186-9b88-f509eb9b07e6: 'Viget Craft Starter' # Viget Craft Starter
896b8f2a-ed0c-42c9-b5fd-ba8668fc6784: 'Rich Text' # Rich Text
969acdd6-6362-41b1-b782-6bbd43a8a6b4: Home # Home
853413e4-e02c-487e-81a5-04e58eb18683: Assets # Assets
b7e66782-af96-4012-9e17-914134073ced: Simple # Simple
cd489d3c-f914-475c-a270-ab926e4e7485: 'Rich Text' # Rich Text
plugins:
aws-s3:
edition: standard
Expand Down
6 changes: 5 additions & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ export default {
...pxPair(112),
...pxPair(128),
},
extend: {},
extend: {
maxWidth: {
content: '1440px',
},
},
},
plugins: [buttons, dialog],
}
5 changes: 5 additions & 0 deletions templates/_blocks/_richText.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% set block = block ?? null %}

<div class="max-w-content mx-auto">
{{ block.richText }}
</div>
Empty file added templates/_blocks/index.twig
Empty file.
13 changes: 12 additions & 1 deletion templates/_elements/home.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
{% extends '_layouts/base' %}
{% extends '_layouts/base.twig' %}

{% block content %}
<h1 class="text-xl">Home</h1>

{{ include("_blocks/index.twig", {
blocks: entry.pageBlocks,
}) }}

{% for block in entry.pageBlocks %}
{{ include("_blocks/_#{block.type.handle}.twig", {
block,
}) }}
{% endfor %}

{% endblock %}

0 comments on commit 6e53cc4

Please sign in to comment.