User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by ilikemmohome » Fri May 18, 2012 3:11 pm

here's nothing special about it. Just the usual way can do

RS Gold
Runescape Gold


Newbie

Posts

Joined
Fri May 18, 2012 2:45 pm

Post by abhas » Wed May 23, 2012 3:04 pm

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 :)

Spezia Jewellery


Newbie

Posts

Joined
Wed Feb 22, 2012 2:21 pm


Post by MarketInSG » Wed May 23, 2012 3:52 pm

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 :)
It's all possible. You just have to find all the word 'static' and change it to your file name.

Code: Select all

class ControllerInformationStatic extends Controller {
This line is important. Change the 'Static' to whatever file name you give all your files.

To add to your footer, locate catalog/view/theme/default/template/common/footer.tpl and add in there.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by abhas » Wed May 23, 2012 5:24 pm

MarketInSG wrote:
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 :)
It's all possible. You just have to find all the word 'static' and change it to your file name.

Code: Select all

class ControllerInformationStatic extends Controller {
This line is important. Change the 'Static' to whatever file name you give all your files.

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. :)

Spezia Jewellery


Newbie

Posts

Joined
Wed Feb 22, 2012 2:21 pm


Post by asifjan » Thu Jul 05, 2012 12:37 am

Thanks a Billion, i just created account to Thank you..

Newbie

Posts

Joined
Thu Jul 05, 2012 12:34 am

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by boy88 » Fri Aug 10, 2012 11:42 pm

How can we put a modul in this page?
coz I can't put any modul to it.
Thanks.

Newbie

Posts

Joined
Sun May 13, 2012 10:16 pm

Post by boy88 » Fri Aug 10, 2012 11:43 pm

using OC 1.5.3.1

Newbie

Posts

Joined
Sun May 13, 2012 10:16 pm

Post by MarketInSG » Sat Aug 11, 2012 9:36 am

you need to add a layout to it, then add modules to that layout you newly created.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by boy88 » Sat Aug 11, 2012 11:49 am

yes I had add it, but no result, ( information/dokumentasi ). any ide?
I had created information page, added same modul and its working ???
I wonder why?
Last edited by boy88 on Mon Aug 13, 2012 8:51 am, edited 2 times in total.

Newbie

Posts

Joined
Sun May 13, 2012 10:16 pm

Post by MarketInSG » Sat Aug 11, 2012 12:23 pm

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'
      );


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by boy88 » Sat Aug 11, 2012 6:35 pm

Yes I have it here is my code:

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());     
     }
}
?>
.tpl :

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; ?>
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.
Last edited by boy88 on Mon Aug 13, 2012 8:52 am, edited 2 times in total.

Newbie

Posts

Joined
Sun May 13, 2012 10:16 pm

Post by MarketInSG » Sun Aug 12, 2012 1:00 pm

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.


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by boy88 » Mon Aug 13, 2012 6:30 am

Yes it's working now Thanks, but the modul showed up in all information pages too, I just want it to show in dokumentasi pages only, it's there another solutions?

Newbie

Posts

Joined
Sun May 13, 2012 10:16 pm

Post by boy88 » Mon Aug 13, 2012 8:48 am

I had fix it, its in the DB, ..._layout_route the information//dokumentasi, it's had double slash (grrrrrr) don't know why???.
But its working now :).
Thank U.

Newbie

Posts

Joined
Sun May 13, 2012 10:16 pm

Post by tolinho » Fri Aug 17, 2012 5:53 am

Thanks MarketInSG for sharing/teaching this.
Very helpfull

New member

Posts

Joined
Sat Jul 21, 2012 2:01 am

User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore

Post by tolinho » Sat Aug 18, 2012 7:28 am

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.

New member

Posts

Joined
Sat Jul 21, 2012 2:01 am

Post by MarketInSG » Sat Aug 18, 2012 9:23 am

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? :)


User avatar
Guru Member

Posts

Joined
Wed Nov 16, 2011 11:53 am
Location - Singapore
Who is online

Users browsing this forum: No registered users and 24 guests