so I am able to call my php code without a problem but I need to pass in a parameter. However, the parameter will not be hard coded. how can I make value 1 and value 2 a dynamic variable?
alright, so I got the php thing to work very nicely and pretty much all my old code works. So instead of returning $html, I just echo straight from my module code with echo.
however, in my php code, i generate bunch of links dynamically… it searches a particular folder, find image files, sort them, and display them in thumbnail with a link to a bigger resolution. let say my link is like this:
Can anyone help me resolve this problem I have with this code please? After much messing around, I have a nice “Hello” message at the bottom of my homepage.
However, the idea was to place there the latest blog post from my Wordpress installation at the bottom of the page.
The problem I have is, if I use the code below in, it shows the latest post correctly, but ABOVE everything else on the page, not at the bottom.
<?php
class Mayerwin_Custom_Block_Test extends Mage_Core_Block_Abstract { protected function _toHtml() {
Hi. I got “hello world” working… how would I go about implementing this simple script on app/code/local/Mayerwin/Custom/Block/Test.php :
<?php
class Mayerwin_Custom_Block_Test extends Mage_Core_Block_Abstract { protected function _toHtml() { // put here your custom PHP code with output in $html; // use arguments like $this->getMyParam1() , $this->getAnotherParam()
///*
// START of "Frontpage Slideshow" settings $nameOfSlideshowToDisplay = "mydemoslideshow"; // Enter the name of your slideshow. Slideshows are in folders inside /fpss/slideshows/. $URLofyoursite = "http://kehot.hhhost.net"; // Enter your site's URL. $AbsoluteServerPathofyoursite = "/home/kehothhh/public_html/"; // Enter the root path of your site on the server.
// do not edit below this line include_once($AbsoluteServerPathofyoursite."/fpss/mod_fpslideshow.php"); // END of "Frontpage Slideshow" settings //*/
Hello.
I have a small PHP and JS code that checks and sets some coockies as soon as a new visitor comes to our website. These coockies determine which website to direct the visitor to
http://www.domain.com
or
http://www.domain.com/international
and than it will remember to always direct him to the same ‘domain’
So based on this tutorial I thought I need to do this as a module and place the block code on the app/design/........./layout/page.xml
but, ofcourse since I’m not sure of what I’m doing I get the following error:
Fatal error: Call to a member function toHtml() on a non-object in C:\AppServ\www\app\code\core\Mage\Core\Block\Abstract.php on line 503