question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Registering custom template using new plugin architecture

See original GitHub issue

Hello

I’m trying to register a custom template using the new plugin architecture.

import {Formio} from "react-formio";
import myTemplate from '@digitalpatterns/my-template';
Formio.use(myTemplate);

However the template is not being applied. When i try to debug I see the following:

Screenshot 2019-10-22 at 10 50 04

The above looks ok in that i got my template…

Screenshot 2019-10-22 at 10 50 20 Screenshot 2019-10-22 at 10 50 34

The above shows that key is actually the index for example 0, 1.

@randallknutson Have you seen this when using the semantic template?

Edit: After making a small change to the formiojs code locally i over came the issue with key being ‘0’ by doing:

Object.keys(plugin).forEach(key => {
...
}

However what i am noticing is: Screenshot 2019-10-22 at 11 32 22 Screenshot 2019-10-22 at 11 32 40

the default template hasn’t is null.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
randallknutsoncommented, Oct 22, 2019

Okay. I pushed up an updated branch. Still working on it but it should work better now. I’ll have more by the end of the day.

0reactions
aminmccommented, Oct 23, 2019

This is working now. thanks @randallknutson

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add Page Templates to WordPress with a Plugin - WPExplorer
A look at the code you need to dynamically create WordPress Page Templates directly through PHP without having to access the theme itself....
Read more >
Tutorial: Write and register a plug-in - Microsoft Learn
Create a Visual Studio project for the plug-in. Open Visual Studio and open a new Class Library (.NET Framework) project using .
Read more >
WordPress Plugin Development Best Practices: Template Files
However, Easy Digital Downloads looks for customized templates in a directory called EDD_Templates in the theme root directory. This name can be ...
Read more >
Plugin Architecture - The simpler media website CMS
These plugins let Zenphoto developers provide choices for how the particular feature is handled. The folder residence is the same as for Template...
Read more >
How to package up your custom blocks in a plugin (Part 2)
Move the register / configure code for our custom block to the plugin; Move the template files; Change where (custom file path) Genesis...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found