Please upgrade here. These earlier versions are no longer being updated and have security issues.

Google calendar iFrame integration

Hello,

Can someone tell where should I put the code

to see the widget on my forum ?

Thanks for your help ;)

Comments

  • Ok I've read the custom theme documentation and now I can see my calendar.

    But what I would like to do is a link in the default-master.tpl to a new page design with the iframe.

    Can you help me please ?

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    I'm not really sure what your question is. If you only want to know how to add a link, I would use the custom menu for it. If you have read about custom themes, you should have come across the themehooks file. Put this in your themehooks file to add a menu entry:

    public function base_render_before($sender) {
        if ($sender->Menu) {
        // Use this instead, if it should be visible only for logged in users
        // if ($sender->Menu && Gdn::session()->isValid()) {
            $sender->Menu->addLink(
                '',
                t('Google Calendar'), // The text of the link.
                '/your/page' // The link to your page.
            );
        }
    }
    


    hgtonight
  • Thanks for your help.

    I've added the hooks (class.themehooks.php) in my theme folder but I don't understand why I have now a blank page ?

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    Blank page only means "something" is wrong. I would guess your themehooks file is malformed. If my code example is the only content, it should look like that:

    <?php
    class YourThemeNameThemeHooks implements Gdn_IPlugin {
        public function setup() {
            return true;
        }
    
        public function base_render_before($sender) {
            if ($sender->Menu) {
            // Use this instead, if it should be visible only for logged in users
            // if ($sender->Menu && Gdn::session()->isValid()) {
                $sender->Menu->addLink(
                    '',
                    t('Google Calendar'), // The text of the link.
                    '/your/page' // The link to your page.
                );
            }
        }
    }
    


    hgtonight
  • Ok it works !

    Thanks a lot for your help ;)

    R_J
Sign In or Register to comment.