Advertisement:

Author Topic: How to create custom 'action'  (Read 210033 times)

Offline Tyilanmenyn

  • Newbie
  • *
  • Posts: 8
Re: How to create custom 'action'
« Reply #100 on: January 28, 2010, 02:31:23 AM »
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: [Select]
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

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 68,047
    • Arantor on GitHub
Re: How to create custom 'action'
« Reply #101 on: January 28, 2010, 04:18:31 AM »
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.
To assume is to hope that those who came before had the presence of mind and capacity to implement the dreams of those who would come after.

You either die a hero or live long enough to see yourself become the villain. It seems you have chosen which, and now I must do the same.

Offline MPKaboose

  • Semi-Newbie
  • *
  • Posts: 30
  • Gender: Male
    • NCRPandU
Re: How to create custom 'action'
« Reply #102 on: February 25, 2010, 12:47:29 PM »
I don't know why but only the header and menu appears nothing else :/
//MPKaboose

Offline Mitii

  • Semi-Newbie
  • *
  • Posts: 24
Re: How to create custom 'action'
« Reply #103 on: April 10, 2010, 03:57:54 AM »
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?
« Last Edit: April 10, 2010, 04:07:03 AM by Mitigation »

Offline thellie

  • Semi-Newbie
  • *
  • Posts: 88
  • Gender: Male
Re: How to create custom 'action'
« Reply #104 on: September 12, 2010, 06:28:37 PM »
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.

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!

Offline fadmafia

  • Newbie
  • *
  • Posts: 2
Re: How to create custom 'action'
« Reply #105 on: December 07, 2010, 12:15:34 PM »
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