Blocks are the boxes of content that are displayed in Layout Regions (such as footer or sidebar) on your page. For more details, see CMS Blocks's documentation
For creating block, you need to follow some steps:
1. Create Location through seeds.
Create a json file of name
VaahCms/Themes/BlogTheme/Database/Seeds/json/ this directory.
├── BlogTheme ├── Database/ ├── Seeds/ ├── DatabaseTableSeeder.php ├── SampleDataTableSeeder.php ├── json/ ├── theme_locations.json
To run this seed, you have to add some code in
Now, you just need to reactivate the theme by visiting this url:
Once, the theme is activated, Location will also be created.
2. Create a Block.
To create Block, visit this url:
- Enter the name
- Select Theme
- Select Location
- Enter Sort in number, this will work when you call blocks by location name.
- Enter content in Editor. You can edit in HTML Editor also.
- Click on Save button.
Blocks will be fetch on frontend by two Codes:
By Block slug
By Location name
You have to paste these codes in Web Pages.
Now, you can copy this code and paste it in home blade file. Remove hard code of logo.
Now, You can see the Cms Block.