2 Nov 09:37
Re: _extends & _prototype
Michael Platzer <michael.platzer <at> knallgrau.at>
2006-11-02 08:37:45 GMT
2006-11-02 08:37:45 GMT
Jonathan Puckey schrieb: > Ack.. This isn't working in the way I wanted it to after all.. > When I restart my app and point to /Exhibitions/archive/2005/this-is- > the-title/, it uses the Page prototype and not the ArchivePage > prototype.. > And then sometimes it does use the right one.. Flakey at best! > > So I need a different approach, I guess.. > yes, using the inheritance-mechanism doesnt help you at all in your situation, since you are dealing with the same object. no matter how you access it via your URL. > What would be the best way to have the main.hac that is fired be > dependent on the collection that it resides in? > lets assume 'archive' is a Prototype named 'ArchiveMgr'. Then you could do the following: function main_action() { if (path.ArchiveMgr) { ... // we accessed the Page via the archive } else { ... // we accessed the Page directly } } hth, michi
RSS Feed