Half a year ago, I wrote several articles about asp.net cms in the blog garden. At that time, my cms was not available yet. It's all a bit exaggerated. Now I have deleted those articles.
Today, I want to express my feelings for writing this article.
Now my CMS core is almost complete.
The cms version of c # is called anCms.
Basic Syntax of anCms:
1. Bind data
Copy codeThe Code is as follows:
Syntax description:
Start flag <! -- {An: method name filed = [Field 1, Field 2, field 3] sort = [field asc | desc] category = [category ID] id = [ID] keyword = [] page = [true | false] num = [number of display pages ]} -->
<! -- {/An} --> end tag
Example 1
<! -- {An: alist filed = [id, title, time] sort = [time desc]} -->
<P> No.: $ {0}, Title: $ {1}, time: $ {2} </p>
<! -- {/An} -->
Alist indicates the list of articles.
I also wrote some other methods: list, plist, llist...
Plist: list of products.
Llist indicates the list of links.
List: a general list (including articles, products, links)
Filed indicates the database field name. I believe everyone understands this.
In subsequent versions, I set the field id to the first by default.
That is: <! -- {An: alist filed = [title, time] sort = [time desc]} -->
<P> No.: $ {0}, Title: $ {1}, time: $ {2} </p>
<! -- {/An} -->
The time is often formatted.
So I wrote a method.
<! -- {An: alist filed = [title, time] sort = [time desc]} -->
<P> No.: $ {0}, Title: $ {1}, time: ${2 | yyyy-MM-dd} </p>
<! -- {/An} --> I believe everyone understands what time formatting means.
As the name suggests, category is classification. Enter the category ID.
List of articles whose category ID is equal to 1 <! -- {An: alist filed = [title, time] category = [1]} --> <p> No.: $ {0}, title: $ {1}, time: $ {2} </p> <! -- {/An} -->
Category id = # indicates the ID obtained from the Url <! -- {An: alist filed = [title, time] category = [#]} --> <p> No.: $ {0}, title: $ {1}, time: $ {2} </p> <! -- {/An} -->
Id is the same as above.
Page indicates whether to pagination. By default, pagination is not performed.
Num indicates the number displayed on each page. The default value is 10. If the value is 0, all are displayed.
Keyword indicates fuzzy search, that is, keyword search.
Now, the data binding example is almost the same.
It's a bit cold this evening. Write the bound data here.
Continue tomorrow night. I will post the implementation of each method in subsequent articles.
I hope you can communicate with each other. Let's work together to build a cms that belongs to our asp.net.