Topic: [ask] Page template from plugins directory

Hello..
I'm still learning the core of Monstra and I love the simplicity of it. I wanna make a plugins that require to load a template from my plugin directory. How could I do that?

I'm looking the code inside the core file of how the template rendered and found it was only load template from theme directory and the default index fallback.

Anyone has any suggestions? Thanks smile

Re: [ask] Page template from plugins directory

Check source code of this plugin for e.g. http://forum.monstra.org/topic/11/guestbook/

In Monstra two types of plugins:

1) Plugin Component that extends frontend class
2) Plugin "standalone"

"Plugin component" can use templates from  site themes directory

Monstra Loves You! Give some love back!

Re: [ask] Page template from plugins directory

I've give a try on it, but still have the problem. The guestbook still using dafault template from the theme. What I want is, completely using my own custom template, not one in the theme directory.

Re: [ask] Page template from plugins directory

        /**
         * Set Guestbook template
         */
        public static function template() {
            return Option::get('guestbook_template');
        }

        /**
         * Set Guestbook template
         */
        public static function template() {
            return 'index'; // or about or someone else template
        }
Monstra Loves You! Give some love back!