{"id":304,"date":"2021-04-24T15:53:58","date_gmt":"2021-04-24T14:53:58","guid":{"rendered":"https:\/\/amasan.co.uk\/vandragt\/?p=304"},"modified":"2021-04-24T16:29:51","modified_gmt":"2021-04-24T15:29:51","slug":"content-structure-versus-routing-in-cuttlefish","status":"publish","type":"post","link":"https:\/\/2022.vandragt.com\/project\/content-structure-versus-routing-in-cuttlefish\/","title":{"rendered":"Content type versus routing in Cuttlefish"},"content":{"rendered":"\n<p>Cuttlefish is my hackable web\/blog framework. I\u2019m doing most of the hacking and eventually you might blog. <\/p>\n\n\n\n<p>Rubber ducking a bit. Working on the coupling of the controller name being linked to the content structure. For example \/posts\/x loads the post controller with the post model and content from content\/post\/x.md.<\/p>\n\n\n\n<p>It felt intuitive but I\u2019m not happy deriving a path literally from a class name. In Particular the post archive is an archive controller with a post model. Also feeds\/post vs feeds\/auctions or something.<\/p>\n\n\n\n<p>Originally I went with contentpath being based on a controller name property. But because the model already specifies the fields available in the content that didn\u2019t seem right<\/p>\n\n\n\n<p>So doing some work around each model having a content path property but not 100% if that\u2019s the right relation.<\/p>\n\n\n\n<p>Feels like It\u2019s doing two things. Routing and content types. <\/p>\n\n\n\n<p>For instance if I want a \/blog I\u2019d probably create a blog controller with a post model with records loaded from content\/blog.<\/p>\n\n\n\n<p>Looks like the controller is registered to a path via the router and it dictates the content path after all. <\/p>\n<div class=\"syndication-links\"><\/div>","protected":false},"excerpt":{"rendered":"<p>Cuttlefish is my hackable web\/blog framework. I\u2019m doing most of the hacking and eventually you might blog. Rubber ducking a bit. Working on the coupling of the controller name being linked to the content structure. For example \/posts\/x loads the post controller with the post model and content from content\/post\/x.md. It felt intuitive but I\u2019m [&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":[20],"class_list":["post-304","post","type-post","status-publish","format-standard","hentry","category-project","tag-cuttlefish"],"_links":{"self":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/304","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=304"}],"version-history":[{"count":3,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/304\/revisions"}],"predecessor-version":[{"id":307,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/posts\/304\/revisions\/307"}],"wp:attachment":[{"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/media?parent=304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/categories?post=304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/amasan.co.uk\/vandragt\/wp-json\/wp\/v2\/tags?post=304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}