Skip to content

Instantly share code, notes, and snippets.

🤖
beep boop

Sid Edwards sidedwards

🤖
beep boop
Block or report user

Report or block sidedwards

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View translations-upgrade-3.2.md

Translations Upgrade Workflow (3.1 => 3.2)

Important Notes:

Craft 3.2 introduces a new Draft service that allows drafts to be created for all elements instead of being Entry specific. Unfortunately, with this new draft service the original draftIds from the entrydrafts table are not retained. Due to this fundamental restructuring of how Craft handles its Drafts, we are unable to retain any drafts created with previous versions of the plugin.

We apologize and understand the inconvenience, and did everything we could to prevent this scenario, but due to the nature of this change in Craft, we were unable to preserve existing drafts.

We strongly recommend completing all existing translation orders and publishing their drafts prior to upgrading. If you're unable to complete these orders, please reference this gist which will show you how to [create a list of Entries along with their target sites](https://gist.g

@sidedwards
sidedwards / boxfile.yml
Created Mar 26, 2019
Nanobox boxfile.yml for Sage 9 Wordpress
View boxfile.yml
run.config:
engine: php
engine.config:
runtime: php-7.2
extensions:
- gd
- mysqli
- curl
- zlib
- mbstring
View newJournalEntry.js
api.addButtonToToolbar({
title: 'New Journal Entry',
icon: 'book',
shortcut: 'alt+j',
action: async function() {
const todayDateStr = api.formatDateISO(new Date());
const todayEntry = await api.runOnServer(async todayDateStr => {
return await api.getDateNote(todayDateStr);
}, [todayDateStr]);
@sidedwards
sidedwards / description.md
Last active Dec 3, 2018
Hide Sidebar in Craft 3 Control Panel
View description.md

Hide sidebar in Craft 3 _layouts/cp

Snippet for hiding the sidebar in the Craft 3 control panel for Element index pages.

Since the Craft 3 sidebar handles the index source for querying elements it can be tricky disabling the sidebar and still executing the query.

This uses a twig macro to duplicate the sidebar and hide it while still being able to pass an index source for the query.

See the Craft templates/_layouts/cp.html file for more layout information

@sidedwards
sidedwards / breadcrumbs.html
Created Jul 22, 2017
Breadcrumb navigation in Craft CMS
View breadcrumbs.html
<div class="breadcrumbs">
<ul class="nav-list">
<li class="nav-item"><a href="/">Home</a></li>
{% set totalCrumbs = craft.request.getSegments() | length %}
{% for crumb in craft.request.getSegments() %}
{% if loop.index == totalCrumbs %}
<li class="nav-item"><a href="{{craft.request.getUrl()}}">{{crumb | capitalize}}</a></li>
{% else %}
<li class="nav-item"><a href="{{craft.request.getUrl() | split('/' ~ craft.request.getSegment(loop.index + 1))[0]}}">{{crumb | capitalize}}</a></li>
{% endif %}
View iTerm aliases
# grc overides for ls
if $(gls &>/dev/null)
then
alias ls="gls -F --color"
alias l="gls -lAh --color"
alias ll="gls -l --color"
alias la='gls -A --color'
fi
# Easier CD navigation
@sidedwards
sidedwards / gist:a818bb31cae3acaeccd92ef9f5f8dfd8
Created Nov 22, 2016
Scopeless Media query sass placeholder
View gist:a818bb31cae3acaeccd92ef9f5f8dfd8
$breakpoints: (sm:576px, md:768px, lg:992px, xl:1200px);
%button-reset {
$media: sm;
appearance: none;
border: none;
outline: none;
@each $screen-size, $breakpoint-value in $breakpoints {
@if ( index($media,$screen-size) ) {
@media (min-width: $breakpoint-value) {
You can’t perform that action at this time.