Blogs

Installation of Spurtcommerce blogs Add-On

you can install this Add-on through following steps

step 1: Setup an API (Step By Step) to add extension for admin

step 2: Admin setup

step 3: you can easily install admin storefront with store setup. spurtcommerce provides 3 admin storefronts, built with Angular, Flutter and React.

About Addon :

The Installation of Spurtcommerce Blogs will enable the feature of creation of blog articles to the admin. The admin can add various blog articles. When the plugin is installed, the Multi-Vendor eCommerce site becomes ready for the admin to post blog articles and get them displayed for the visitors to read.

Features:

  • Create categories to map the blog article to make it specific to a particular area or field.

  • Easily create blog articles.

  • Provide title and body content for the blog article.

  • Add a relevant attractive image to the blog article. Then, add meta tags to blog articles to make it SEO friendly and searchable in the search engines.

For setting up the API, you need to execute the following steps:

  • Installing an extension

  • Run the application

  • Make the build

Step 1 : Installing an extension

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "blogs-addOn.zip". Extract the zip file, open api folder and open addon folder within that and copy the content of addon folder into the specified path.

Path - <PROJECT_ROOT>/addon

Step 2 : Run the application

After you have completed the installation of the above mentioned steps, you can run the application and also view the changes.

$ npm start serve

Once you execute the above command, add-on file will get integrated into the backend API.

Step 3 : Make the build

These are the steps that need to be followed for generating the build.

To run the below command

$ npm run build

Then latest built files can be deployed into the server.

These are the steps that need to be followed to do the front end admin setup.

  • Installing an extension

  • Update the configuration

  • Module Detail

  • Run the application

  • Make the build

Step 1 : Installing an extension

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "blogs-addOn.zip".

Extract the zip file and copy the content of admin/add-ons folder into the specified path

Path - admin/add-ons

Step 2 : Update the configuration

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce config files. For this, you need to follow the steps below.

update reducer config

Import below line into the add-ons/add-ons-reducer.ts

  Import below line into the add-ons/add-ons-reducer.ts
   import * as fromBlog from './cms/blogs/core/blogs-reducer/blog.reducer';
 
 import * as fromBlogCategory from
  './cms/blog-category/core/blog-category-reducer/blog-category.reducer';

Add the reducer into the below object

   blog: fromBlog.reducer,
                            blogCategory: fromBlogCategory.reducer

After adding its looks like below

export const AddOnReducers: ActionReducerMap<State> = {
    blog: fromBlog.reducer,
    blogCategory:  fromBlogCategory.reducer
};

Update State Config

Import below line into the add-ons/add-ons-state.ts

  import { BlogState } from './cms/blogs/core/blogs-store/blog.state';
import { BlogCategoryState } from './cms/blog-category/core/blog-category-store/blog.state';

Add the state into the below object

blog: BlogState;

blogCategory: BlogCategoryState,

After adding its looks like below

export interface AddOnAppState {
    blog: BlogState,
    blogCategory: BlogCategoryState,

}

Step 3 : Change the routing file(manage-blogs.routing.ts)

Inside the src/theme/default/admin/cms/components/manage-blogs/manage-blogs.routing.ts

Import below line

import * as CmsRouting from '../../../../../../../add-ons/cms/cms.routing';


  1. Add these routes below the cmsRoutes array

manageBlogRoutes.push(CmsRouting.CmsBlogRoutes[0]);

manageBlogRoutes.push(CmsRouting.CmsBlogCategoryRoutes[0]);

src/theme/default/admin/cms/components/header/header.component.hmtl

Below line no 88

 <a href="javascript:void(0)" [routerLink]="['/cms/manage-seo/category_seo']" [routerLinkActive]="'active'">
                               Category
                           </a>

<li [appHideIfUnauthorized]="'cms-blogs'" >
                           <a href="javascript:void(0)" [routerLink]="['/cms/manage-seo/blog_seo']" [routerLinkActive]="'active'">
                               Blog
                           </a>
                       </li>

Step 4 : Run the application

After you have integrated the Blogs Module into Spurtcommerce, you can use the following command to run the application.

 npm run large-serve

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

Step 5 : Make the build

To run the below command

 npm run large-build

Then the latest built files can be deployed into the server.

These are the steps that need to be followed to do the front end store setup.

  • Installing an extension

  • Update the configuration

  • Module Detail

  • Run the application

  • Make the build

Step 1 : Installing an extension

These are the steps that need to be executed for installation of the extension.

Usually spurcommerce comes packed in a zip, whose name ends in "blogs-addOn.zip".

Extract the zip file and copy the content of store-angular/add-ons folder into the specified path

Path - store-angular/add-ons

Step 2 : Update the configuration

After the installation of the extension, you will have to update certain configurations into the default Spurtcommerce config files. For this, you need to follow the steps below.

Update Reducer Config

Import below line into the add-ons/add-ons-reducer.ts

     import * as fromBlogs from './Blogs/core/reducer/blogs.reducer';

Add the reducer into the below object

blogs: fromBlogs.reducer,

After adding its looks like below

   export const AddOnReducers: ActionReducerMap<State> = {
      blogs: fromBlogs.reducer
         }


Update State Config

Import below line into the add-ons/add-ons-state.ts

   import { BlogsState } from './Blogs/core/reducer/blogs.state';
 

Add the state into the below object

    blogs: BlogsState;

After adding its looks like below

export interface AddOnAppState {
    blogs: BlogsState;
}

Step 3 : Update Default routing file(default.routing.ts)

Inside the src/default/default.routing.ts

Import below line

import * as blogRouting from '../../add-ons/Blogs/blogs.routing';

Add the blog routes in below the routes array

routes.forEach(data => {
  if (data && data.children) {
    console.log('data is',data.children);
    data.children.push(blogRouting.BlogsRoutes[0]);
  }
});

Step 4 : Run the application

After you have integrated the Blogs Module into Spurtcommerce, you can use the following command to run the application.

 ng serve

Once you execute the above command you can view the installed module in Spurtcommerce, within the page in which you have integrated.

Step 5 : Make the build

To run the below command

 ng build –prod

Then the latest built files can be deployed into the server.

Last updated