Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Calvin Alkan
    @calvinalkan
    @atanas-dev any updates on htmlburger/wpemerge#27 and htmlburger/wpemerge#28 ?
    gus-at-2122
    @gus-at-2122

    Greetings and thanks in advance.

    How can I create a middleware that detects a subdomain and passes it as $ _GET type argument?

    For example: london.mysite.com => mysite.com/q=london

    codemonkeynorth
    @codemonkeynorth
    @atanas-dev new wpemerge site ... I didn’t use much of the backend features on this actually other than blade, but having the whole webpack/tailwind/asset pipeline setup in the starter theme is great for getting started quickly https://www.meatisdead.co.uk/
    Much gratitude to you!
    Atanas Angelov
    @atanas-dev
    Thank you for the positive feedback :)
    codemonkeynorth
    @codemonkeynorth
    Because I had to build it quickly I used global $post at the top of my blade files. This should work fine right? It seems to
    Normally I’d set up controllers and view composers
    And pass to the render view
    Atanas Angelov
    @atanas-dev
    Use the loop, don't use global $post
    codemonkeynorth
    @codemonkeynorth
    You know ... I’ve never used the loop. Even if my more complicated sites :S
    I came from timber I never learned vanilla WP!
    *in
    I will fix it up later with a controller probably. I’ve got no sub queries/posts in the page etc so assumed $post had the data I need.
    Again not normally my approach
    codemonkeynorth
    @codemonkeynorth
    (....to use global)
    Atanas Angelov
    @atanas-dev
    You don't really need a controller just for a simple post loop :)
    Arthos
    @taliesinpenbardd

    Thank you for the positive feedback :)

    I must admit that I never made any feedback, but I've already used WPEmerge theme (with blade) on a certain number of sites, with a lot of happiness... thanks @atanas-dev !

    Atanas Angelov
    @atanas-dev
    Thank you as well :)
    Lee Hilton
    @lhilton
    Hey all! I'm super impressed with WPEmerge. It does just enough, without looking like a pile of unmaintainable headaches (ahemsageahem)
    I'm updating a build script that sets up new projects for me, and I am trying to see if the new rebrand script can take parameters from the command line. Does anyone know if this is possible?
    Atanas Angelov
    @atanas-dev
    Hi @lhilton ,
    The rebrand script is minimal and does not take command line parameters. That being said, the rebrand script is contained entirely within your project so you can edit it as you please: https://github.com/htmlburger/wpemerge-theme/tree/master/resources/build/rebrand
    That being said, note that changing it may cause some conflicts when updating to a future version. You should be comfortable with resolving git conflicts or you can just make a copy of the command :)
    Lee Hilton
    @lhilton
    @atanas-dev Thank you for getting back to me. Seems straight forward enough. Cheers!
    Romain
    @Romaixn
    Hello all ! Is it better to make a controller to make an ajax call? Or is there another solution?
    And how to do that ? (make an ajax call and call it with js)
    codemonkeynorth
    @codemonkeynorth
    I believe ajax is still best done via admin-ajax.php isn't it?
    Romain
    @Romaixn
    Of course, but I see there is a directory named "Ajax" in Controllers (in starter theme). I thought it could be used to make Ajax requests
    codemonkeynorth
    @codemonkeynorth
    Ah yes maybe. I’d not checked
    codemonkeynorth
    @codemonkeynorth
    Use that to route to your controller method and then i guess just return a json encoded response
    echo json_encode(array("blablabla"=>$variable));
    }
    codemonkeynorth
    @codemonkeynorth
    // \MyApp::route()->get()->where( 'ajax', 'my-custom-ajax-action' )->handle( 'ExampleController@ajax' );
    @ajax wont be specifically required, its just the name of a method in controller
    Atanas Angelov
    @atanas-dev
    The example in the docs is pretty much all you need - you specify the ajax action and who it should apply to (authed vs unauthed users) then you return whatever you want to respond with (return MyApp::json( $my_data ) will automatically encode $my_data as a JSON response)
    codemonkeynorth
    @codemonkeynorth
    MyApp::json is what I was looking for thanks. Did not see it in the docs when I skimmed over
    2pi.pl
    @piotrk_twitter
    @atanas-dev What are the chances of releasing any time soon the add/blade-component-support@wpemerge-blade branch?
    Or is there any alternative to this great Blade feature?
    Atanas Angelov
    @atanas-dev
    Unfortunately it's going to be awhile before I can get to it.
    Romain
    @Romaixn
    Thanks for your replies ! I did the controller, but how can I call my ajax in JS ? Is the name of the action is 'my-custom-ajax-action' ? (for example if I use \MyApp::route()->get()->where( 'ajax', 'my-custom-ajax-action' )->handle( 'ExampleController@ajax' );)
    Romain
    @Romaixn
    My Controller always return me '0'
    codemonkeynorth
    @codemonkeynorth
    Set your params for authed/non-authed users
    // Match requests from any user:
    \App::route()->get()->where( 'ajax', 'my-ajax-action', true, true )->handle( $handler );
    What’s your js?
    Romain
    @Romaixn
    Yes I have that..
    My JS is simple :
    data = {
                'action': 'see-more-ajax-action',
                'query': loadmore_params.posts,
                'page': loadmore_params.current_page
            };
    
            $.ajax({
                url: loadmore_params.ajaxurl,
                type: "POST",
                data: data,
    I have a 200 status code but returned '0' in success function
    codemonkeynorth
    @codemonkeynorth
    what does loadmore_params.ajaxurl equate to?
    oh you're doing a POST... but your route is get().. either use route()->post()->.. or route()->any()->...
    Romain
    @Romaixn
    ooooh... my bad of course
    Indeed it's work, thanks a lot for that
    codemonkeynorth
    @codemonkeynorth
    @Romaixn no worries . I learned something. Whaf is your ajaxurl tho? Is it just pointing to wp-admin/admin-ajax.php ?