3
我正在嘗試在magento中創建一個新頁面,其中我必須添加一些html和javascript。 爲此,我創建了一個模塊。 內容的 - >應用程序\代碼\本地\公司名稱\的HelloWorld \等\ config.xml中 -如何在magento網站中創建新頁面
<?xml version="1.0"?>
<config>
<modules>
<CompanyName_Helloworld>
<version>
0.1.0
</version>
</CompanyName_Helloworld>
</modules>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>CompanyName_Helloworld</module>
<frontName>Helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
的內容 - >應用程序\代碼\本地\公司名稱\的HelloWorld \控制器\索引控制器。 PHP -
<?php
class CompanyName_Helloworld_IndexController extends Mage_Core_Controller_Front_Action{
public function indexAction(){
$this->loadLayout();
$this->renderLayout();
//echo "We're echoing just to show that this is what's called, normally you'd have some kind of redirect going on here";
}
}
>
做這一切後,當我轉到域/ index.php文件/的Helloworld 我可以看到頁眉和頁腳,現在我想在它們之間添加一些「div」標籤和JavaScript。 請說明如何做到這一點。
爲什麼不使用CMS頁面呢? – 2012-07-14 10:52:54
那麼你能告訴我,在哪裏添加html和javascript,因爲當我將代碼粘貼到內容區域時,它會以原樣顯示,而不會呈現它。 – ankit 2012-07-14 10:59:34
有一個按鈕可以在所見即所得的HTML模式之間切換。 – 2012-07-14 12:17:10