This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="form-text"> | |
<label for="first-name" class="vh">First Name</label> | |
<input type="text" name="first-name" id="first-name" placeholder="First Name"> | |
</div> | |
<div class="form-text"> | |
<label for="last-name" class="vh">Last Name</label> | |
<input type="text" name="last-name" id="last-name" placeholder="Last Name"> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p>Event Date: {{ entry.eventDate }}</p> | |
<p>Event Start : {{ entry.eventStartTime }}</p> | |
<p>Event End : {{ entry.eventEndTime }}</p> | |
<p>datetime: {{ entry.eventDate | date("Y-m-d")}}T{% if entry.eventStartTime|length %}{{ entry.eventStartTime | date("Hi") }}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if asset.width > asset.getWidth('detail') %} | |
{% do asset.setTransform('detail') %} | |
{% endif %} | |
<img src="{{ asset.url }}" alt="{{ asset.title }}"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For when you make a change to .gitignore and the stupid thing still keeps old files in there. | |
To untrack a single file that has already been added/initialized to your repository, i.e., stop tracking the file but not delete it from your system use: git rm --cached filename | |
To untrack every file that is now in your .gitignore: | |
First commit any outstanding code changes, and then, run this command: | |
git rm -r --cached . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% if craft.request.isAjax %} | |
{% set layout = "_ajaxLayout" %} | |
{% else %} | |
{% set layout = "_layout" %} | |
{% endif %} | |
{% extends layout %} | |
{% set limit = 10 %} | |
{% set params = { section: 'news', limit: limit} %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{ entry.eventLocation.streetAddress1 }}<br> | |
{% if entry.eventLocation.streetAddress2 | length %}{{ entry.eventLocation.streetAddress2 }}<br>{% endif %} | |
{% if entry.eventLocation.city %}{{ entry.eventLocation.city }}, {% endif %}{% if entry.eventLocation.state %}{{ entry.eventLocation.state }}{% endif %}{% if entry.eventLocation.zipCode %} {{ entry.eventLocation.zipCode}}{% endif %}</p> | |
<a class="link" href="https://www.google.com/maps/search/?api=1&query={{ entry.eventLocation.streetAddress1|escape('url')}}{% if entry.eventLocation.city %}%20{{ entry.eventLocation.city|escape('url') }}{% endif %}{% if entry.eventLocation.state %}%20%2C{{ entry.eventLocation.state|escape('url') }}{% endif %}{% if entry.eventLocation.zipCode %}%20{{ entry.eventLocation.zipCode|escape('url') }}{% endif %}" rel="nofollow" target="_blank">Get Directions</a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can query for that parent page's entry model with a new ElementCriteriaModel. | |
{% set mainEntry = craft.entries.id(100).first() %} | |
{% if mainEntry %} | |
{% set matrixField = mainEntry.matrixFieldHandle %} | |
{% set firstContentBlock = matrixField.type('content').first() %} | |
{% if firstContentBlock %} | |
{{ firstContentBlock.myRichTextFieldHandle }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can use environment variables for site statuses though. First add a variable to your .env file or wherever else | |
environment variables are set – for example something like SITE_FOOBAR_STATUS=0 (it can be named anything). Then open the | |
site's settings page in the CP, and enter/select that variable with a $ prefix in the site's "Status" field. | |
That way, the environment variable reference will be saved to project config, and not the actual value, which means you can | |
set that variable to either 1 or 0 to enable or disable the site across different environments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'acf/fields/wysiwyg/toolbars', function ( $toolbars ) { | |
// Register a basic toolbar with a single row of options | |
$toolbars['Custom One'][1] = [ 'bold', 'italic', 'underline', 'forecolor', 'link', 'unlink' ]; | |
// Register another toolbar, this time with two rows of options. | |
$toolbars['Custom Two'][1] = [ 'bold', 'italic', 'underline', 'strikethrough', 'forecolor', 'wp_adv' ]; | |
$toolbars['Custom Two'][2] = [ 'bullist', 'numlist', 'alignleft', 'aligncenter', 'alignright' ]; |