Yup, this might be an interesting feature, but how easy or hard is to implement?

It's simpler, than you might imagine!

Create a function somewhere in your component:

function templatechanger($templatename) {
global $mainframe;
$mainframe->setTemplate = $templatename;
}

Then where you want to call it, initialize the variable, for example like:

$my_templatename="my-template-name";

and call the function:

 templatechanger($my_templatename);

Simple enough?

    Category: Component hacks

    Tags cloud

    ... also in this category