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
{% set fields = craft.app.fields.allFields() %} | |
{# Dependencies: | |
Use of `return`ing variables in macros, courtesy of Marion Newlevant's Twig Perversion: | |
https://plugins.craftcms.com/twig-perversion | |
#} | |
<style> | |
body {color: #333; font: 1rem/1.25 system-ui, sans-serif; margin: 2rem;} | |
table {border-collapse: collapse;} |
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
<!-- Within the source code view of a WordPress post body --> | |
<style> | |
/* CSS for the `lrno` namespace to be provided and inserted here */ | |
</style> | |
<!-- Hidden after successful JavaScript outcome --> | |
<div class="lrno-path">/path/to/assets/here</div> | |
<!-- Hidden after successful JavaScript outcome --> |
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
<!-- Historically, Vimeo URLs of the following form would work as a straightforward `src` attribute value on an iframe --> | |
<iframe src="https://player.vimeo.com/video/123456789" width="X" height="Y" allowfullscreen></iframe> | |
<!-- At some point in September 2021 Vimeo changed this, so that URLs require an `h` parameter to work --> | |
<iframe src="https://player.vimeo.com/video/123456789?h=8yt65b2a98" width="X" height="Y" allowfullscreen></iframe> | |
<!-- | |
In the above examples: |
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 a `body` field with type:fieldHandles structure: | |
collStart: collId*, attr | |
subheading: text*, customId, hWrap, incToC | |
text: text* | |
quote: text*, cite, citeUrl | |
images images* (needs work) | |
video: videoUrl*,ratio | |
collEnd collId* | |
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
{# | |
value : date and/or time value validated as not null (mandatory), | |
format : php date format string (mandatory), | |
options: { | |
prefix: string to append to processed format, | |
suffix: string to append to processed format, | |
tag : html tagname string, | |
html : markup, typically to be wrapped in a <time> element, | |
attr : hash of name:value attribute pairs | |
} |
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 f in *; do mv "$f" "$f.tmp"; mv "$f.tmp" "`echo $f | tr "[:upper:]" "[:lower:]"`"; done |
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
UPDATE table_name | |
SET field_to_update = CASE id | |
WHEN n THEN 'Text value' | |
END | |
WHERE id IN (n) |
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
set myValues to {"filename.ext", "filename.ext"} | |
tell application "Finder" to set fileList to files of target of front Finder window as alias list | |
set matchedFiles to {} | |
repeat with aFile in my fileList | |
repeat with aValue in myValues | |
tell application "System Events" to if aFile's name contains (contents of aValue) then set end of matchedFiles to (aFile as text) | |
end repeat | |
end repeat |
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
/* | |
Craft permits Markdown in its field instructions but doesn't permit raw HTML. | |
That's a pain when you want your field instructions to have links to documentation | |
elsewhere, because one would want such links to open in a new window. | |
So, with Lindsey DiLoreto's 'Control Panel JS' plugin (https://github.com/lindseydiloreto/craft-cpjs) installed, | |
just use it to add… | |
*/ | |
var links = document.querySelectorAll(".instructions a"), i; |
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
<!-- The nested structure is at present like this --> | |
<div class="panel vcard" id="[hcard-forename-surname]"> | |
<div class="header"> | |
<h2 class="fn h3">[Forename] [Surname]</h2> | |
<div class="title">[Job title]</div> | |
</div> | |
<div class="figure left1of3"> | |
<img alt="[Forename] [Surname]" src="[image_url]" class="photo"> | |
</div> | |
<div class="bio"> |
NewerOlder