Jump to content

Recommended Posts

Posted

TemplateEnginePug (formally TemplateEngineJade)

 

This module adds Pug templates to the TemplateEngineFactory. It uses https://github.com/pug-php/pug to render templates.

doctype html
html(lang='en')
  head
    meta(http-equiv='content-type', content='text/html; charset=utf-8')
    title= $page->title
    link(rel='stylesheet', type='text/css', href=$config->urls->templates . 'styles/main.css')
  body
    include header.pug
    h1= $page->title
    if $page->editable()
      p: a(href=$page->editURL) Edit

Project on GitHub: github.com/dreerr/TemplateEnginePug

Project in modules directory: modules.processwire.com/modules/template-engine-pug/

 

For common problems/features/questions about the Factory, use the TemplateEngineFactory thread.

 

  • Like 8
  • 3 months later...
Posted

Changed the git so that jade-php is included in a normal download.

Version 1.0.2 brings also some additional settings for stream and a problem we experienced with Suhosin

  • Like 2
  • 4 months later...
Posted

@dreerr Thank you for this module. Wanted to use jade with PW for a long time.

Is there a way to define global variables that can be used in any template or in a jade layout file?

Thanks

  • Like 1
  • 3 months later...
Posted

Sorry for the late reply: you cn do so by using the Factorys method: 

$view->set('globalVar', $someVariable);

 

  • dreerr changed the title to Module: Pug for the TemplateEngineFactory

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...