Feb. 16th, 2014

foxfirefey: A guy looking ridiculous by doing a fashionable posing with a mouse, slinging the cord over his shoulders. (geek)
[personal profile] foxfirefey
I'm pretty sure this is a question for the magnificent [personal profile] exor674, but here goes:

Let's say I convert the index page over to controllers/TT--it has two different versions, one for dw-free and one for nonfree!

How would one override the dw-free controller and/or template with the dw-nonfree one? What if one only needed to replace the template but not the controller, or visa versa?

ETA: Later I might try experimenting with detecting if a "home-local.tt" exists or whatnot, but my initial attempts at translating those pages with dw-nonfree are running into an interesting snag! Logged in it loads fine, logged out, there's some magical redirect that keeps happening until it goes boom. I'm trying to trace through the code to see where this is happening but no luck so far.

ETA2: Okay, the redirect was me forgetting to add anonymous => 1 to the controller call, woo! For the home page that sends it into a never ending loop of despair instead of being obvious. So far experimentation proves that putting a template with the same name in the dw-nonfree/views overrides dw-free/views, which is very good I think!

ETA3: Confirmed that just putting a new Home.pm controller in dw-nonfree/cgi-bin/DW/Controller does not override the dw-freecgi-bin/DW/Controller/Home.pm one. Going to try [personal profile] fu's suggestion of hooks to add in extra variable content to the template rendering!

Profile

dw_dev: The word "develop" using the Swirly D logo.  (Default)
Dreamwidth Open Source Development

July 2025

S M T W T F S
  12345
6789101112
13141516171819
20212223 242526
2728293031  

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Aug. 13th, 2025 08:29 am
Powered by Dreamwidth Studios