类别

有特色的模板

OpenCart. How to 添加 a 新 content 页面 和 link it to a 新 menu 选项卡 (based on 引导 templates)

文森特白 2014年3月26日
等级: 4.0/5. 来自2票.
请稍等...

This tutorial is going to show how to 添加 a 新 content 页面 和 link it to a 新 menu 选项卡.

OpenCart. How to 添加 a 新 content 页面 和 link it to a 新 menu 选项卡 (based on 引导 templates)

  1. Log into your OpenCart administration panel (yoursite.com/admin).

  2. 导航到 Catalog -> Information.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡1

  3. 单击 插入 按钮添加新的content页.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡2

  4. Type in the name of your 页面 和 insert the 页面 text to the 描述 场. 你可以使用视觉效果 编辑器 格式化你的文本. 插入 images 和 create hyperlinks. 你也可以编辑 HTML code. 只要点击 Source button.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡3

  5. 选择 Data 选项卡. Here you can define 页面 keywords, set Sort Order, the bottom footer display 和 enable or disable the 页面.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡4

  6. Save the changes 和 check your store online. Content 页面s are being displayed in the 信息块.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡5

  7. 我们需要编辑的代码 header.tpl file in order to 添加 our content 页面 to the top menu. 文件位于 /catalog/view/theme/themeXXX/template/common 文件夹.

  8. 使用任何PHP/代码编辑该文件 编辑器. 搜索菜单代码. It should look similar to the following:

    	
           

    注意: The code may vary depending on the template.

  9. Each line of code displays one menu element. 复制最后一行代码:

  10. " href="">
  11. Add a 新 line 和 paste the code you have copied.

  12. We need to change the condition of assigning “active” CSS class for our 新 menu item. 让我们替换:

    request->get['route']) && $this->request->get['route']=="结帐/结帐") {echo "active";} ?>
    

    :

    request->get['route']) && $this->request->get['route']=="information/information") && (isset($this->request->get['information_id']) && $this->request->get['information_id']=="13")) {echo "active";} ?>
    

    这是 the code for the Information 页面. 你应该换掉 13 与您的新页面的ID.

    以下代码:

    should be changed to the title of the menu element. 这是 测试 在我们的例子中.

    注意: is the code for the 字体太棒了 图标. You may replace the class with the one you like. You can find the list of 图标s 和 their classes by going to the following link . The version of Font 图标s can be checked in the /catalog/view/theme/themeXXX/样式表/ font-awesome.模板的CSS文件.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡6

  13. We need to get the URL to our content 页面 to link it to the top menu. Click on the 页面 link in the 信息块 和 copy the URL from the 添加ress bar of your web 浏览器.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡7

    然后更改以下代码:

    to the URL to our content 页面 we have copied.

  14. Here is the complete line with the changes we have applied:

  15. request->get['information_id']) && $this->request->get['information_id']=="13")) {echo "active";} ?>" href="http://templatetesting.com/vincent/index.php?route=information/information&information_id=13">测试
  16. 别忘了更换 13 with the actual ID of your 新 页面.

  17. And the complete menu code block will look like this:

     	
    
           
  18. 保存文件. 页面已添加到 header menu.

  19. Now let’s 添加 the link to our 新 页面 to the mobile view menu. 我们可以检查一下 火狐 浏览器: Web developer->Responsive design view 菜单(Ctrl + Shift + M).

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡8

  20. In the same file, we need to find the code

    . It marks the list of mobile menu items, which contains both headerfooter 桌面视图中的链接. 整个代码看起来像这样:

     
         
  21. 让我们为我们的新 header link to the mobile menu after the 结帐 item (we need to 添加 that above the line):

    The modified code will look like the following:

    	
    
         
  22. 保存更改并刷新您的 浏览器 页面. We have 添加ed a 新 content 页面 和 linked it to a 新 menu 选项卡 成功.

    opencart-how-to-添加-a-新-content-页面-和-link-it-to-a-新-选项卡9

Feel free to check the detailed video tutorial below:

OpenCart. How to 添加 a 新 content 页面 和 link it to a 新 menu 选项卡 (based on 引导 templates)

下载OpenCart主题
这个条目被张贴了出来 OpenCart教程 和标记 添加, 引导, button, content, menu, , opencart, 页面. 书签的 永久链接.

提交罚单

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help 和 assistance within next 24 hours: 提交罚单