Skip to content

Instantly share code, notes, and snippets.

View olafgrabienski's full-sized avatar

Olaf Grabienski olafgrabienski

View GitHub Profile
@olafgrabienski
olafgrabienski / custom_date_tokens.info
Last active April 22, 2017 15:20
Custom date token for Backdrop CMS event content type URL alias pattern
name = Custom Date Tokens
description = Adds custom tokens for date fields.
package = Custom
version = BACKDROP_VERSION
type = module
backdrop = 1.x
@olafgrabienski
olafgrabienski / backdrop-translation-server-status-ideas.md
Created June 8, 2017 16:15
Building a Backdrop Translation Server, Status and Ideas

Building a Backdrop Translation Server, Status and Ideas

8th of June, 2017

Backdrop doesn't have a working translation server to provide non-English language files. Such language files are needed to run Backdrop as a multilingual or a localized website. As a workaround, Backdrop is linking to the Drupal translation server (https://localize.drupal.org) which has some drawbacks:

  • The link doesn't go to a specific page. Interested persons have to search the relevant language file of the latest Drupal core 7.x release.
  • The Drupal core language files don't catch up with the progress made by Backdrop:
    • Backdrop continues to include new language strings, or change existing ones.
  • Backdrop has integrated former Drupal contrib modules like Views, Pathauto, Token and more in Backdrop core. To get these language strings from the Drupal translation server, you have to look for the relevant module's language files.
@olafgrabienski
olafgrabienski / template.php
Created November 9, 2017 14:47
Backdrop CMS: Open PDF and TXT files in new window
<?php
function MYTHEME_file_link($variables) {
$file = $variables['file'];
$icon_directory = $variables['icon_directory'];
$url = file_create_url($file->uri);
$icon = theme('file_icon', array('file' => ($file instanceof File) ? $file : file_load($file->fid), 'icon_directory' => $icon_directory));
// Set options as per anchor format described at
@olafgrabienski
olafgrabienski / block.tpl.php
Created May 29, 2018 16:40
Backdrop CMS: Full width layout to allow blocks in the content region to be full width.
<?php
/**
* @file
* Template for outputting the default block styling within a Layout.
*
* Variables available:
* - $classes: Array of classes that should be displayed on the block's wrapper.
* - $title: The title of the block.
* - $title_prefix/$title_suffix: A prefix and suffix for the title tag. This
* is important to print out as administrative links to edit this block are
@olafgrabienski
olafgrabienski / upgrade-notes-d7-bd.md
Last active March 29, 2019 16:02
Upgrade notes, D7 to Backdrop

NB: These are just some notes, they're not elaborated.

Modules

Kept modules

Moved in core:

  • Administration menu
  • CKEditor