Zblog php calls a list of articles containing sub-classification articles
When a CMS Enterprise template of zblog php version is called using the GetList function to specify a classification document, it is found that only the document with the specified ID is called, the subcategory document under this ID category is not displayed in the call results. For consultation at the zblog official forum, the administrator replied that the GetList function parameter is not set completely (so you should study the function carefully ).
Complete code:
{Foreach GetList (number of articles, Category ID, null, array ('has _ subcate '=> true) as $ related}
{/Foreach}
Number of articles: Arabic numerals, indicating the number of articles to call;
Category ID: the ID of the category that can be called. You can view it in the background-category management.
Note: If the function does not call a sub-category article, go to the background, Click Configuration management in the upper right corner, select page settings, and switch "list all sub-categories" on.
The number of articles in the current category is displayed after the Z-Blog PHP website category
The effect is similar to that of the built-in document archiving module.
{Foreach $ categorys as $ category}
{/Foreach}
Z-Blog PHP calls the method of specifying multiple article IDs
When working as an enterprise station, we often need to call a series of pages about us and contact us about the side columns. However, it is not convenient to write the code. Here is a simple method.
{Php}
$ Array = explode (',', 2, 3, 4 );
{/Php}
{Foreach $ array as $ dir}
{$ Related = GetPost (int) $ dir )}
{/Foreach}
2, 3, and 4 in the second line of the code indicate the ID of the page to be called, which are separated by lowercase commas. There is no limit on the number of pages.
Of course, 2, 3, and 4 can also be called using variables, which can be easily modified in the background.