{"id":6791,"date":"2015-04-29T14:00:00","date_gmt":"2015-04-29T14:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2015\/04\/29\/mfc-dynamic-dialog-layout\/"},"modified":"2021-10-07T13:55:41","modified_gmt":"2021-10-07T13:55:41","slug":"mfc-dynamic-dialog-layout","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/mfc-dynamic-dialog-layout\/","title":{"rendered":"MFC Dynamic Dialog Layout"},"content":{"rendered":"<p>One of the <a href=\"https:\/\/visualstudio.uservoice.com\/forums\/121579-visual-studio\/suggestions\/2782934-improve-mfc\">frequently requested MFC features<\/a> (and by the way, thanks for the feedback and keep it coming!) is the ability to intelligently resize dialogs and their content at runtime.<\/p>\n<p>One approach is to intercept <span style=\"font-family: 'Courier New'\">WM_SIZE<\/span> message of the parent dialog and recalculate the size and position of the child controls accordingly. It works, but is extremely error prone &shy;&ndash; just imagine doing this for each control in every dialog in your application. It also introduces non-trivial logic in the presentation layer of you application, creating maintenance headaches down the road.<\/p>\n<p>In Visual Studio 2015 RC, we&rsquo;re introducing a consistent approach to managing the layout of the dialog at runtime &ndash; we call it Dynamic Dialog Layout.<\/p>\n<p>Let&rsquo;s start with an example that shows what this feature is for. Imagine a dialog with a single button (don&rsquo;t worry, I&rsquo;ll get to more realistic examples soon):<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/5327.Single_OK_button_before_resize.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/5327.Single_OK_button_before_resize.png\" alt=\"Image 5327 Single OK button before resize\" width=\"282\" height=\"195\" class=\"aligncenter size-full wp-image-29428\" \/><\/a><\/p>\n<p>If we make this dialog resizable, the user will be able to stretch the window, resulting in something like this:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3301.Single_OK_button_resized_not_moved.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3301.Single_OK_button_resized_not_moved.png\" alt=\"Image 3301 Single OK button resized not moved\" width=\"318\" height=\"228\" class=\"aligncenter size-full wp-image-29424\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3301.Single_OK_button_resized_not_moved.png 318w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3301.Single_OK_button_resized_not_moved-300x215.png 300w\" sizes=\"(max-width: 318px) 100vw, 318px\" \/><\/a><\/p>\n<p>This is not useful at all. For resize to be meaningful, we need to find a better location for that button, and maybe resize it as well. A simple and sensible approach would be to let the button &ldquo;stick&rdquo; to the bottom right corner of the dialog. Put another way, as the parent window is <em><span style=\"text-decoration: underline\">resized<\/span><\/em> by <em>X<\/em> dialog units horizontally and <em>Y<\/em> units vertically, we want the button to <em><span style=\"text-decoration: underline\">move<\/span><\/em> right and down by the same amount.<\/p>\n<p>Let&rsquo;s go ahead and implement this. Open the Properties window in the resource editor and click on the OK button in the dialog. You will see a new property set called &ldquo;Dynamic Layout&rdquo;:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/0576.Dynamic_layout_none_none.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/0576.Dynamic_layout_none_none.png\" alt=\"Image 0576 Dynamic layout none none\" width=\"342\" height=\"60\" class=\"aligncenter size-full wp-image-29421\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/0576.Dynamic_layout_none_none.png 342w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/0576.Dynamic_layout_none_none-300x53.png 300w\" sizes=\"(max-width: 342px) 100vw, 342px\" \/><\/a><\/p>\n<p>Now change the &#8220;Moving Type&#8221; to &#8220;Both&#8221; and set &#8220;Moving X&#8221; and &#8220;Moving Y&#8221; to 100 (remember, we want the button to move both right and down as the host dialog resizes):<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3276.Dynamic_layout_Both_100_100_none.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3276.Dynamic_layout_Both_100_100_none.png\" alt=\"Image 3276 Dynamic layout Both 100 100 none\" width=\"311\" height=\"99\" class=\"aligncenter size-full wp-image-29423\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3276.Dynamic_layout_Both_100_100_none.png 311w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3276.Dynamic_layout_Both_100_100_none-300x95.png 300w\" sizes=\"(max-width: 311px) 100vw, 311px\" \/><\/a><\/p>\n<p>We&rsquo;re not going to change the &lsquo;Sizing Type&rdquo; just yet &ndash; I&rsquo;ll get to that in a minute.<\/p>\n<p>Now save and recompile. Run the application and stretch the dialog. Voila:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7673.Single_OK_button_resized_moved.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7673.Single_OK_button_resized_moved.png\" alt=\"Image 7673 Single OK button resized moved\" width=\"325\" height=\"256\" class=\"aligncenter size-full wp-image-29431\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7673.Single_OK_button_resized_moved.png 325w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7673.Single_OK_button_resized_moved-300x236.png 300w\" sizes=\"(max-width: 325px) 100vw, 325px\" \/><\/a><\/p>\n<p>That&rsquo;s a lot more useful, isn&#8217;t it?<\/p>\n<p>Let&rsquo;s make it more realistic and add another button, &#8220;Cancel&#8221;:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.OK_Cancel_button_before_resize.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.OK_Cancel_button_before_resize.png\" alt=\"Image 7776 OK Cancel button before resize\" width=\"330\" height=\"206\" class=\"aligncenter size-full wp-image-29434\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.OK_Cancel_button_before_resize.png 330w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.OK_Cancel_button_before_resize-300x187.png 300w\" sizes=\"(max-width: 330px) 100vw, 330px\" \/><\/a><\/p>\n<p>We now need to decide how we want the buttons to behave when the host dialog is resized. The simplest way is to let the &ldquo;OK&rdquo; button stick to the bottom left corner, and have the &ldquo;Cancel&rdquo; button stick to the bottom right corner. We will set the Dynamic Layout for &ldquo;OK&rdquo; to &ldquo;Moving Type = Vertical&rdquo;, &ldquo;Moving Y = 100&rdquo;. The &ldquo;Cancel&rdquo; button will have &ldquo;Vertical, 100, 100&rdquo; (just like the &ldquo;OK&rdquo; button in the last example).<\/p>\n<p>Save, compile, run and resize:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/2402.OK_Cancel_button_after_resize.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/2402.OK_Cancel_button_after_resize.png\" alt=\"Image 2402 OK Cancel button after resize\" width=\"402\" height=\"208\" class=\"aligncenter size-full wp-image-29422\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/2402.OK_Cancel_button_after_resize.png 402w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/2402.OK_Cancel_button_after_resize-300x155.png 300w\" sizes=\"(max-width: 402px) 100vw, 402px\" \/><\/a><\/p>\n<p>Not bad, huh?<\/p>\n<p>Now, let&rsquo;s experiment with the &ldquo;Sizing Type&rdquo; property. In my next example, I want my buttons to scale proportionately to the size of the dialog. We&rsquo;ll be doing some math here, so to make it simpler I created a new dialog sized 200&#215;100 dialog units. Each of the buttons will have width set to 80 units (the height is immaterial for this example).<\/p>\n<p>I want the buttons to grow and shrink with the dialog, always maintaining the original proportion &ndash; which is 80\/200 or 40% of the width of the dialog. Also, I want to maintain constant space between each button and the edge of the dialog, let&rsquo;s call that &Delta;:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4784.Resizable_OK_Cancel_button_before_resize.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4784.Resizable_OK_Cancel_button_before_resize.png\" alt=\"Image 4784 Resizable OK Cancel button before resize\" width=\"316\" height=\"253\" class=\"aligncenter size-full wp-image-29427\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4784.Resizable_OK_Cancel_button_before_resize.png 316w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4784.Resizable_OK_Cancel_button_before_resize-300x240.png 300w\" sizes=\"(max-width: 316px) 100vw, 316px\" \/><\/a><\/p>\n<p>How do I express that using the Dynamic Layout settings?<\/p>\n<p>Let&rsquo;s start with the &ldquo;OK&rdquo; button. As far as its movement goes, it will continue to move vertically 100% so it remains anchored to the bottom edge. I also want it to resize dynamically as the host dialog is resized. The button occupies 40% of the width of the dialog, which means that each time the parent dialog&rsquo;s width grows by 100 units, I want the &ldquo;OK&rdquo; button to grow by 40 units. This is how to express it using the Dynamic Layout properties:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7608.Dynamic_layout_Vertical_100_Horizontal_40.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7608.Dynamic_layout_Vertical_100_Horizontal_40.png\" alt=\"Image 7608 Dynamic layout Vertical 100 Horizontal 40\" width=\"321\" height=\"99\" class=\"aligncenter size-full wp-image-29430\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7608.Dynamic_layout_Vertical_100_Horizontal_40.png 321w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7608.Dynamic_layout_Vertical_100_Horizontal_40-300x93.png 300w\" sizes=\"(max-width: 321px) 100vw, 321px\" \/><\/a><\/p>\n<p>The &ldquo;Cancel&rdquo; button requires a little bit more work. As the parent dialog grows, this button is going to move both horizontally and vertically. The vertical movement is easy &ndash; I want the button to stick to the bottom edge, so that&rsquo;s 100%. Next, I&rsquo;m going to copy the &ldquo;Sizing X&rdquo; property from the &ldquo;OK&rdquo; button &ndash; it just makes sense that the two buttons should maintain the same growth ratio, this way they will always have the same size, regardless of the size of the host dialog.<\/p>\n<p>Now, let&rsquo;s calculate the &ldquo;Moving X&rdquo; property. I said we&rsquo;ll be doing some math here, so here goes. When the dialog&rsquo;s width grows by 100 units from 200 to 300, the width of each grows accordingly, 80*300\/200 =&nbsp;120. The original X position of the &ldquo;Cancel&rdquo; button was 200- &Delta;-80 = 120- &Delta;. After the dialog&#8217;s width has grown by 100 units, the new X position of the &#8220;Cancel&#8221; button will be 300- &Delta;-120 = 180- &Delta;.<\/p>\n<p>With me so far? Good. As we just determined, the position of the &ldquo;Cancel&rdquo; button moves from 120- &Delta; to 180- &Delta;, i.e. by 60 units. And that&rsquo;s our answer &ndash; the X position grows by 60% of the growth of the dialog&#8217;s width.<\/p>\n<p>There are other ways to calculate this, and sometimes you will need a napkin or a back of an envelope (especially for complex layouts where multiple controls act as a group). A useful mental model I developed is by asking &#8220;if the width (height) of the dialog grows by 100 units, by how much should I grow or move the control?&#8221;<\/p>\n<p>Here is the full set of Dynamic Layout properties for the &ldquo;Cancel&rdquo; button:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4118.Dynamic_layout_Both_60_100_Horizontal_40.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4118.Dynamic_layout_Both_60_100_Horizontal_40.png\" alt=\"Image 4118 Dynamic layout Both 60 100 Horizontal 40\" width=\"333\" height=\"116\" class=\"aligncenter size-full wp-image-29426\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4118.Dynamic_layout_Both_60_100_Horizontal_40.png 333w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/4118.Dynamic_layout_Both_60_100_Horizontal_40-300x105.png 300w\" sizes=\"(max-width: 333px) 100vw, 333px\" \/><\/a><\/p>\n<p>And here is our resized dialog in all its beauty:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7288.Resizable_OK_Cancel_button_after_resize.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7288.Resizable_OK_Cancel_button_after_resize.png\" alt=\"Image 7288 Resizable OK Cancel button after resize\" width=\"468\" height=\"234\" class=\"aligncenter size-full wp-image-29429\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7288.Resizable_OK_Cancel_button_after_resize.png 468w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7288.Resizable_OK_Cancel_button_after_resize-300x150.png 300w\" sizes=\"(max-width: 468px) 100vw, 468px\" \/><\/a><\/p>\n<p>Admittedly, resizing buttons is not very interesting &ndash; it does make them easier to hit with the mouse but that&rsquo;s about it. Resize becomes really useful for controls with non-trivial content, such as the list box, tree control etc.<\/p>\n<p>To make this even more useful, I&rsquo;m going to add a list box to our dialog:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3583.List_before_resize.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3583.List_before_resize.png\" alt=\"Image 3583 List before resize\" width=\"316\" height=\"202\" class=\"aligncenter size-full wp-image-29425\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3583.List_before_resize.png 316w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/3583.List_before_resize-300x192.png 300w\" sizes=\"(max-width: 316px) 100vw, 316px\" \/><\/a><\/p>\n<p>I&rsquo;m leaving the button properties unchanged. The list box will grow horizontally and vertically with the host dialog, and remain attached to the upper left corner (i.e. not move):<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7711.Dynamic_layout_None_Both_100_100.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7711.Dynamic_layout_None_Both_100_100.png\" alt=\"Image 7711 Dynamic layout None Both 100 100\" width=\"328\" height=\"98\" class=\"aligncenter size-full wp-image-29432\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7711.Dynamic_layout_None_Both_100_100.png 328w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7711.Dynamic_layout_None_Both_100_100-300x90.png 300w\" sizes=\"(max-width: 328px) 100vw, 328px\" \/><\/a><\/p>\n<p>And here is the resized dialog:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.List_after_resize.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.List_after_resize.png\" alt=\"Image 7776 List after resize\" width=\"341\" height=\"213\" class=\"aligncenter size-full wp-image-29433\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.List_after_resize.png 341w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2015\/04\/7776.List_after_resize-300x187.png 300w\" sizes=\"(max-width: 341px) 100vw, 341px\" \/><\/a><\/p>\n<p>All the functionality I described here is of course available programmatically &ndash; Dynamic Dialog Layout APIs have been added to MFC. Additionally, and especially if you&rsquo;re not a mouse-and-click kind of developer, you can edit the Dynamic Dialog Layout properties directly in the RC file. We will document this on MSDN, of course, and I&rsquo;m not going to describe this here, in order to keep this post short.<\/p>\n<p>As always, we&rsquo;re interested in your comments. This feature is still a little rough around the edges, so your timely feedback will allow us to address any omissions in the RTM release.<\/p>\n<p>The sample app used in this post is attached below.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/9\/2019\/02\/MFC_Dynamic_Dialog_Layout_Demo.zip\">MFC_Dynamic_Dialog_Layout_Demo.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>One of the frequently requested MFC features (and by the way, thanks for the feedback and keep it coming!) is the ability to intelligently resize dialogs and their content at runtime. One approach is to intercept WM_SIZE message of the parent dialog and recalculate the size and position of the child controls accordingly. It works, [&hellip;]<\/p>\n","protected":false},"author":290,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[140,10],"class_list":["post-6791","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-c","tag-mfc"],"acf":[],"blog_post_summary":"<p>One of the frequently requested MFC features (and by the way, thanks for the feedback and keep it coming!) is the ability to intelligently resize dialogs and their content at runtime. One approach is to intercept WM_SIZE message of the parent dialog and recalculate the size and position of the child controls accordingly. It works, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/6791","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/290"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=6791"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/6791\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=6791"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=6791"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=6791"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}