{"id":600,"date":"2022-08-19T12:56:05","date_gmt":"2022-08-19T11:56:05","guid":{"rendered":"https:\/\/amasan.co.uk\/vandragt\/?p=600"},"modified":"2022-08-19T12:56:05","modified_gmt":"2022-08-19T11:56:05","slug":"introducing-htmxpress-htmx-for-wordpress","status":"publish","type":"post","link":"https:\/\/2022.vandragt.com\/project\/introducing-htmxpress-htmx-for-wordpress\/","title":{"rendered":"Introducing HTMXpress = HTMX for WordPress"},"content":{"rendered":"\n<p>I have recently been interested in using <a href=\"https:\/\/htmx.org\/\">HTMX<\/a>, but there&#8217;s <a href=\"https:\/\/duckduckgo.com\/?t=ffab&amp;q=htmx+wordpress&amp;ia=web\">not been any activity within the WordPress community<\/a> as far as I can see. I hope to change that with HTMXpress (pronounced as HTM express).<\/p>\n\n\n\n<p>HTMX allows you to annotate dynamic script style behaviour via custom HTML properties, using progressive enhancement. Perhaps you&#8217;re familiar with <a href=\"https:\/\/hotwired.dev\/\">Hotwire<\/a> (ruby on rails) or <a href=\"https:\/\/intercoolerjs.org\/\">Intercooler.js <\/a>(htmx predecessor).<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The approach<\/h2>\n\n\n\n<p>By using the <a href=\"https:\/\/make.wordpress.org\/plugins\/2012\/06\/07\/rewrite-endpoints-api\/\">Rewrite Endpoints API<\/a> to create a custom endpoint; and a bit of custom template logic, we can output a serverside partial or custom theme template.<\/p>\n\n\n\n<p>Using this setup, WordPress can leverage HTML over the wire solutions such as HTMX.<\/p>\n\n\n\n<p>HTMX then allows us to do dynamic serverside based rendering; live search and other features without the overhead and complexity of reactive JavaScript frameworks, whilst benefiting from trusted object and full page caching solutions. <\/p>\n\n\n\n<p>Currently it&#8217;s a prototype. I&#8217;ll be blogging more about progress as things go on. <\/p>\n\n\n\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link\" href=\"https:\/\/github.com\/svandragt\/htmxpress\">Visit HTMXpress<\/a><\/div>\n<\/div>\n<div class=\"syndication-links\"><\/div>","protected":false},"excerpt":{"rendered":"<p>I have recently been interested in using HTMX, but there&#8217;s not been any activity within the WordPress community as far as I can see. I hope to change that with HTMXpress (pronounced as HTM express). HTMX allows you to annotate dynamic script style behaviour via custom HTML properties, using progressive enhancement. Perhaps you&#8217;re familiar with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"mf2_syndication":[],"webmentions_disabled_pings":false,"webmentions_disabled":false,"footnotes":""},"categories":[4],"tags":[55],"class_list":["post-600","post","type-post","status-publish","format-standard","hentry","category-project","tag-htmxpress"],"_links":{"self":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/600","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/comments?post=600"}],"version-history":[{"count":1,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/600\/revisions"}],"predecessor-version":[{"id":601,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/600\/revisions\/601"}],"wp:attachment":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/media?parent=600"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/categories?post=600"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/tags?post=600"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}