Creating a new template


#1

I have a template, How can I use it for my website use reaction? In Customization Guide - Creating a new theme, I only know how to edit css but html is not.
Thank you.


#2

Yes, same concern here, no docs about create a new template.


#3

Templates in Reaction are just BlazeJS templates. What sort of docs were you looking for specifically?


#4

Yes, you are right, I have a problem in my pc, or my connection, I was not able to read all the online docs, Fixed that, I could follow the tutorial, and I did create my first custom template! :slight_smile:


#5

Great. Glad to hear it.


#6

Not so good :frowning:

https://github.com/reactioncommerce/reaction-example-plugin/issues/8

Same concern I commented in the chat.


#7

Update: with reaction-example-plugin is working now, with my plugin from scratch (following the doc instructions) the problem persist.


#8

In /server/init.js:

 /**
     * Hook to make additional configuration changes
     */
    Hooks.Events.add("afterCoreInit", () => {
      modifyCheckoutWorkflow();
      addRolesToVisitors();
      changeLayouts(Reaction.getShopId(), "coreLayoutBeesknees");
    });

May be is the key to my problem?


#9

Hello, I started acquaintance for Reaction and I try to create our plugin / template.
I read the docs but there is little information :slight_smile: I took as in example custom plugin and create our plugin.
I have same file structure and minimum front-end code. Now I need to see only “Hellow World!”, but I see white, blank page. My plugin doesn’t include layouts.
Maybe it needs to be set up additionaly?
My register.js have strings:

import { Reaction } from "/server/api";

Reaction.registerPackage({
  label: "Commerce Theme",
  name: "commerce-theme",
  autoEnable: true,
  layout: [{
    layout: "coreLayoutcommercetheme",
    workflow: "coreProductGridWorkflow",
    collection: "Products",
    theme: "default",
    enabled: true,
    priority: 1,
    structure: {
      template: "commerceProductsLanding",
      layoutHeader: "layoutHeaderCommerceTheme",
      notFound: "productNotFound",
      dashboardHeader: "",
      dashboardControls: "dashboardControls",
      dashboardHeaderControls: "",
      adminControlsFooter: "adminControlsFooter"
    } }
  ]
});