News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

How to create custom 'action'

Started by Owdy, January 09, 2005, 05:01:30 PM

Previous topic - Next topic

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 Unable to load 'main' template 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 :/
//MPKaboose

Mitii

#103
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:
QuoteDid 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.

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
If you have any support questions, feel free to ask - be safe in the knowledge that I won't help because... I know nothing!

fadmafia

how to have smf 2.0 rc4 redirect the poster back to the last post ?
i have lots of questions to have it in there but dont know how to..... thanks

Advertisement: