We need the component to
conditionally use a different Layout when the user looks at Event Details. There's actually more to the conditions, but for the sake of discussion, when the Event is underway or has passed, then the component needs to load my new Layout called "PastEvent" instead of "default". Also, because we use the component on the homepage, whenever a link to the event is clicked, it uses the Itemid for the homepage. I think I understand why this happens (though it's less than ideal), but i'm hoping that the entirety of my question resolves this as well.
I understand that I can modify the Default layout, but the needed PastEvent layout is so very different and relies on quite a few external variables, that it warrants being separate.
Also, when defaulting to the homepage Itemid, we get all the modules, and other Homepage "things" that should not be showing while viewing a single Event. I have a menu item that is for viewing a single Event, and hoped/assumed that the component would find/use that Itemid . I've seen that you can specify a different Itemid in the modules, but I don't see that parameter for the component.
So...
- Where/How do I make a code change that will choose the Default or my new PastEvent *layout* based on the event dates
- If the link to the event includes "view=event" and there is a menu item *with* that view, use *that* Itemid instead of the one from the page clicked from (in my case, the home page)
I know there are a number of ways to hack in the Itemid, but the native code for your component is so clean, i don't want to pollute it with my hacking around trying make sure I've forced it everywhere it might be needed. :S
I've looked specifically at these two files, and started to realize that i wanted your expert opinion before hacking around:
route.php (doesn't seem to consider Layout in it's selection logic of the preferred Itemid)
Code:
public static function findItem($needles = null, $itemId = 0)
controller.php (I'm not clear if this is where I would specify a task somewhere to trigger something in the switch/case
Code:
function display( )