SOY CMS manual
Page management
Method of displaying entry on page(the 2)
3. How to make block(the 2)
It explains the method of displaying the entry in the block described in the template.
Here, title (title) will be allocated in the corporate profile and text (content) be allocated in the content part.
Cms:id ="Title" attribute to the HTML node part where it wants to display the title
Cms:id ="Content" attribute to the HTML node part where it wants to display the content part
It inputs it respectively.
<html>
<body>
<!-- block:id="company_info" -->
<h4 cms:id="title">corporate profile</h4>
<div cms:id="content">The content of corporate profile enters here.</div>
<!-- /block:id="company_info" -->
</body>
</html>
Please push the preservation button at the end. The block area was made by this.
Making has succeeded if displayed as shown in the figure below clicking the block tab in the template editor to confirm whether the block area was made.
Here, when the block that should have been made is not displayed
- Block:id is not specified for the shutting tag of the block.
- ID of the block is different by the start tag and the end tag.
- It doesn't preserve it.
The reason is thought.
Attention
It operates for dusting cms:id even if it doesn't write in the end tag.
However, please apply cms:id to the end tag so that the display may become amusing when the same tag repeats.
Example:
<p cms:id="title">
<p>The title enters here</p>
</p>
In this case, because p tag is used repeatedly in cms:id, the display becomes amusing.
Please set it as follows.
<p cms:id="title">
<p>The title enters here</p>
</p cms:id="title">
Please see the following tables about the attribute that can be used excluding title and content.
cms:id | Tag that can be used | Details |
---|---|---|
entry_id | All | ID |
title | All | Title |
content | All |
Content part |
more | All | Postscript part |
create_date | All | The creation date and cms:format can be used. (standard: Y-m-d H:i:s) |
create_time | All | Cms:format can be used at the making time. (standard: H:i) |
The same one as date() of PHP can be used for the format related to the date. PHP: date - Please refer to Manual.
The entry is allocated to the block continuously made.
The entry can be allocated by two methods.
- Method of specifying entry(block for article display)
- Method of specifying label(block for label display)
[Desu]. Additionally, it is also possible to display the entry on another site managed with same SOYCMS by specifying the label of the site (block of the label on another site). However, the entry displayed in the block of the label on another site cannot be dynamically edited.
Reference
The method of specifying block:id and cms:id will greatly have two kinds of the following (B_block:id and m_block:id are also similar).
1. It sets it to tag as an attribute.
<div cms:id ="Content" > text </div>
2. It describes it as a comment on HTML.
<!-- cms:id="content" --> text <! -- /cms:id="content" -->
In the method of the description as the comment on HTML, it is possible to describe it as follows (since SOY CMS 1.2.2).
<!-- cms:id="content" /-->
It is equal to <! -- cms:id="content" --><!-- /cms:id="content" -->.
When the sample text is unnecessary, here is convenient.
Reference
The value of cms:id has the restriction that it is possible to use it only once in the same block.
In a word, title (cms:id="title") etc. cannot be repeatedly used in the same block.
With this, it used it repeatedly as "Title * cms:id =" since 1.2.4 because it was still inconvenient.
<!-- cms:id="create_date" /--><!-- cms:id="title" /-->
<!-- cms:id="content" /-->
<!-- cms:id="more" /-->
<!-- cms:id="create_date*" /-->
It is possible to describe it.