News:

AbanteCart v1.4.2 is released.

Main Menu
support

how to create new page template?

Started by huyhoang08, March 01, 2016, 09:49:22 PM

Previous topic - Next topic

huyhoang08

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.

llegrand

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

huyhoang08

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.


huyhoang08

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.

huyhoang08


Forum Rules Code of conduct
AbanteCart.com 2010 -