I have php code for a small custom menu (I've done this as one of the menu items only needs to show on node pages, and another for a specific view page) but I'm pretty confused about how to go about getting this to display on my page (I want it in the sidebar only when a user is logged in). I see options like this:
1) Add a block with php code straight in the block, then place it on page via context (this works but is it a good idea to have php in blocks?)
2) Put it in a function in template.php (and then do you need to call that in the template page i.e. page.tpl.php??)
3) Make a module which creates this block, then place it on page via context
I can't make head nor tail over template.php/process/preprocess/hooks and finding a straightforward guide that explains these things is proving to be difficult. Is this something that is even done in the theme itself?
Some advice would be extremely helpful! Thanks.