best practice? one down, one to go

Permalink
In my site i want to have a single page with a large data table coming from mysql and some jquery stuff to manipulate that table.

Also i made a page type to use for some quizes made with sql support and a php script.

In those both cases my simple solution is an iframe. But i think that there must be a better way.

So should i try to make a block for both cases or it isn't worth the trouble for the single page case?

Any suggestions are welcome...

abraamz
 
frz replied on at Permalink Reply
frz
that sounds like a single page architecture if we were building it.
abraamz replied on at Permalink Reply
abraamz
i need to load some javascript in <head> but i only need this in a single page called "therm"

I searched and found about adding through a block but not for a single page. I tried
$this->addHeaderItem('<script src="/js/therm.js" type="text/javascript"></script>','CONTROLLER')
at the beginning of a public function in the corresponding controller but it doesnt work.
Any suggestions?

(Also need the code to add additional css for this particular single page.)
frz replied on at Permalink Reply
frz
there's a custom field in page properties called custom header info. that should throw whatever you put in there into the header of most themes. we added it for the meta tag google webmaster tools wants, but you you could use it for anything
abraamz replied on at Permalink Reply
abraamz
I made my single page with a working controller.
But i have a problem with page type and a new controller.
the handle is left_sidetest.php and it is under themes/keepitsimple, while inside it i have added
<?php 
echo 'hallo my dear screen';
$this->controller->ni();
?>

The error is Fatal error: Call to undefined method Controller::ni() in mywebsite/themes/keepitsimple/left_sidetest.php on line 25

Inside controllers/page_types/left_sidetest.php i believe i have defined that method as
<?php
class PageTypesLeftSidetestController extends Controller {
    public function ni() {
echo 'hallo there from this nice controller';
}
}
?>

Is there something obvious i can't see or what?
abraamz replied on at Permalink Reply
abraamz
it should be named
<?php
class LeftSidetestPageTypeController extends Controller {
    public function ni() {
echo 'hallo there from this nice controller';
}
}
?>
abraamz replied on at Permalink Reply
abraamz
for a page type how does relative paths are made?
i have made a directory inside my theme directory and i can include php files from that directory but i cant use stuff like these:
$filepath = $this->path.$this->filename.'.xls';
   if(!is_file($filepath)) {
            $this->setError('Test not found =/');
            return 0;
        }

i have tried to change $filepath to an absolute path (i meanhttp://www.allthewaytothefile...)... but this still gives an error.
What is wrong here?