Create Content


After create a Content Type, you can see that Content Type in Top Menu under Content

For creating Content, you need to follow some steps:

1. Create Template through seeds.

Create a json file of name templates.json at VaahCms/Themes/BlogTheme/Database/Seeds/json/ this directory.

copy

You have to set blade file path in template.json file. The content link return to this Blade File. The data in the fields of that content show in that Blade file only.


├── BlogTheme ├── Database/ ├── Seeds/ ├── DatabaseTableSeeder.php ├── SampleDataTableSeeder.php ├── json/ ├── templates.json

To run this seed, you have to add some code in DatabaseTableSeeder.php file.

copy

Now, you just need to reactivate the theme by visiting this url:

<project-url>/backend#/vaah/themes/

Once, the theme is activated, Template will also be created

Now you can go to Blog page in Content and create a content for Blogs.

Fill out all fields in Create form. In Templates, you can see the data that you have been created through seeds. and this will decide which Blade file will open for that content.

In Templates, You can add some fields that means that fields are template specific and will be shown when you select that Template

Example:-

copy

You can also add author for this content.

Now, you need to copy the code by click on copy icon and paste it in a blade file. Remove the Hard Code from blade file and paste the CMS code in place of their. You can see the difference below.
copy

Now, You can see the content that you have input in Cms.