Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

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 Ex-Fanboy Munich Admin

    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.
            );
        }
    }
    
  • 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 Ex-Fanboy Munich Admin

    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.
                );
            }
        }
    }
    
  • Ok it works !

    Thanks a lot for your help ;)

Sign In or Register to comment.