Custom Block Template Controller

Permalink 1 user found helpful
Where can I put a custom controller so that it only affects one template and not all?

I'm customizing a Autonav template that needs a different controller, but I want the other templates to continue using the default controller.
If I put the modified controller in Blocks > Autonav > Templates > TemplateNameFolder
it gets ignored. It only works if I put it in Blocks > Autonav but then it will affect all templates which is not good...

What's the solution for this?
Should be simple but I'm not seeing it..

Thanks

ESKEMA
View Replies: View Best Answer
Steevb replied on at Permalink Reply
Steevb
What are you trying to achieve with the new controller?
ESKEMA replied on at Permalink Reply
ESKEMA
What I'm trying to achieve is not really the point.. I can make the controller work with a all my templates just fine (I'm just invoking more custom classes, nothing too drastic).
It's about the principle.. If I were to make more drastic changes to the controller that would really affect the other templates, how would I go about it? Is it possible to have different controllers for different templates? Or does the controller have to be unique?
Steevb replied on at Permalink Reply
Steevb
You do mean controller.php, not view.php?
ESKEMA replied on at Permalink Reply
ESKEMA
yes
cyandesigns replied on at Permalink Reply
Was just looking for the same answer - did you figure this out?

-cy
JohntheFish replied on at Permalink Best Answer Reply
JohntheFish
Its a shame, but the only way to have a custom controller is to override the controller globally for the block type.

If you want a custom controller and a custom template, it usually makes more sense to create a completely new block type by copying from the existing block type.
cyandesigns replied on at Permalink Reply
That's disappointing - I thought I was just not putting the new controller in the right place.

Thanks for the help!