Customizing SMF > Now Available

How to create custom 'action'

<< < (21/22) > >>

Tyilanmenyn:
Nice clean tutorial.

But I have an error somehow :|
I've created 2 pages, each with the exact same code. The first page works fine, but in the secpnd page I always get the error
--- Code: ---Unable to load 'main' template
--- End code ---
I've been searching around the forums and tried many solutions, but none fixed the error.

Anyone who can help me out? I can post the files if needed.

Thanks in advance,
Tyilanmenyn

Arantor:
Did you create a template file for your new action? Did you also call loadTemplate with the template's file name?

E.g. Newaction.template.php needs a matching loadTemplate('Newaction') call somewhere in the action's code.

MPKaboose:
I don't know why but only the header and menu appears nothing else :/

Mitii:
Hey,

Panels and code blocks don't work while I'm using that mod that you linked, anyone know some reason why? I've tried all the default blocks as well as my regular blocks. The action is set to HTML.

Secondly, I followed the tutorial to the letter but all it does is loop me back to my forum. I'm using my own custom theme, is there something specific I have to do along with that tutorial?

thellie:
arantor:
--- Quote ---Did you create a template file for your new action? Did you also call loadTemplate with the template's file name?

E.g. Newaction.template.php needs a matching loadTemplate('Newaction') call somewhere in the action's code.
--- End quote ---

but you only load once if the action has subactions? and it's called in function Main() ....?

i have a page with the main() function, my_function(), and some functions relating to subactions. then on the template page it calls the template_function of each one...

the template_main() comes in fine, but the others (maybe because they are php-coded, not html) come in above the automatic background (smf's header footer etc, which must be auto loaded as we are coming from index.php?action=xxx;sa=yyy)

any idea how i would get the subaction stuff to sit within the auto templates, and not above?

thanks

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version