If you don't get it, show your codes.
Excellent Tutorial! Thanks a lot, this really solved my problem.
I wanted to know if it's possible to rename the file from static to something else? I tried it, but i keep getting errors. I wanted to add more pages, but since I cannot rename the file, I'm unable to do so.
Also, is it possible to add the link of this page in the footer (in the 'Extras' or 'Information')?
Really appreciate your help
I wanted to know if it's possible to rename the file from static to something else? I tried it, but i keep getting errors. I wanted to add more pages, but since I cannot rename the file, I'm unable to do so.
Also, is it possible to add the link of this page in the footer (in the 'Extras' or 'Information')?
Really appreciate your help
It's all possible. You just have to find all the word 'static' and change it to your file name.abhas wrote:Excellent Tutorial! Thanks a lot, this really solved my problem.
I wanted to know if it's possible to rename the file from static to something else? I tried it, but i keep getting errors. I wanted to add more pages, but since I cannot rename the file, I'm unable to do so.
Also, is it possible to add the link of this page in the footer (in the 'Extras' or 'Information')?
Really appreciate your help
Code: Select all
class ControllerInformationStatic extends Controller {
To add to your footer, locate catalog/view/theme/default/template/common/footer.tpl and add in there.
Awesome!! Thanks for all the help. It works perfectly fine.MarketInSG wrote:It's all possible. You just have to find all the word 'static' and change it to your file name.abhas wrote:Excellent Tutorial! Thanks a lot, this really solved my problem.
I wanted to know if it's possible to rename the file from static to something else? I tried it, but i keep getting errors. I wanted to add more pages, but since I cannot rename the file, I'm unable to do so.
Also, is it possible to add the link of this page in the footer (in the 'Extras' or 'Information')?
Really appreciate your helpThis line is important. Change the 'Static' to whatever file name you give all your files.Code: Select all
class ControllerInformationStatic extends Controller {
To add to your footer, locate catalog/view/theme/default/template/common/footer.tpl and add in there.
you need to add a layout to it, then add modules to that layout you newly created.
Ensure you have
Code: Select all
$this->children = array( //Required. The children files for the page.
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
Yes I have it here is my code:
.tpl :
like I said, I did create information page that working fine with layout (information/dokumentasi) but in dokumentasi page it self with same modul not working.
Please help.
Thanks.
Code: Select all
<?php
class ControllerInformationDokumentasi extends Controller {
private $error = array();
public function index() {
$this->language->load('information/dokumentasi'); //Optional. This calls for your language file
$this->document->setTitle($this->language->get('heading_title')); //Optional. Set the title of your web page.
$this->data['breadcrumbs'] = array();
$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('text_home'),
'href' => $this->url->link('common/home'),
'separator' => false
);
$this->data['breadcrumbs'][] = array(
'text' => $this->language->get('heading_title'),
'href' => $this->url->link('information/dokumentasi'),
'separator' => $this->language->get('text_separator')
);
$this->data['heading_title'] = $this->language->get('heading_title'); //Get "heading title" from language file.
$this->data['daftar_isi'] = $this->language->get('daftar_isi');
$this->data['user_guide'] = $this->language->get('user_guide');
if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/information/dokumentasi.tpl')) { //if file exists in your current template folder
$this->template = $this->config->get('config_template') . '/template/information/dokumentasi.tpl'; //get it
} else {
$this->template = 'default/template/information/dokumentasi.tpl'; //or get the file from the default folder
}
$this->children = array( //Required. The children files for the page.
'common/column_left',
'common/column_right',
'common/content_top',
'common/content_bottom',
'common/footer',
'common/header'
);
$this->response->setOutput($this->render());
}
}
?>
Code: Select all
<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
<h1><?php echo $heading_title; ?></h1>
<h2><center><?php echo $daftar_isi; ?></center></h2>
<h3><center><?php echo $user_guide; ?></center></h3>
<?php echo $content_bottom; ?></div>
<?php echo $footer; ?>
Please help.
Thanks.
Last edited by boy88 on Mon Aug 13, 2012 8:52 am, edited 2 times in total.
click edit layout for 'information'. Click the blue button that says 'add route'. In it, the route box, enter this in 'information/dokumentasi'. Add modules to information layout. You should see it now.
Hi,
So I have created a new static page successfully!!
Now I'm looking to dig a little more.
Lets say I need product page to load a custom php file.
With bits of random code, some functions, etc... to achieve certain results.
What would be the correct procedure and where to put this file?
In catalog/view/theme/default/template/product/product.tpl
I would put a require(file);
But I have been having hard time to get it to work correctly.
Any help will be appreciated.
So I have created a new static page successfully!!
Now I'm looking to dig a little more.
Lets say I need product page to load a custom php file.
With bits of random code, some functions, etc... to achieve certain results.
What would be the correct procedure and where to put this file?
In catalog/view/theme/default/template/product/product.tpl
I would put a require(file);
But I have been having hard time to get it to work correctly.
Any help will be appreciated.
It uses a mvc structure. It depends how you want to require for the file. Why not just code the php codes directly into the product page?
Who is online
Users browsing this forum: No registered users and 46 guests