How to add a template to ecmall

Source: Internet
Author: User

Reprinted address statement: http://blog.csdn.net/lin_wen_jun/article/details/5882026

In this example, you can add a custom travel information page in two steps.

1. Add an application MVC

Add an app/travel. App. php
And expand the mallbaseapp class.

Class travelapp extends mallbaseapp (){
Function Index (){
// Obtain related data
// Present the template travel.html
}

Function other (){
 
}
}
When such a class is written, you can use index. php? APP = Travel
Of course, you can define a function similar to other to use index. php? APP = Travel & act = Other

Add related language items
Modify ages/sc-utf-8/common. Lang. php (this file is used to display page information at the current location)
Add ages/sc-utf-8/travel. Lang. php (this file is to display the package in the travel view)

Add view files
Themes/mall/default/travel.html

2. Associate the template with the background Editor

1. In admin/APP/template. App. php
Found in approximately 309 rows
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
);
}
Add an array element
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
'Travel '=> site_url.'/index. php? APP = Travel ',
);
}

2. In versions/sc-utf-8/admin/template. Lang. php
Add an array element
'Travel '=> 'travel info page'
This is to edit the Template Name in the background template editing.

In this example, you can add a custom travel information page in two steps.

1. Add an application MVC

Add an app/travel. App. php
And expand the mallbaseapp class.

Class travelapp extends mallbaseapp (){
Function Index (){
// Obtain related data
// Present the template travel.html
}

Function other (){
 
}
}
When such a class is written, you can use index. php? APP = Travel
Of course, you can define a function similar to other to use index. php? APP = Travel & act = Other

Add related language items
Modify ages/sc-utf-8/common. Lang. php (this file is used to display page information at the current location)
Add ages/sc-utf-8/travel. Lang. php (this file is to display the package in the travel view)

Add view files
Themes/mall/default/travel.html

2. Associate the template with the background Editor

1. In admin/APP/template. App. php
Found in approximately 309 rows
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
);
}
Add an array element
Function _ get_editable_pages (){
Return array (
'Index' => site_url. '/index. php ',
'Gcategory '=> site_url.'/index. php? APP = Category ',
'Travel '=> site_url.'/index. php? APP = Travel ',
);
}

2. In versions/sc-utf-8/admin/template. Lang. php
Add an array element
'Travel '=> 'travel info page'
This is to edit the Template Name in the background template editing.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.