Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Matheus Paiva
    @matepaiva
    Thanks. Just to make sure I was on the right path. :)
    Ahmad Karim
    @ahmu83
    I installed the theme using composer (composer create-project htmlburger/wpemerge-theme your-theme-name) and it asked me if I want to use bootstrap and I said yes. But I dont see no trace of bootstrap in the theme files neither in the frontend https://prnt.sc/oy4ws8
    Matheus Paiva
    @matepaiva
    Probably it just installed it so you could use without having to config. Did you try to use a bootstrap class in any html to see what happens?
    Ahmad Karim
    @ahmu83
    but shouldnt it display the frontend in bootstrap ?
    Atanas Angelov
    @atanas-angelov-dev
    @ahmu83 it will install bootstrap and add it to your bundles but it will not change the markup to look boostrap-y. Like @matepaiva said, try adding something like <button type="button" class="btn btn-danger">Danger</button> to header.php for example, run yarn build and it should be styled by Bootstrap.
    Luc D
    @LucArthos_gitlab
    hey, is that possible to define custom colors (in config.json or elsewhere) to use in the HTML markup (with Tailwindcss, like bg-blanc for a color defined as blanc in the file?
    Matheus Paiva
    @matepaiva
    Hello, you can use tailwind as usual, so you would define your custom colors in tailwind.config.js. Something like this:
    module.exports = {
      theme: {
        extend: {
          textColor: theme => ({
            main: '#F9CC10',
            'main-light': '#ffda49',
            footer: 'black',
            header: theme('colors.gray.800'),
          }),
    },
      variants: {
        textColor: ['hover', 'group-hover', 'disabled', 'responsive'],
      },
      plugins: [],
    };
    Luc D
    @LucArthos_gitlab
    thanks @matepaiva it worked. :)
    Matheus Paiva
    @matepaiva
    nice! :D
    Luc D
    @LucArthos_gitlab
    how do I use custom fonts, please? I've installed the .woff & .woff2 files in /resources/fonts. how do I reference them? url('nameofthefont.woff') format('woff')? would that be enough?
    Atanas Angelov
    @atanas-angelov-dev
    @LucArthos_gitlab use the ~@fonts/ alias e.g. url('~@fonts/nameoffont.woff')
    For more info on aliases check out https://docs.wpemerge.com/#/starter-theme/assets/overview
    Luc D
    @LucArthos_gitlab
    thanks @atanas-angelov-dev did miss that in the documentation (I searched, I swear :) )
    Atanas Angelov
    @atanas-angelov-dev
    No worries ^_^
    Luc D
    @LucArthos_gitlab
    here again... how would one write a new walker for the menu, please?
    Atanas Angelov
    @atanas-angelov-dev
    There's nothing special about writing a walker in WP Emerge than any other environment so the official WP Docs are your best friend
    Just put the class with the correct namespace inside app/src/* so it is autoloaded for you
    Luc D
    @LucArthos_gitlab
    that was my question, thanks :)
    Luc D
    @LucArthos_gitlab
    @atanas-angelov-dev hello ! I've just seen that the shipped version of TailwindCSS is 0.6.3, while the last one is 1.1.2 ; it seems that all the npm packages are quite outdated. Do you have a plan to update them all ? I tried to do that on my own, but it broke (something about clean-webpack-cli), and even requesting for the last version of TailwindCSS blocks it from working. And I don't know enough about Webpack and such to propose a merge... :/
    Atanas Angelov
    @atanas-angelov-dev
    It's in the TODO to update the version installed using the cli utility
    Luc D
    @LucArthos_gitlab
    any idea if that's close ? I mean, should I keep working with what I have, or can I expect it to come soon? anyway, thanks again for that :)
    Atanas Angelov
    @atanas-angelov-dev
    Don't know about a release date but if Tailwind have introduced bigger configuration changes you will have to apply some manual adjustments to get it to work. I can't say anything concrete right now as I haven't looked into it yet
    Luc D
    @LucArthos_gitlab
    what I saw are classes changes, I don't know about the structure...
    Matheus Paiva
    @matepaiva
    I use the current version of tailwind and as much as I saw, I didn't see any big change. Anyway, @LucArthos_gitlab , I think you should try to install using just reset.css and then add tailwindcss by following its tutorial. You will get there, I think :)
    Luc D
    @LucArthos_gitlab
    thanks @matepaiva I'll try that :)
    Matheus Paiva
    @matepaiva

    @atanas-angelov-dev It's the first time I am trying to use a Service Provider and I am getting a very weird error. It says my class does not implement the ServiceProviderInterface, but it does.

    I am not using the starter theme.

    add_action('after_setup_theme', function () {
        WPEmerge::bootstrap([
            'routes' => [
                'web' => __DIR__ . '/app/routes/web.php',
            ],
            'providers' => [
                \App\ViewComposers\HeaderViewComposerServiceProvider::class
            ],
        ]);
    });
    namespace App\ViewComposers;
    
    class HeaderViewComposerServiceProvider implements WPEmerge\ServiceProviders\ServiceProviderInterface
    {
      public function register($container)
      {
        // Nothing to register.
      }
    
      public function bootstrap($container)
      {
        View::addComposer('emails/templates/header', function ($view) {
          $view->with([ 'foo' => 'bar' ]);
        });
      }
    }

    I have no idea what I am doing wrong, hehe.

    Atanas Angelov
    @atanas-angelov-dev
    @matepaiva leading \ on the interface :)
    in general, it's better to use use statements so you avoid this kind of thing
    Matheus Paiva
    @matepaiva
    actually I was using use, but it was throwing the same exception. I will do the change and give you a feedback
    Not working... I think there is another problem.
    Updated:
    namespace App\ViewComposers;
    
    use WPEmerge\ServiceProviders\ServiceProviderInterface;
    
    class HeaderViewComposerServiceProvider implements ServiceProviderInterface
    {
      public function register($container)
      {
        // Nothing to register.
      }
    
      public function bootstrap($container)
      {
        View::addComposer('emails/templates/header', function ($view) {
          $view->with(['foo' => 'bar']);
        });
      }
    }
    Matheus Paiva
    @matepaiva
    (removed the content of $view->with() just to keep it small here)
    Atanas Angelov
    @atanas-angelov-dev
    How did you add your provider to the list of providers?
    Matheus Paiva
    @matepaiva
    it's the first sample of code
    Atanas Angelov
    @atanas-angelov-dev
    oops
    Can you please paste the full error message?
    Matheus Paiva
    @matepaiva
    sure
    Fatal error: Uncaught WPEmerge\Exceptions\ConfigurationException: The following class does not implement ServiceProviderInterface: App\ViewComposers\HeaderViewComposerServiceProvider in /server/web/app/themes/projectista/vendor/htmlburger/wpemerge/src/Application/Application.php on line 195
    Atanas Angelov
    @atanas-angelov-dev
    Are you using autoloading? What is the full path to the class file?
    Matheus Paiva
    @matepaiva

    I am using autoloading with psr-4 in composer.json:

    "autoload": {
            "psr-4": {
                "App\\": "app/src/"
            }
        },

    the full path is:
    server/web/app/themes/projectista/app/src/Providers/HeaderViewComposerServiceProvider.php

    Atanas Angelov
    @atanas-angelov-dev
    Your namespace is incorrect: App\ViewComposers
    Should be App\Providers
    Matheus Paiva
    @matepaiva
    oh really? sorrry about that, I am quite new to php and I didn't know it should match the folder name
    Atanas Angelov
    @atanas-angelov-dev
    That's how PSR4 works - dir and namespace must match
    Matheus Paiva
    @matepaiva
    great. thanks for letting me know and sorry for taking your time...
    Atanas Angelov
    @atanas-angelov-dev
    Happy to help :)
    Matheus Paiva
    @matepaiva
    Now it works.
    Thanks a lot!
    Matheus Paiva
    @matepaiva

    Hello, @atanas-angelov-dev . I want to give a feedback about something in the documentation that mades me confuse, but I don't know if it is a real problem or just a lack of experience from myself. In https://docs.wpemerge.com/#/framework/views/view-composers in the first example where you show the code, you use View::addComposerbut you didn't useit before as use WPEmerge\View.

    First time I looked it I wondered where was View coming from. Then I tried to add WPEmerge and it worked, but I had to guess.

    It's just a feedback, but as I said can be a wrong perception from my side.

    Atanas Angelov
    @atanas-angelov-dev
    Yeah, that example is misleading - I'll update it
    Atanas Angelov
    @atanas-angelov-dev
    In non-namespaced files using just View (or \View) is sufficient as there is a root-level alias, in other cases you should use \WPEmerge\Facades\View (the docs example now uses it)