A useful resource segment can proportion one advent throughout a number of pages whilst presenting other content material underneath it. Reusing each the segment and its playing cards allows you to deal with the ones designs one by one.
With Components and Slots in Divi 5, you’ll be able to mix the ones two ranges of reuse. Put a card Part within a Slot belonging to a bigger segment Part. The segment controls its shared construction, the cardboard controls its personal shared design, and each and every web page example provides its content material.
We’ll construct a pine-green useful resource assortment with peach playing cards, outsized serif headings, and editorial pictures. Its first example accommodates two useful resource playing cards. Its 2d accommodates a tick list card beside a publication block. All 3 playing cards stay hooked up to 1 card supply.

How Elements Within Slots Paintings
A Part has a stored supply and hooked up circumstances. The supply defines the settings the ones circumstances proportion. A Slot supplies a spot for an example’s personal kid components inside that shared construction. The ones youngsters can come with some other Part, which keeps its connection to its personal supply.
Our instance has 3 modifying scopes:
- The outer Useful resource Assortment supply controls the pine background, shared advent, divider, useful resource Row, and Slot positions.
- The interior Useful resource Card supply controls the picture remedy, peach floor, spacing, corners, typography, and button styling.
- The web page example controls what seems within Left Content material and Proper Content material, together with each and every card’s authorised content material overrides.
The 2 Slots make this difference visual. A right-hand card can also be changed with an atypical publication Staff in a single example with out changing the outer Part.
Obtain And Import The Starter Format
Obtain the information beneath and unzip the package deal. It features a starter structure, a accomplished structure for comparability, and the 3 full-size duvet pictures.
Use nested-components-starter.json to apply the educational. It accommodates the styled pine-green Segment, its header and two-column useful resource Row, and one atypical useful resource card Staff. It accommodates no stored Elements or Slots, so you’ll be able to create each assets your self.
- Create a brand new web page and allow the Divi 5 Visible Builder. Use a clean web page if you wish to have the instance with out your website’s header and footer.
- Open Import & Export from the Web page Menu, or press Ctrl + Shift + P. Choose the Import tab.
- Select nested-components-starter.json. Allow Substitute Current Content material solely in this new apply web page, then click on Import Divi Builder Format.
- Look forward to the imported design to seem and save the web page. Make bigger its Layers to find the prevailing card Staff within the left useful resource Column.
For the finished instance, import nested-components-finished.json on a separate web page with Import Elements enabled. This imports the hooked up segment and card assets together with their native Slot content material. Use the starter document for the walkthrough beneath.
Get ready The Pine-Inexperienced Base Design
Open your web page within the Divi 5 Visible Builder. Use the stacked-layers icon within the left sidebar to open Layers. Make bigger the arrows beside components to check out their youngsters.
The imported starter already has the next base design. If you’re development your individual model, get started with a typical Segment containing two Rows. The primary Row is the shared header. Use a much broader left Column for a small label and a big Heading, and a narrower appropriate Column for the outline. Upload a skinny divider underneath this Row. The second one Row accommodates two equivalent Columns for the assets.
Upload a brief introductory label, a outstanding Heading, and a temporary description suited in your useful resource assortment.
Stay the design accomplished prior to turning it into Elements. Those are the primary visible settings used right here:
- Segment: Pine inexperienced #073E31, with beneficiant vertical spacing.
- Rows: 90% width and a 1200px most width, with 24px between useful resource columns.
- Header: Cream textual content, a big Georgia Heading, and a delicate cream divider.
- Card: Peach #F4B899 to start with, with 4px corners and a picture flush with its edges.
- Card content material: 24px aspect spacing, about 14px between components, and darkish inexperienced textual content.
- Card symbol: Complete-width panorama paintings with a constant 3:2 crop.
- Card button: An underlined textual content hyperlink.
At telephone widths, stack the header Columns and useful resource Columns vertically. Let headings scale down and make allowance descriptions to wrap naturally. Stay the cardboard styling at the card Staff and its youngsters; the outer Segment must provide the body round the ones playing cards.
1. Save The Internal Useful resource Card
If you happen to imported the starter, use its current card Staff; don’t upload a 2d card. If you’re ranging from scratch, choose the left useful resource Column and open Content material > Components > Upload Component. Select Staff, then use that Staff’s personal Components record so as to add those 5 modules so as:
- An Symbol module for the useful resource paintings.
- A Textual content module for the class label.
- A Heading module for the useful resource name.
- A Textual content module for a brief useful resource description.
- A Button module linking to the useful resource.
Practice the cardboard design to this Staff. Stay its outer padding at 0 so the picture reaches the perimeters, then give the textual content and button their inset spacing. Use full-size paintings fairly than a small thumbnail, and provides each and every useful resource symbol an acceptable textual content selection.
Choose the whole Staff in Layers. Open the Part menu beside its identify and make a selection Save as Part. Identify it Useful resource Card, stay Save As Part enabled, and click on Save To Library.

Disclose The Card Content material That Can Range
Open Elements from the left sidebar, extend Staff, and click on the pencil beside Useful resource Card. This opens its supply settings and Part Preview.
Within the supply Staff’s Content material > Components record, use the Symbol module’s pencil to open its settings. Make bigger Content material > Symbol and use the sector keep watch over categorized Make this box editable on part circumstances.
Go back to the Staff the usage of the settings breadcrumbs. Open each and every final kid with its pencil and reveal those fields:
- Class Textual content: Open Content material > Textual content and make Frame editable.
- Heading: Open Content material > Textual content and make Heading editable.
- Description Textual content: Open Content material > Textual content and make Frame editable.
- Button label: Open Content material > Textual content and make Button Textual content editable.
- Button vacation spot: Open Content material > Hyperlink and make Button Hyperlink URL editable.
Go back to the basis Staff the usage of the settings breadcrumbs prior to saving. Stay the cardboard’s design settings synchronized. Depart the cardboard Staff’s general kid assortment shared as smartly; we wish circumstances to modify the content material inside this fastened five-module construction. Save the supply and ensure the site-wide replace.

An uncovered box can proceed inheriting its default till an example receives an area worth. Making the Heading editable permits some other card to make use of its personal name whilst protecting the supply Heading’s design.
2. Save The Outer Useful resource Assortment
Shut the supply editor. Take away the brief card placement from the useful resource Column whilst preserving the stored Useful resource Card supply. If you happen to created a 2d atypical card whilst refining the design, take away that placement too. Stay each useful resource Columns and the completed header.
Choose the outer Segment in Layers. Select Save as Part from its Part menu, identify it Useful resource Assortment, stay Save As Part enabled, and click on Save To Library.
You presently have two separate assets: one for the complete segment and one for the cardboard. Subsequent, give the segment designated puts as an example content material.
3. Upload Two Slots To The Segment Supply
Within the Elements sidebar, extend Segment and click on the pencil beside Useful resource Assortment. In its supply Content material > Components record, open the second one Row the usage of its pencil. Open that Row’s left Column via its Components record.
Beneath the Column’s Content material > Components, click on Upload Component and make a selection Slot. The Slot belongs within the useful resource Column, underneath the shared header Row.

Within the Slot’s settings, open Content material > Meta > Component Label and input Left Content material. Beneath Content material > Components, use the synchronization keep watch over categorized Make kid components editable on part circumstances. Depart the supply Slot empty.
Go back in the course of the breadcrumbs to the useful resource Row, open its appropriate Column, and repeat. Identify this Slot Proper Content material and allow its kid assortment as an example modifying too. Go back to the basis Segment the usage of the settings breadcrumbs, then save and ensure the supply adjustments.

Stay each Slots clear and freed from card-style padding. Their youngsters provide their very own surfaces and interior spacing. Within the outer supply preview, the shared header stays visual whilst the useful resource Slots don’t have any native youngsters.
4. Position Hooked up Playing cards Within The Native Slots
Shut the supply editor and choose Left Content material underneath the web page’s Useful resource Assortment example in Layers. Open the Slot’s personal Content material > Components record and click on Upload Component.
In New Module, seek for the precise identify Useful resource Card and choose its stored Part tile. Repeat from the native Proper Content material Slot to position the second one card.

Test the position prior to modifying. Layers must display Segment > useful resource Row > Column > Left Content material > Staff, with the cardboard Staff indented underneath the Slot. The Staff’s Part controls must establish Useful resource Card as its supply.
A Staff on the identical indentation because the Slot is a sibling, no longer its kid. The use of the Slot’s Components record avoids this ambiguity. If that record is unavailable in example mode, revisit the Slot within the outer supply and allow kid modifying.

5. Give Each and every Card Its Personal Content material
Stay the left card’s supply content material. For the appropriate card, extend Proper Content material > Staff in Layers. Double-click each and every kid module to open its example settings and replace:
- Symbol: The web site-planning computer paintings from the incorporated pictures folder. Add it to the Media Library and choose Complete Dimension.
- Class: Exchange the class label to check the useful resource.
- Heading: Exchange the useful resource name.
- Description: Upload a brief description of the useful resource.
- Button Textual content: Modify the decision to motion as wanted.
- Button Hyperlink URL: Your website-planning useful resource vacation spot.
Those edits belong to the nested card example. Don’t open the shared supply simply to modify this card’s name or symbol.

The demonstration makes use of placeholder anchor hyperlinks. Substitute them with actual useful resource URLs, or create matching anchor goals, prior to the usage of the web page for navigation.
6. Create A Other Composition In A 2d Example
In Layers, right-click the hooked up Useful resource Assortment Segment and make a selection Reproduction Segment to create a 2d example. Duplication carries its present native Slot content material with it, so overview each Slots prior to converting the composition.

In the second one example’s left card, trade the class label, name, and outline to introduce a distinct useful resource. Substitute the picture with the full-size tick list paintings and replace the useful resource hyperlink.

Choose the second one example’s Proper Content material Slot. In its personal Components record, take away the copied card placement. This eliminates that native kid with out deleting the stored card supply.
Create an atypical Staff for the publication content material. Upload a Heading for the signup name, a Textual content module with a brief description, and your shape. Use cream textual content in opposition to the pine background and a peach post button; stay the Staff’s background clear.
Use Proper Content material > Content material > Components > Upload Component > Staff to create the container. Open that Staff’s personal Components record so as to add its Heading, Textual content, and shape. If you happen to reuse an current publication Staff, insert it within this Slot and test that Layers presentations Proper Content material > Staff > Heading, Textual content, Touch Shape.

To breed the illustrated shape, upload a Touch Shape module within the publication Staff. In its Components record, take away the Identify and Message fields and stay one E mail box. Set that box’s sort to E mail, give it a transparent e-mail label, and set its width to complete width. Select an acceptable signup label for the post button. Taste the sector with a clear background, a delicate cream border, and cream textual content. Give the button a peach background and darkish inexperienced textual content. In Telephone settings, make the sector and post button complete width in order that they stack.
The illustrated shape makes use of an email-only Touch Shape module to turn the structure. It’s not hooked up to a publication mailing record. For a operating signup, configure an acceptable E mail Optin integration and its supplier prior to accepting subscriptions.
The outcome demonstrates the aim of the Slots: the primary segment holds two hooked up playing cards, whilst the second one holds one hooked up card and an area publication Staff. Each sections retain the similar outer supply.
Open Elements > Staff within the sidebar and click on the pencil beside Useful resource Card. Use this supply access level when updating the reusable design.
Beneath the supply Staff’s Content material > Background, trade Background Colour from #F4B899 to the lighter peach #F6C4A8. Stay this box shared. Save, then ascertain the message that the trade will replace circumstances around the website.

Save the web page and reload its entrance finish. All 3 hooked up playing cards must use the brand new peach floor. Their other pictures, classes, titles, descriptions, and hyperlinks must stay intact. The native publication Staff must retain its personal look.
The shared segment and card stay separate repairs issues. Use Useful resource Assortment for the encircling construction, Useful resource Card for the cardboard design, and web page example settings for the native content material. Detaching a Part breaks that connection, so stay the circumstances hooked up for this case.
Supply edits use the ground Part Save button and its affirmation. Native Slot content material and card overrides use the web page’s top-right Save button. Save each contexts when your paintings contains each sorts of trade.
8. Test The Stored Format On Smaller Monitors
Use the builder’s tool controls to test each Pill and Telephone previews. Investigate cross-check a slender telephone width equivalent to 390px. Test the complete structure, no longer solely the primary card: the header must stack, useful resource playing cards must fill their columns, and the publication must apply the tick list card in the second one example.

Verify that headings and outlines wrap with out horizontal overflow, pictures stay sharp, and the shape box and button have relaxed widths. Save the web page, reload the entrance finish, and test that each native compositions continue to exist the reload.
Construct Versatile Layouts With Nested Elements
Our useful resource assortment combines a shared segment with reusable playing cards and native publication content material. The outer Part maintains the body, its Slots make room for various compositions, and the nested playing cards stay their very own shared design.
Get started with a bit you reuse, establish the spaces that want other modules, and upload named Slots to these spaces. Position hooked up Elements within them when the ones smaller components must proportion long run design updates. For extra examples, discover our guides to Components and Slots in Divi 5.
The put up Components Inside Of Components Using Slots seemed first on Elegant Themes Blog.






0 Comments