Embed login block with popup custom template into header.php

Permalink
Hi There,

I'm trying to embed the login block (set to use the login popup template) into header.php but can't get the popup to work.

I couldn't find any way to embed it directly (like autonav) so am trying to do it via a global scrapbook item like this:
<?php // grab a login block from the global scrapbook
  $b = Block::getByName('login_block');
  $b->display();
?>


Is there a trick to getting it to work with a custom template?

Any help would be most awesome.

Cheers

Ben

 
cmscss replied on at Permalink Reply
So have tried specifying the name of the custom template like this - but still no luck:
<?php // grab the login block from the global scrapbook
  $b = Block::getByName('login_global_block');
  $b->display('templates/popup-login');
?>


Just to be clear, the Login link is displaying and when clicked I see "#login-popup" appended to the URL but the popup and login form doesn't display.
cmscss replied on at Permalink Reply
Hmm, am also having a similar issue with the shopping cart although it's not as predictable.

i.e. it works sweet on all pages except three - not sure why

Is this a similar issue to the login popup - do popups not get embeded with global blocks maybe?
cmscss replied on at Permalink Reply
Because the login popup and cart will appear on every page, I thought I could just add all the js and css to the head of my site manually.

But while this works on pages where the block hasn't been added, on others it causes a conflict because the scripts are loading twice. Also, other blocks like my_easy_tabs no longer work - presumably also because of scripts loading twice.

What would be the best way to manually control the scripts and force c5 to not add extra scripts when a block is added to the page?

Any help would by much appreciated.

Cheers

Ben
cmscss replied on at Permalink Reply
OK, so removed some obvious double-ups like jquery and the ccm-base files and now both the login and cart popups work on every page - but on some pages I'm loading block dependancies twice.

As above, what would be the best way of removing the double-ups and manually and controlling certain block dependancies?

Any help would be most welcome.

Cheers

Ben