Please help us to make AbanteCart Ideal Open Source Ecommerce Solution for everyone.

Support AbanteCart eCommerce

Author Topic: how to create new page template?  (Read 4143 times)

Offline huyhoang08

  • Newbie
  • *
  • Posts: 25
  • Karma: +1/-1
    • View Profile
how to create new page template?
« on: March 01, 2016, 09:49:22 PM »
i don't know how to change default controller page(storefront/controller/common/page.php) in some pages for different HTML structure.
on other hand, i want to change HTML struct on to parent block (ie: column_left, column_right,...) in different page. Because i understand (controller: page.php) is for all pages in abantecart. Is that true?
Please explain me how to do it. Thank guys.

Offline llegrand

  • Hero Member
  • *****
  • Posts: 1494
  • Karma: +390/-2
    • View Profile
Re: how to create new page template?
« Reply #1 on: March 01, 2016, 11:13:45 PM »
Seems you might gain some valuable knowledge by spending a little time reading the documentation.
Here's the link to a section about changing the page layouts - which will probably get the "re-design" that you're seeking.

http://docs.abantecart.com/pages/design/layouts.html

This should help,  but keep asking if it doesn't.

Lee

Offline huyhoang08

  • Newbie
  • *
  • Posts: 25
  • Karma: +1/-1
    • View Profile
Re: how to create new page template?
« Reply #2 on: March 01, 2016, 11:27:00 PM »
Sory, i readed abantecart document. Sory for my bad english. For example:
- index page: i want to use custom template (.tpl) . ie: page-home.tpl
- contact page: i want be page-contact.tpl
..
Because abantecart use same 'storefront\view\default\template\common/page.tpl' for all pages on frontend.

I don't want hack into abantecart core file, (if can show me please). i want to use hooks function in abantecart.

yonghan

  • Guest
Re: how to create new page template?
« Reply #3 on: March 02, 2016, 03:14:04 AM »
Hi, have you read the developer docs here? http://docs.abantecart.com/pages/developer/extension_dev.html

Offline huyhoang08

  • Newbie
  • *
  • Posts: 25
  • Karma: +1/-1
    • View Profile
Re: how to create new page template?
« Reply #4 on: March 02, 2016, 07:49:49 AM »
Sory, you can show me example ?, please.
i found common page controller in path of 'core/engine/page.php'
---------------------------------------------------
//Process disparcher in while in case we have new dispatch back
while ($dispatch_rt){
    //Process main level controller         
    // load page layout
    if ($this->layout) {
        ....
        $dispatch_rt = "common/page";   //how i can override this on each page ?
    }
    //Do the magic
    $dispatch = new ADispatcher($dispatch_rt, array("instance_id" => "0"));
    $dispatch_rt = $dispatch->dispatch();

}
---------------------------------------------------
as you see this line:  $dispatch_rt = "common/page";

how i can override this on each page ?
one more thing, what api i can check current page template? ie: is_home(), is_category()...
Thank a lot.

Offline huyhoang08

  • Newbie
  • *
  • Posts: 25
  • Karma: +1/-1
    • View Profile
Re: how to create new page template?
« Reply #5 on: March 02, 2016, 10:28:01 PM »
thank you, i sloved my issue.

 

Powered by SMFPacks Social Login Mod