Login block error in add.php on line 6 <?php include($this->getBlockPath() .'/form_setup_html.php'); ?>

Permalink
Hi There,

I added this block to a page and everything was fine but when I tried to add it to another page, I get an error referencing line 6 in add.php - which is:
<?php include($this->getBlockPath() .'/form_setup_html.php'); ?>


If I change the line to this it works:
<?php  include('form_setup_html.php'); ?>


Was just wondering if this is some sort of paths or permissions issue - does atone know what causes this?

Any help would be much appreciated.

 
Mnkras replied on at Permalink Reply
Mnkras
use $this->inc('form_setup_html.php');
cmscss replied on at Permalink Reply
Thanks heaps for your answer but still no luck.

Whenever I try to edit this block, I get the same error.

Just to to triple check, this is how I used it (along with the other things tried):
<?php  
defined('C5_EXECUTE') or die(_("Access Denied."));
$bObj=$controller;
?>
<?php $this->inc('form_setup_html.php'); ?>
<!-- <?php $this->inc('/form_setup_html.php'); ?> -->
<!-- <?php  include('form_setup_html.php'); ?> -->
<!-- <?php  include('/form_setup_html.php'); ?> -->
<!-- <?php include($this->getBlockPath() .'form_setup_html.php'); ?> -->
<!-- <?php include($this->getBlockPath() .'/form_setup_html.php'); ?> -->
ThemeGuru replied on at Permalink Best Answer Reply
ThemeGuru
Maybe...
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('form_setup_html.php');
?>
cmscss replied on at Permalink Reply
Thanks mate,

Initially this worked great!

But now an error appears where ever the block is embedded - I'm trying to embed this block into the header via a global scrapbook if that makes a difference:
LOGIN 
Warning: include(/path/to/c5-install/themes/ssb-blank/form_setup_html.php) [FUNCTION.INCLUDE]: failed to open stream: No such file or directory in /path/to/c5-install/concrete/libraries/view.php on line 335
Warning: include() [FUNCTION.INCLUDE]: Failed opening '/path/to/c5-install/themes/ssb-blank/form_setup_html.php' for inclusion (include_path='/path/to/c5-install/libraries/3rdparty:/path/to/c5-install/concrete/config/../libraries/3rdparty:.:/Applications/MAMP/bin/php5.2/lib/php') in /path/to/c5-install/concrete/libraries/view.php on line 335


I decided to start again and replace both edit.php and add.php but still see the error - so then cleared and turned off the cache but still no luck.

I'm a bit confused sorry!

Also, can I move add.php and view.php from /packages/login to /blocks/login so any updates don't ruin my changes?

Any help would be much appreciated.
cmscss replied on at Permalink Reply
Sorry, I had an error in my header.php where I was embeding the login global block - this was causing this error.

Everything works now - cheers!

For my own reference, this is what I did.

1.
Moved all the login block files and dependancies from /packages to /blocks/login

2.
Edited add.php in the /blocks/login directory to be this:
<?php
defined('C5_EXECUTE') or die(_("Access Denied."));
$this->inc('form_setup_html.php');
?>


3.
Created a global version of the login block in c5, then embedded it into header.php using the pop-up custom template like this:
<?php // grab the login block from the global scrapbook   
   $block = Block::getByName('login_global_block');
   if( $block && $block->bID ) $block->display('templates/popup-login')
?>


4.
Embedded the login popup dependancies into the site header so the popup works like this (repeated the same process for the popup shopping cart as well):
<!-- LOAD c5 DIALOG AND POPUP BLOCK DEPENDANCIES ON EACH PAGE -->
<!-- c5 dialog -->
<link rel="stylesheet" type="text/css" href="/concrete/css/ccm.dialog.css?v=eec6f522f1bf2e93a2ab13e7d5aaf59c" />
<script type="text/javascript" src="/concrete/js/ccm.dialog.js?v=eec6f522f1bf2e93a2ab13e7d5aaf59c"></script>
<!-- core commerce cart -->
<link rel="stylesheet" type="text/css" href="/packages/core_commerce/css/ccm.core.commerce.cart.css?v=eec6f522f1bf2e93a2ab13e7d5aaf59c" />
<script type="text/javascript" src="/packages/core_commerce/js/ccm.core.commerce.cart.js?v=eec6f522f1bf2e93a2ab13e7d5aaf59c"></script>
<!-- login popup -->
<link rel="stylesheet" type="text/css" href="/packages/popup_login/blocks/login/templates/popup-login/view.css?v=eec6f522f1bf2e93a2ab13e7d5aaf59c" />
<script type="text/javascript" src="/packages/popup_login/blocks/login/templates/popup-login/view.js?v=eec6f522f1bf2e93a2ab13e7d5aaf59c"></script>
<!-- END LOAD c5 DIALOG AND POPUP BLOCK DEPENDANCIES ON EACH PAGE -->


Now if only I could work out a way to stop c5 loading the cart and popup dependancies twice.