{"id":10467,"date":"2017-11-06T16:29:13","date_gmt":"2017-11-06T21:29:13","guid":{"rendered":"https:\/\/www.boldgrid.com\/support\/?p=10467"},"modified":"2020-10-01T14:52:26","modified_gmt":"2020-10-01T18:52:26","slug":"create-block-structure","status":"publish","type":"post","link":"https:\/\/www.boldgrid.com\/support\/page-builder\/create-block-structure\/","title":{"rendered":"How to Create BoldGrid Blocks &#8211; The Structure"},"content":{"rendered":"<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/REC-html40\/loose.dtd\">\n<?xml encoding=\"utf-8\" ?><html><body><p>While we include an extensive selection of Blocks you can use within your site in the <a href=\"https:\/\/www.boldgrid.com\/wordpress-page-builder-by-boldgrid\/\">WordPress page editor<\/a>, there is always going to be an instance where the look you envision is something that requires you to use a <b>custom Block<\/b> builder to fill the need. If you have a working knowledge of HTML and CSS, creating a Block of your own can be easily accomplished. This goal of this 3 part article is to familiarize you with how the <strong>Block structure<\/strong> works, <a href=\"https:\/\/www.boldgrid.com\/support\/?p=10492&amp;preview=true\">how to add content to a Block<\/a>, and <a href=\"https:\/\/www.boldgrid.com\/support\/?p=10494&amp;preview=true\">how to style the content with Custom CSS<\/a>.<\/p>\n<h2 id=\"the-boldgrid-block-structure\">The BoldGrid Block Structure<\/h2>\n<p>BoldGrid uses a grid system that is based on Bootstrap. To fully understand the structure and Grid System BoldGrid uses, we recommend you review the <a href=\"https:\/\/getbootstrap.com\/docs\/3.3\/\" target=\"_blank\" rel=\"noopener noreferrer\">documentation for Bootstrap 3.3<\/a>. We will provide an overview of what is needed to accomplish creating your own, but there are a lot of responsive utilities and classes within Bootstrap that can be used within your design.<\/p>\n<p>Since BoldGrid uses Bootstrap for a foundation, having a good knowledge of the predefined classes is essential to creating Blocks that behave as expected across different sized screens. The basic <b>structure of a Block<\/b> is shown below.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/harryjackson1221\/837b826b8a007ea106708cfba6db4f80.js\"><\/script><\/p>\n<p>BoldGrid requires a containing element to wrap site contents and house our grid system. When using <b>&ldquo;container-fluid&rdquo;<\/b>, the row is full width, whereas the class <b>&ldquo;container&rdquo;<\/b> indicates a fixed width, which would be dictated by the CSS being used in the theme you are using.<\/p>\n<h3 id=\"container-vs-container-fluid\">container vs container-fluid<\/h3>\n<p>A fluid container (aka container-fluid) is a container that takes up the full width. When you hear &ldquo;fluid&rdquo;, think of water. Pour water into a container and it will expand to the full width of the container. Container on the other hand, is a fixed width container that will be centered.<\/p>\n<p>Here are two screenshots that show the difference:<\/p>\n<div class=\"row\">\n<div class=\"col-md-6 col-sm-12\">\n<pre>&lt;div class=\"container-fluid\"&gt;<\/pre>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container-fluid.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-27775\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container-fluid.jpg\" alt=\"\" width=\"600\" height=\"262\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container-fluid.jpg 600w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container-fluid-300x131.jpg 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<\/div>\n<div class=\"col-md-6 col-sm-12\">\n<pre>&lt;div class=\"container\"&gt;<\/pre>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-27776\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container.jpg\" alt=\"\" width=\"590\" height=\"254\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container.jpg 590w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/11\/container-300x129.jpg 300w\" sizes=\"auto, (max-width: 590px) 100vw, 590px\" \/><\/a><\/p>\n<\/div>\n<\/div>\n<p>Here&rsquo;s a 3 minute video that explains the difference and shows you how to change this setting within the Post &amp; Page Builder:<\/p>\n<p><iframe loading=\"lazy\" title=\"container (CENTER) vs container-fluid (FULL WIDTH) settings in the BoldGrid Post &amp; Page Builder\" width=\"500\" height=\"281\" src=\"https:\/\/www.youtube.com\/embed\/RHT9KK_QFDA?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h2 id=\"the-content\">The Content<\/h2>\n<p>The content in a Block for BoldGrid should rest inside of columns that are within the 3 divs explained previously. Bootstrap uses a system of rows and columns for layout. Each row has a total column width of 12. This can be divided into one or more columns as illustrated here:<\/p>\n<p><a href=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-10475\" src=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem.png\" alt=\"\" width=\"1200\" height=\"591\" srcset=\"https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem.png 1200w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-300x148.png 300w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-768x378.png 768w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-1024x504.png 1024w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-250x123.png 250w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-550x271.png 550w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-800x394.png 800w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-365x180.png 365w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-609x300.png 609w, https:\/\/www.boldgrid.com\/support\/wp-content\/uploads\/2017\/10\/10467-01-gridsystem-1015x500.png 1015w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\" \/><\/a><\/p>\n<p>While Bootstrap does have an additional class larger than col-md-*, it is not used within the BoldGrid system since the need to break from &gt;1000 px is not required. Here is table with information about the three separate breakpoints included in the <b>Grid System for BoldGrid<\/b>.<\/p>\n<div class=\"table-responsive\">\n<table class=\"table table-bordered\">\n<thead>\n<tr>\n<th><\/th>\n<th>Extra small devices <small>Phones (&lt;768px)<\/small><\/th>\n<th>Small devices <small>Tablets (&ge;768px)<\/small><\/th>\n<th>Medium devices <small>Desktops (&ge;992px)<\/small><\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\">Grid behavior<\/th>\n<td>Horizontal at all times<\/td>\n<td colspan=\"2\">Collapsed to start, horizontal above breakpoints<\/td>\n<\/tr>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\">Container width<\/th>\n<td>None (auto)<\/td>\n<td>750px<\/td>\n<td>970px<\/td>\n<\/tr>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\">Class prefix<\/th>\n<td><code>.col-xs-<\/code><\/td>\n<td><code>.col-sm-<\/code><\/td>\n<td><code>.col-md-<\/code><\/td>\n<\/tr>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\"># of columns<\/th>\n<td colspan=\"3\">12<\/td>\n<\/tr>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\">Column width<\/th>\n<td class=\"text-muted\">Auto<\/td>\n<td>~62px<\/td>\n<td>~81px<\/td>\n<\/tr>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\">Gutter width<\/th>\n<td colspan=\"3\">30px (15px on each side of a column)<\/td>\n<\/tr>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\">Nestable<\/th>\n<td colspan=\"3\">Yes<\/td>\n<\/tr>\n<tr>\n<th class=\"text-nowrap\" scope=\"row\">Column ordering<\/th>\n<td colspan=\"3\">Yes<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<div class=\"alert alert-info\" role=\"alert\">While column offsets are a feature of Bootstrap, they should be avoided in BoldGrid content due to limitations in the Editor. The BoldGrid method of approximating a column offset is to add an empty Column of the size to be offset directly before the subsequent Column.<\/div>\n<p>The following code is an example of how to create a single full width content section in your Block, that will show full width on all devices, such as phone, tablet and desktop.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/jessecowens\/9d322803e291465db4a8af91f7a836ef.js\"><\/script><br>\nThe following code is an example of how to create a content section in your Block that will show 4 full width columns on your phone, 2 rows of 2 columns on your tablet, and 1 row with 4 columns on your desktop.<\/p>\n<p><script src=\"https:\/\/gist.github.com\/harryjackson1221\/25d365e35fe1ed79b16f27ff8a0ded92.js\"><\/script><\/p>\n<div class=\"alert alert-info\" role=\"alert\">To use BoldGrid Blocks, a BoldGrid theme is recommended, since they would include styles to support all the common elements used in Blocks: h1, h2, h3, h4, h5, h6, p, a, ol, ul, li, hr, img, blockquote, a:hover, a:focus, .button-primary, .button-secondary<\/div>\n<p>Congratulations! You now know how to create a basic BoldGrid Block, and how the <b>structure of a Block<\/b> is composed. Now its time to <a href=\"https:\/\/www.boldgrid.com\/support\/?p=10492&amp;preview=true\">add content to your Block<\/a><\/p>\n<\/body><\/html>\n","protected":false},"excerpt":{"rendered":"<p>While we include an extensive selection of Blocks you can use within your site in the WordPress page editor, there is always going to be an instance where the look you envision is something that requires you to use a custom Block builder to fill the need. If you have a working knowledge of HTML [&hellip;]<\/p>\n","protected":false},"author":529,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"bgseo_title":"How to Create BoldGrid Blocks - The Structure","bgseo_description":"","bgseo_robots_index":"index","bgseo_robots_follow":"follow","footnotes":""},"categories":[148],"tags":[],"class_list":["post-10467","post","type-post","status-publish","format-standard","hentry","category-page-builder"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/10467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/users\/529"}],"replies":[{"embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/comments?post=10467"}],"version-history":[{"count":29,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/10467\/revisions"}],"predecessor-version":[{"id":27778,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/posts\/10467\/revisions\/27778"}],"wp:attachment":[{"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/media?parent=10467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/categories?post=10467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.boldgrid.com\/support\/wp-json\/wp\/v2\/tags?post=10467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}