Global variable template tag calling and sorting for halo blog theme development (necessary for halo theme development)

Different program topics have different ways of calling global variables. For example, we are familiar with WordPress programs, whose various call tags are different. These are also officially set, and we cannot change them. Any theme development and secondary development should follow the official tag calls. This is not in the Halo lightweight blog program. We need to be familiar with the official tags to develop themes. Here, Lao Jiang sorts out the global variables of the Halo lightweight blog program.

 The calling and sorting of global variable template tags for halo blog theme development

If we have theme development or call, we need to follow the review.

1. Blog address

 ${blog_url!}

This variable corresponds to the blog address in the background blog settings.

2. Site Root Path

 ${context!}

It should be noted that this variable is different from blog_url in that it has two values, one is in the form of relative path and the other is in the form of absolute path.

3. Theme resource root path

 ${theme_base!}

Suppose your theme is in the~/halo dev/templates/themes/anatole directory, then theme_base is https://yourdomain/themes/anatole

For example, your current development theme is anatole. When you want to get the path of the css/style.css file under the theme, then:

 ${theme_base!}/css/style.css

4. Subject information

Topic name

 ${theme.name!}

Subject git warehouse address

 ${theme.repo!}

Theme version number

 ${theme.version!}

5. Blog Title

 ${blog_title!}

6. Blog LOGO

 ${blog_logo!}

7. Program version number

 ${version!}

8. Blogger information

Nickname?

 ${user.nickname!}

e-mail address:

 ${user.email!}

Description:

 ${user.description!}

Head portrait address:

 ${user.avatar!}

Last logon time:

 ${user.expireTime!}

9. SEO keyword

 ${meta_keywords!}

Note that although this variable can be used on any page, its value may be different on different pages. The corresponding value will be generated according to the user's settings.

10. SEO Description

 ${meta_description!}

Note that although this variable can be used on any page, its value may be different on different pages. The corresponding value will be generated according to the user's settings.

11. RSS 2.0 Subscription Address

 ${rss_url!}

12. Subscription address in Atom format

 ${atom_url!}

13. Website map address in Xml format

 ${sitemap_xml_url!}

14. Website map address in HTML format

 ${sitemap_html_url!}

The format is as follows: https://www.itbulu.com/sitemap.html

15. Friendship link page address

 ${links_url!}

16. Gallery Page Address

 ${photos_url!}

17. Log page address

 ${journals_url!}

18. Address of article archiving page

 ${archives_url!}

When the global absolute path is on: https://www.laobuluo.com.com/ {archives_prefix}

When the global absolute path is closed:/{archives_prefix}

19. Sort list page address

 ${categories_url!}

When the global absolute path is on: https://www.itbulu.com.com/ {categories_prefix}

When the global absolute path is closed:/{categories_prefix}

20. Label list page address

 ${tags_url!}

21. Page judgment

Determine whether the current page is a specific page.

 Is_index: Home page Is_post: article page Is_sheet: custom page Is_archives: archive page Is_categories: category list page Is_category: a single category page Is_tags: tag list page Is_tag: single label page Is_search: search results page Is_journals: log page Is_photos: gallery page Is_links: Friendship link page

Usage:

 <#if is_index??> The current page is the home page </#if>

In this way, we are basically familiar with our global variable call using Halo, and we can realize theme development. In fact, theme development is not difficult, as long as the front end is followed by adding call variables.

Vote for you

Source: Lao Jiang Tribe » Global variable template tag calling and sorting for halo blog theme development (necessary for halo theme development) |Welcome to share (public account: Chiang's circle of friends)

Get new information from webmaster/add QQ group from the public account "Chiang Kai shek's circle of friends"【 one billion twelve million four hundred and twenty-three thousand two hundred and seventy-nine 】Get preferential promotion from merchants