Skip to content

Commit

Permalink
fixing note issue
Browse files Browse the repository at this point in the history
  • Loading branch information
iruzevic committed Jan 26, 2024
1 parent 3fcb68b commit db2a1ca
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions website/blog/2023-09-05-wrapper-as-a-standalone-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ hide_table_of_contents: false
As one of the most powerful features in the Eightshift DevKit, the Wrapper is a part of every Eightshift block in the Gutenberg editor, but what about WordPress templates?
<!--truncate-->

:::Note
:::note
[Wrapper](https://eightshift.com/docs/basics/blocks-wrapper/) is designed to be the ultimate top-level component that controls how your block behaves in the website layout. It is a sort of a 'section' in traditional builders. By default, you can control a whole lot of stuff, but there is an option to add custom attributes and tailor the Wrapper to the needs of your project.
:::

## What are WordPress templates?

Before the days of [Full Site Editing](https://developer.wordpress.org/block-editor/getting-started/full-site-editing/) in WordPress, we used [template files](https://developer.wordpress.org/themes/basics/template-hierarchy/) to add custom layouts to a blog page or post archives.

:::Note
:::note
While Full-site editing (FSE) _is_ supported in Eightshift Libs, a couple of modifications have to be done in your project to make it work.
:::

Expand All @@ -30,7 +30,7 @@ Depending on your setup, you might still use those as they are still a core part

Thanks to the `Components` helper, we can easily `render()` any component in our template.

:::Note
:::note
Interested in how to use components in a block? Take a look at [our docs](https://eightshift.com/docs/basics/blocks-component-in-block#i-have-a-component-that-i-want-to-use-manually).
:::

Expand Down Expand Up @@ -72,7 +72,7 @@ use InfinumLibsVendor\EightshiftLibs\Helpers\Components;

If we look deeper into the `render` method, we'll see that for the `$component` parameter, we can pass the _component's name or the full path (ending with .php)_. We made it simple, so use `wrapper`.

:::Note
:::note
If you are upgrading from an older version (supported since [Libs v6.5.7] (https://github.com/infinum/eightshift-libs/releases/tag/6.5.7) and [Frontend Libs v8.6.2](https://github.com/infinum/eightshift-frontend-libs/releases/tag/8.6.2)) copy code from [wrapper.php](https://github.com/infinum/eightshift-frontend-libs/blob/develop/blocks/init/src/Blocks/wrapper/wrapper.php) into your project.
:::

Expand Down Expand Up @@ -100,7 +100,7 @@ echo Components::render(
true
);
```
:::Note
:::note
Setting the `$useComponentDefaults` to `true` will save you the trouble of setting a lot of additional properties by using default values defined in your manifest.
:::

Expand All @@ -117,7 +117,7 @@ To make the Card component look even better, we'll use some of the powerful prop
'wrapperSpacingBottomLarge' => 50,
```

:::Note
:::note
For the list of all available properties, look at the Wrapper's `manifest.json`.
:::

Expand Down

0 comments on commit db2a1ca

Please sign in to comment.