Bigcommerce Stencil custom handlebars helpers - bigcommerce

Is it possible to write custom handlebars helpers to use within Stencil templates? If so, where should they be defined? Is there an example somewhere within the documentation?

How/Where to use Custom Handlbars Helpers in Stencil?
All the helpers are predefined that can be used with Stencil "natively". If you'd like to register your own, you'd need to include handlebars as apart of your theme and create them clientside.

Related

Vuetify - how to disable Display Helpers in a custom build?

Some of Vuetify's display helpers (https://vuetifyjs.com/en/styles/display/#display) collide with Tailwind classes.
In Bootstrap, fore example, there's a way to disable (=not include) utility classes in a custom build.
Searched in the docs and in vuetify-loader's docs for a way to do it, couldn't find one - is it possible?
I found this article that helped me remove some of the Display helpers (utility classes) from Vuetify. Over here you can see all the available utilities you can disable.
While I'm not aware of any way to disable Vuetify's Display Helpers, it is possible to prevent collision by prefixing Tailwind's classes. You can read about it in this thread on Tailwind's GitHub.

Big commerce add active class using handlebar

I am using the cornerstone theme and I need an active class for the current navigation. I have used the jQuery and javascript but I want to use the handlebars HTML template engine.
Yes, It is possible to Handlebar.
You can put {{is_active}} in navigation iteration loop in handlebar.
{{#if is_active}}active{{#if}}

Where can I put a Django custom template tag to get it used by a customised Django admin template?

I have a customised version of base-site.html which is kept in templates/admin.
I would like to use a custom template tag in base-site.html.
Normally I would put a custom template tag in a templatetags package within an app.
In this case, the template is rendered for the admin app, which is outside of my source tree.
Where should I put a custom template tag, so that the admin app uses it when rendering my custom base-site.html?
I just put the custom template tag in with all the application custom template tags and it worked without any trouble.

Stencil - How are new fonts added?

How or where is this variable defined in stencil?
{{ getFontsCollection }}
I'm hoping to include other google fonts in the theme. Are they automatically included if they are listed in schema.json?
According to the Stencil Docs, getFontsCollection is a handlebars injection helper function used to help you load the resource on the page:
{{getFontsCollection}}
The getFontsCollection helper is custom to Stencil. It returns a link tag that loads all selected font collections. It takes no parameters.
The helper method pulls from your global getThemeSettings() which are located in your config.json file. Look for the primary-font and secondary-font fields
"settings": {
"primary-font": "Google_Lato_700,400,300",
"secondary-font": "Google_Droid+Serif_400italic,400,700",
...
}
They are added via the config file

What is the difference between <compose> and <require> in Aurelia?

In learning the awesome Aurelia framework, I have learnt that you can use the following composition techniques however I am not sure what would be the difference.
<compose view="./nav-bar.html"></compose>
or
<require from="./nav-bar.html"></require>
Any clarification is appreciated.
<require> imports resources that you want to use in the view. It's conceptually similar to a require() JavaScript call in AMD or CommonJS module code (or an import statement in ES6 code). You would use <require> to import a custom element or custom attribute that you wanted to use in your view. You'll still need to explicitly render it like <nav-bar></nav-bar>.
<compose> renders the specified view.
We will use already created templates in our app and we need to use in the current app via require.
you can use css and javscript files also in require.
But from compose you can render your views by giving your view modal name.
You can see this link to have a better idea about compose.
http://patrickwalters.net/best-parts-of-aurelia-1-composing-custom-elements-templates/