官术网_书友最值得收藏!

Custom Variables

Custom Variables are pieces of code that have specific values, like a programming variable. By creating a Custom Variable, you can apply it to multiple areas on your site. An example of Custom Variable structure is {{config path="web/unsecure/base_url"}}. This variable shows the URL of the store.

Now let's create a Custom Variable to see how it works:

  1. Open your favorite browser and access the admin area, http://localhost/packt/admin_packt.
  2. Navigate to System | Custom Variables.
  3. Click on the Add New Variable button.
  4. In the Variable Code field, enter the variable in lowercase and with no spaces, for example, dev_name.
  5. Enter Variable Name, which explains the variable's purpose.
  6. Enter the Variable HTML Value and Variable Plain Value of the Custom Variable and save it.

Now we have a custom variable that stores the developer's name. Let's use this variable inside the CMS About Us page:

  1. In the admin area, navigate to Content | Pages.
  2. Click to edit the About Us item.
  3. Click on the Content side menu.
  4. Click on the Show / Hide Editor button to hide the HTML editor.
  5. Put the following code at the end of the content, {{CustomVar code="dev_name"}}, and save the content.

Let's check the result:

主站蜘蛛池模板: 东乌珠穆沁旗| 福泉市| 弥渡县| 普兰县| 凉城县| 公主岭市| 衡阳县| 从化市| 沾益县| 贺兰县| 伊宁县| 黄浦区| 昌黎县| 定兴县| 修文县| 利津县| 九江县| 正蓝旗| 信丰县| 开原市| 香格里拉县| 花垣县| 灵璧县| 奇台县| 祁门县| 乡宁县| 富顺县| 渝中区| 武宣县| 会理县| 巨鹿县| 香河县| 横峰县| 庆阳市| 罗源县| 垫江县| 枞阳县| 马关县| 若羌县| 平乡县| 津南区|