move Newsletter Subscriptions

Discussion in 'Customization & add-ons' started by ccwjames, Apr 6, 2016.

  1. ccwjames

    ccwjames Member

    Joined:
    Sep 11, 2014
    Messages:
    430
    at present is far bottom left
    can i move to under usefull links?
  2. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    It is possible to do with the following code in site.php file (http://www.amember.com/docs/Site.php_file)
    Code:
    Am_Di::getInstance()->blocks->remove('member-main-newsletter');
    Am_Di::getInstance()->blocks->add(new Am_Block(array('member/main/right', 'unsubscribe'),
        ___('Newsletter Subscriptions'),
        'member-main-newsletter', Am_Di::getInstance()->modules->loadGet('newsletter'),
        'member-main-newsletter.phtml', Am_Block::MIDDLE));
  3. ccwjames

    ccwjames Member

    Joined:
    Sep 11, 2014
    Messages:
    430
    thanks a lot and how do i get rid of the support part at top with the two drop downns for helpdesk and faq and just have helpdesk and faq at top?
  4. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    Do you mean you want to get rid of drop down menu and just use two separate items in top level menu?
    In this case you can use this code in site.php:
    Code:
    Am_Di::getInstance()->hook->add(Am_Event::USER_MENU, function(Am_Event $e) {
        $m = $e->getMenu();
        if ($p = $m->findOneBy('id', 'helpdesk-root')) {
            $_ = $p->toArray();
            $m->removePage($p);
            $m->addPages($_['pages']);
        }
    });
  5. ccwjames

    ccwjames Member

    Joined:
    Sep 11, 2014
    Messages:
    430
    yes so a button saying helpdesk and one saying faq
  6. caesar

    caesar aMember Pro Developer Staff Member

    Joined:
    Oct 16, 2009
    Messages:
    2,295
    You can use code that I gave you. It do exactly what you need.

Share This Page