GithubHelp home page GithubHelp logo

flyntwp / flynt-core Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 0.0 172 KB

The core building block of the Flynt Framework.

License: MIT License

PHP 100.00%
wordpress-plugin flynt-framework composer-package php

flynt-core's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

flynt-core's Issues

Consider using index.html.twig instead of index.twig

Since TWIG is just a templating language for files, not just HTML files, is a good practice to append the file type extension to file name so code editors can guess and configure themselves accordingly.

I just wanted to know your point of view regarding this.

composer installation uses SSH instead of HTTPS

I figured out that installing this package via Composer without using a registered SSH key will not work and you'll need to enter a Github Auth Token which can't be done in a lot of terminal emulators because copy/paste is disabled.

Maybe it's just better to use HTTPS so you don't need a Github account to use this.

Currently it wants to install from [email protected]:bleech/wp-starter-plugin.git

Component file structure.

As far as I can see from the code, Flynt is currently not capable of having nested/grouped components. This can get confusing for bigger projects, especially if you want to create a set of shared components (which seems also not possible currently).

For shared components we currently using this workaround to register a twig namespace and reference it in a sibling template. How do you at bleech realise shared components currently? E.g. have a teaser article shown in a grid and in a listing.

add_filter('timber/loader/loader', function($loader) {
  $loader->addPath(Feature::getOption('flynt-components', 0), 'Component');
  return $loader;
});
{{ include '@Component/BlockButton/index.twig' }}

To have it more structured we thought it would be helpful to have a grouped folder structure like this:

Components
  Block
    Button
    Image
  List
    Posts
    Users   

Then add the parent folders as namespaces:

add_filter('timber/loader/loader', function($loader) {
  $loader->addPath(Feature::getOption('flynt-components', 0) . '/Block', 'Block');
  $loader->addPath(Feature::getOption('flynt-components', 0) . '/List', 'List');
  // etc…
  return $loader;
});

To reference it like this in the twig templates:

{{ include '@Block/Button/index.twig' }}

Did you thought about this already? If so, why did you chose the current way? Before start working on a POC I thought asking for your thoughts first 🙏

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.