I have created my own extension and modules. I can view the modules fine, by going to their URL. However, now I want to embed them on a page, much like a content class. How do I go about doing that?
But if you want to display anything related to your module, you should declare that your extension contains some templates and override some templates.
Let's say that you would like to make your own register module.
Step 1, you may have to add this in your_extension/settings/design.ini.append.php :
So you are now able to add your own user/register.tpl
This template contains a form like this :
<form action={'/user/register'|ezurl}...
So you just need to copy the template but with :
<form action={'/your_module/register'|ezurl}...
Now let's say that your template is supposed to display some informations related to your module. You may have to define some fetch functions so you would be able to write something like this:
{def $nb = fetch('your_module','beta_accounts')}
<h2>Hurry up! There are only {$nb|wash} available accounts for free!</h2>
<form action={'/your_module/register'|ezurl} method="POST">
...
</form>
It is not possible to "embed" a module in a page except if the module which is called do it at the PHP level.
For instance, it's possible to write this :
But if you want to display anything related to your module, you should declare that your extension contains some templates and override some templates.
Let's say that you would like to make your own register module.
Step 1, you may have to add this in
your_extension/settings/design.ini.append.php
:So you are now able to add your own
user/register.tpl
This template contains a form like this :
So you just need to copy the template but with :
Now let's say that your template is supposed to display some informations related to your module. You may have to define some fetch functions so you would be able to write something like this:
I hope that it will help...