How do I add some PHP code to a toaster page?

asked Jul 23, 2012 by seotoaster (14,860 points)
edited Jul 23, 2012 by seotoaster
Sometimes,  I need to call some data from another application into a page directly using PHP. Is there a way to add some PHP or other code directly into a Toaster page?

1 Answer

answered Jul 23, 2012 by seotoaster (14,860 points)
Best answer
There is a very simple way to add PHP code in a toaster page through the {$code:somename} tag ... this one tag is disabled in toaster2 by default, but you can re-enable it manually if you need:

1. Go to your phpmyadmin or any other tools you are using to manage you database
2. Go to the config table and change value for the codeEnabled param to 1
3. Go to any of your templates and add some code containers e. g. {$code:your_code_container_name}
4. open the container and add your code in it..
Note: if you add some PHP code, do not add the "<?PHP  | ?>"opening and closing tags.

It is of course better to code your own nice plugin! --> We are preparing a good 'how to' for our plugins system. It will be online soon. Stay in touch with us!

commented Dec 4, 2017 by marc (1,320 points)
can you give an example?