plugin-icon

Editor for Timber

作者:dweipert·
Page, Theme & Plugin Editor Extension for Timber http://www.upstatement.com/timber/
版本
1.0.2
活跃安装
50
最后更新
Dec 16, 2020
Editor for Timber

Features

  • adds a metabox to configurable Post-Types to create and edit Twig templates
  • adds Twig support to the WP Theme & Plugin editors
    • you can even customize the CodeMirror theme

Plugin Dependencies

  • https://wordpress.org/plugins/timber-library/
  • https://wordpress.org/plugins/classic-editor/

How to use the MetaBox Feature

The plugin uses the path defined in Timber::$locations as the templates path or falls back to the uploads folder if none is provided.

Either adjust your Timber::render('page.twig', $context)-functions like this:

$filenames = [TimberEditor::getTemplateFilename(), 'page.twig']; Timber::render($filenames, $context);

like this

TimberEditor::render('page.twig', $context); # 'page.twig' serves as a fallback if the current posts's template doesn't exist

or like this

TimberEditor::renderPost('page.twig', $context); # renderPost() automatically adds ['post' => new Timber\Post()] to the $context
免费使用Business套餐
通过安装,您同意 WordPress.com 服务条款第三方插件条款
目前已测试版本
WordPress 5.5.17
这个插件是可用的下载,适用于您的站点。