Macaw LESS CSS Swatches

Converting Macaw: Exciting New Features of Publisher

Last few weeks/days I’ve been mostly polishing the Publisher which comes with templating support for Macaw exported HTML out of the box. Combining the data, translations and Macaw designing has significantly changed how I work.

Continue reading “Converting Macaw: Exciting New Features of Publisher”
Data driven websites using Macaw + Publisher Demo

Tutorial: Turning Macaw into a data-driven multi-language Publisher website

I’ve decided to show you how to change Macaw example website into Publisher powered website with data comming from a data source rather being hard-coded in the Macaw HTML export. Together we’ll create a website in two languages with one design/code base:

I’ll setup a fresh new project for you to follow, but you can already download the end result including the MCW file from it’s repository and study the example file as you read the tutorial.

Publisher is a small flat PHP engine I wrote and I open-sourced it under MIT licence.

Enjoy :)

Continue reading “Tutorial: Turning Macaw into a data-driven multi-language Publisher website”
Atomic Design with Mustache.PHP Cover

Atomic Design with Mustache.PHP

There’s PatternLab, Russian BEM from Yandex and maybe few other projects defining what atomic design is. Just briefly: Atomic design is a process of building websites from reusable tiny pieces up to complex collections.

What I was missing was the link between production code and library [of the PatternLab]. From my dumb perspective, having a pattern library for every project is quite overwhelming. My daily projects are considered rather small.

Is it possible to use these techniques on daily basis? How? Build it of course.

Continue reading “Atomic Design with Mustache.PHP”

i18n and l10n for Mustache (PHP) and Angular (Javascript)

English in fact uses just two forms of plural:

  • 0 children
  • 1 child
  • 2 children
  • 3 children

In Angular terminology it means ONE or OTHER1:

/**
 * Plural select rules for en locale
 *
 * @param {number} n  The count of items.
 * @return {goog.i18n.pluralRules.Keyword} Locale-specific plural value.
 * @private
 */
goog.i18n.pluralRules.enSelect_ = function(n) {
  if (n == 1) {
   return goog.i18n.pluralRules.Keyword.ONE;
  }
  return goog.i18n.pluralRules.Keyword.OTHER;
};
Continue reading “i18n and l10n for Mustache (PHP) and Angular (Javascript)”
mustache

In Search for Template Reuse Between Angular.js and PHP

PHP itself is a great templating engine. No doubts. Why to add another overhead? From my perspective is the reuse between back-end and front-end. Why is there need to produce same code on server? Few of my concerns: SEO, usability (fallback for no-javascript on old devices)

Language diferences for building any web apps:

  • on client: HTML + CSS + Javascript
  • on server: HTML + CSS + PHP (or any language of your choice like Ruby, Pyton, Java, ASP,…)

If you are lucky, your host supports Node.js and reuse of templates is very doable. But most of the time you can consider yourself lucky when your host is running latest PHP codebase.

Continue reading “In Search for Template Reuse Between Angular.js and PHP”