News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Invoke home screen from custom action

Started by DavidRMason, July 25, 2014, 10:19:09 AM

Previous topic - Next topic

DavidRMason

I want to create a custom action that doesn't paint a special screen - it just stores a value for future reference.

How to I get it to display the home screen?

I've tried loadTemplate('BoardIndex') which generates a display with header and footer, but without the list of boards.

(I'm following the guidelines on how to create a custom action in v2, and all works well until this point).

Do I need to set some variables to tell BoardIndex.Template.php what to do - if so what?

Help appreciated.

Arantor

You can't just load the board index template and expect it to work - you'd have to run all the other logic.

Normal behaviour in SMF for an action that saves data and then reverts to another page is to use redirectexit() to do a redirection, e.g. in your case simply redirectexit() to go back to the front page.


Advertisement: