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

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:

主站蜘蛛池模板: 呈贡县| 广河县| 宁武县| 尚志市| 治多县| 大冶市| 天津市| 夏河县| 兴隆县| 育儿| 许昌市| 天台县| 尉氏县| 辽宁省| 嘉兴市| 白河县| 遂川县| 姚安县| 延津县| 衡水市| 镇赉县| 宜城市| 武清区| 兰西县| 濮阳市| 莒南县| 腾冲县| 阿瓦提县| 泉州市| 开封县| 新乡市| 南澳县| 富源县| 常熟市| 洞头县| 涿州市| 清河县| 衡水市| 乌兰县| 隆昌县| 鄄城县|