Skip to main content

Articles tagged with "content"

Allow editors to use HTML attributes by default

26th Oct 2022

Drupal provides an excellent sanitisation system to filter the HTML content that editors might create. Think of it like a series of traffic cops that filter different vehicles into different lanes. Some content is allowed through to its destination, some has to be transformed along the way, and some is simply blocked from displaying. Administrators can use the 'Limit allowed HTML tags and correct faulty HTML' option to configure which HTML elements and attributes they can use. This helps protect a site against nefarious HTML - whether it might be malicious or just ugly. Under Drupal 9, editors can't use...

Read more

A recipe for editing & translating over 100 fields

14th Jul 2020

I recently released a new contributed module to aid translation on Drupal 7 sites: Entity Translation: Separated Shared Elements Form (ETSSEF). Yes, it has a convoluted name! It finally resolves a suggestion from years ago in an Entity Translation project issue, to allow editing untranslatable fields separately to translatable ones. One of our clients has a multilingual product database site with a few hundred fields on their content, so anything like this that could reduce the size of their editing forms is useful. I figure the best way to demonstrate this is with a recipe that blends it together...

Read more

Recovering deleted content

7th Jul 2020

Drupal 7 introduced the brilliant feature of letting users cancel their own account and with it various options for what to do with content they've created when they are cancelled. One of these options is to:

Delete the account and its content.

Which can prove somewhat problematic if used incorrectly.

You see, Drupal is very good at the latter part: deleting all the content created by the user. It's not very good at warning someone that they are about to delete potentially a lot of important content.

The scenario

Let me set the scene for you. Someone had...

Read more

New Language Hierarchy release for Drupal 8

21st Jan 2020

Do you want to reach more markets and people? Do you want to tailor your content for clients from a range of locations around the world, without having to manage every single translation? Then the Language Hierarchy project could be for you! I wrote a while ago about how this module gives editors more power and flexibility without the extra effort that can come with each translation added to a site. Now Drupal 8 sites can use the project with confidence, as I produced its first stable release candidate for Drupal 8 last month! 

Thank you to all those that contributed...

Read more

Making an accurate, responsive node preview for Drupal 7

Nathan Page
12th Jan 2016

The preview functionality in action - everything works nicely inside our iFrame.It's a well known fact that a large proportion of sites turn off the node preview button. It just doesn't work well. Your unsaved changes don't show and the admin theme is used in place of your site theme - not helpful.

The default Drupal node preview.

Workflows like that provided by Workbench Moderation give previews that work nicely, but that involves a lot of complexity with revisions and workflow. It really changes the way you (and your nodes, for that matter) work. For the sites out there that don't have something like Workbench Moderation in place, this usually means that there is no accurate...

Read more

Language Hierarchy: More power and flexibility without extra effort

4th Nov 2015

Several of our recent projects have involved setting up languages that feel like 'child' languages of other languages, for a variety of reasons. Sometimes it's for marketing, so that content can be overridden for markets using a specific currency, other times it's to target a specific audience. Our classic examples are 'Euro English' and 'British English' - in either case, these are special cases of regular English. A more traditional example would be Canadian French - where most content would be the same as French, but some pages would want different spellings or customisations. We came across Amazee Labs' work on language fallback which inspired us to work on the Language Hierarchy project.

Language Hierarchy

Read more

Language lessons: What are you translating?

19th Aug 2014

Content (node-level) translation or entity (field-level) translation?

It seems an obvious question to ask, but what are you translating?

The tools exist to translate just about anything in Drupal 7*, but in many different ways, so you need to know exactly what you're translating. Language is 'a first-class citizen', in the sense that any piece of text is inherently written by someone on some language, which Drupal 7 is built to recognise. Sometimes you want to translate each & every individual piece of text (e.g. at the sentence or paragraph level). Other times you want to translate a whole page or section that is made up of multiple pieces of text.

Read more

Where is my content coming from?

5th Mar 2014

I was asked at Drupalcamp London how to identify where parts of a panel come from. Whether you need to change something on a site you inherited, are looking to trace your steps back on something you created long ago, or need to understand how to fix a colleague's mistake, it can be helpful to have a toolkit of methods to find out what produces all sorts of mystery content - not just for panels, but also views, blocks, fields, and the like.

Read more