Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    codemonkeynorth
    @codemonkeynorth
    should this work: <img src="{{ \App::core()->assets()->getAssetUrl("images/foo.png") }}" /> to load images/foo.png from resources?
    i actually have an asset() function for it but ignore that for now
    i just get "unknown"
    codemonkeynorth
    @codemonkeynorth
    ah i still need to do a dummy import as per htmlburger/wpemerge-theme#61
    codemonkeynorth
    @codemonkeynorth
    @atanas-dev shouldn't filehashfilter contain the path? module.exports.filehashFilter = file =>[path][name].${module.exports.filehash(file).substr(0, 10)}.[ext];
    doesnt work tho
    i cant get images in subfolders to output correctly
    my assets/index.js build script runs import '@images/photos/photo1.jpg'; (see github link above).. this should import and output the image to dist but it's not keeping the subfolder i have to reference it as <img src="{{ asset('images/photo1.jpg') }}" /><
    codemonkeynorth
    @codemonkeynorth
    the webpack file function needs to get the relative path.. eg
    const relativePath = path.relative('resources', path.dirname(file)); //return `${relativePath}/[name].${module.exports.filehash(file).substr(0, 10)}.[ext]`;
    and then not set an output path
    codemonkeynorth
    @codemonkeynorth
    something like this:
    name(file) { const relativePath = path.relative('resources/images', path.dirname(file)); return `${relativePath}/${utils.filehashFilter(file)}`; }, outputPath: 'images',
    or you could remove the "/images" part from resources relative and have no output path
    Atanas Angelov
    @atanas-dev
    Image relative path will be preserved in the next version: htmlburger/wpemerge-theme@90b0910 + htmlburger/wpemerge-theme@eef47b1
    codemonkeynorth
    @codemonkeynorth
    ok thanks
    codemonkeynorth
    @codemonkeynorth
    can i apply these changes manually to the current build or do they rely on anything else?
    codemonkeynorth
    @codemonkeynorth
    ok seems to work thanks
    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)