WP Manifestindependent plugin directory
manifest / themes / timber-fractal-paths

Timber Custom Loader WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

Use Fractal with Timber in WordPress

★ 5stars
2kcomposer installs
3.0.0latest · 3 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/bluecadet/timber-fractal-paths/archive/refs/heads/master.zip

On Packagist as bluecadet/timber-fractal-paths:

composer require bluecadet/timber-fractal-paths
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

Custom loader that allows Fractal paths to reroute to Fractal files.

Fractal

Your Fractal build should use a twig engine. You can then call your fractal patterns as is typical of Fractal:

{% include
  '@patterns/components/awesome-pattern' with {
    data: {
      title: 'Hi',
      content: 'Am content'
    }
  }
%}

{% include
  '@patterns/components/cool-patterns/real-cool-pattern' with {
    data: {
      title: 'Hi',
      content: 'Am content'
    }
  }
%}

The loader will attempt to load a .twig file matching the parent folders name, which is the last item in the include path. This assumes that you have the following file structure (given the above example):

THEME_DIR
- fractal
  - patterns
    - awesome-pattern
      - awesome-pattern.twig
    - cool-patterns
      - really-cool-pattern
        - really-cool-pattern.twig

@patterns is the default namespace used in this plugin, but @components is typical for Fractal.

Configuration

Namespace defaults to '@patterns'. Define FRACTAL_HANDLE in your theme to change the handle (DO NOT use @ in the definition, i.e. 'patterns' not '@patterns').

define('FRACTAL_HANDLE', 'patterns' );

Path defaults to 'THEME_PATH/fractal/patterns' (get_stylesheet_directory() . '/fractal/patterns'). Define FRACTAL_PATH in your theme to change the handle (DO NOT use @ in the definition, i.e. 'patterns' not '@patterns').

define('FRACTAL_PATH', get_stylesheet_directory() . '/fractal/patterns' );

Want to add other Custom Loaders?

The timber_fractal_paths/loaders provides and array of loaders before they are pushed into the custom chain loader. Create your loader, add it to the array, and return it.

add_filter('timber_fractal_paths/loaders', function($loaders) {
  $loaders[] = new SomeCustomLoaderClass($paths);
  return $loaders;
}));

The scaffolding of this plugin came from weareindi/timber-custom-loader

Releases

4 releases.

Tag
Published
3.0.0 latest
Jul 14, 2023 3 years ago
Jul 14, 2023 3 years ago
Oct 25, 2022 3 years ago
Sep 20, 2019 7 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

Timber Custom Loader 1.0.0 · audited by WP Registry

No security issues found.

Audited release
1.0.0
Findings
none
Worst severity
—
Content hash
99540df59e855749d63d4115…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.