View Post
This page describes the request data identifiers and response structure required to build a post view page.
Data Identifier
{
"dataID": "GET_POST",
"post_key": 1,
"page_link_url": "/post/123/post-subject",
"page_link_hash": "HASH",
"page": 1,
"list_per_page": 20,
"block_per_page": 5
}| Key | Description |
|---|---|
| post_key | Unique post key |
| page_link_url | Link URL for comment list paging |
| page_link_hash | Paging navigation link hash (required when navigating to a hash link within a hash page) |
| page | Comment page number |
| list_per_page | Number of comments displayed per page |
| block_per_page | Number of page links shown in the paging block on a page |
HTML
<div id="post">
<div><small class="ms-1 fw-bold">Board name</small></div>
<h1 class="fs-3 mt-4 mb-4">The post title is displayed here.</h1>
<div>
24-07-22 22:23 by Author
</div>
<p>
H:Dev+ is based on the MVC (Model-View-Controller) model,
providing the Model and Controller on the Back-End so you can
focus on Front-End development. Communication between the
Front-End and Back-End uses the RESTful approach. To do this, .....
</p>
<div>
<span>Tag1</span>
<span>Tag2</span>
<span>Tag3</span>
</div>
<div>
<a href="/post/modify?post_key=AD570BDF1...">EDIT</a>
<button type="button" class="h-btn-delete" data-post-key="AD570BDF1...">DELETE</button>
</div>
</div>- div
<div id="post"></div>The area where the post is displayed. The id must be set to post.
- a
<a href="/post/modify?post_key=AD570BDF1..."></a>Post edit button. The post[0].post_key value from the Response Result must be set in the post_key parameter of the edit page URL.
- button
<button type="button" class="h-btn-delete" data-post-key="AD570BDF1..."></button>Post delete button. The post[0].post_key value from the Response Result must be set in data-post-key, and the class selector must include h-btn-delete.
Response Result
{
"post": [
{
"avatar_url": "/avatar/url",
"board_name": "free board",
"board_seq": 100,
"contents": [
{"content":"post content","content_html_enc": "encoded html content"}
],
"create_date": "2025-05-30 02:53:34",
"create_date_type_mdhi": "05-30 02:53",
"member_seq": 300,
"modify_date": "2025-05-30 02:53:34",
"nickname": "winter",
"post_key": "E477FEEB837326JEUDYFC505D20C022",
"read_count": 928,
"reg_name": "micky",
"seq": 34,
"subject": "Post Subject",
"tags": [
"tag1",
"tag1",
"tag2",
"tag3"
],
"related_post": [
{
"post_key": "E477FEEB837326JEUDYFC505D20C022",
"subject": "Related Post Subject",
"reg_name": "Micky",
"avatar_url": "/avatar/url",
"create_date": "2025-05-20 02:53:34"
}
]
}
]
}| Key | Description |
|---|---|
| post[0].avatar_url | Avatar URL |
| post[0].board_name | Board name |
| post[0].board_seq | Board sequence |
| post[0].contents | Array of post contents |
| post[0].contents[0].content | Post content |
| post[0].contents[0].content_html_enc | HTML-encoded post content |
| post[0].create_date | Creation date and time in Y-m-d H:i:s format |
| post[0].create_date_type_mdhi | Creation date and time in y-m-d h:i format |
| post[0].member_seq | Author member sequence |
| post[0].modify_date | Modification date and time in Y-m-d H:i:s format |
| post[0].nickname | Author nickname (current) |
| post[0].post_key | Unique post key |
| post[0].read_count | Post view count |
| post[0].reg_name | Author nickname (at the time of posting) |
| post[0].seq | Post sequence |
| post[0].subject | Title |
| post[0].tags | Tags Array(['tag'=>'tag1'],['tag'=>'tag2']) |
| post[0].related_post | Array of related posts |
| post[0].related_post[0].subject | Related post title |
| post[0].related_post[0].reg_name | Related post author name |
| post[0].related_post[0].nickname | Related post author nickname |
| post[0].related_post[0].avatar_url | Related post avatar URL |
| post[0].related_post[0].create_date | Related post creation date |
| post[0].related_post[0].post_key | Related post unique key |
Example
The post title is displayed here.
H:Dev+ is based on the MVC (Model-View-Controller) model, providing the Model and Controller on the Back-End so you can focus on Front-End development. Communication between the Front-End and Back-End uses the RESTful approach. To do this, it sends a POST request through the Connector and returns the result as a Response in JSON format. Instead of a URL, it uses a dataID to specify a unique resource identifier, and a secureKey is required for security.
<div id="post" :data-post-key="output.post[0].post_key" class="me-3">
<div class="py-3">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center py-3 border-bottom">
<div>
<small class="ms-1 fw-bold">{{ output.post[0].board_name }}</small>
</div>
<div class="d-flex justify-content-between align-items-center" v-if="output.user.auth_flg && output.post[0].member_seq == output.user.seq">
<a :href="'./modify.html?post_key='+output.post[0].post_key" class="mx-1 btn btn-dark d-flex justify-content-between align-items-center lh-1"><small class="smaller d-none text-white d-md-block">Edit</small></a>
<a href="#" data-return-url="./list.html" :data-post-key="output.post[0].post_key" class="h-btn-delete mx-1 btn btn-dark d-flex justify-content-between text-white align-items-center lh-1"><small class="smaller d-none d-md-block">Delete</small></a>
</div>
</div>
<h1 class="fs-3 mt-4 mb-4">{{ output.post[0].subject }}</h1>
</div>
</div>
<div class="row">
<div class="col-12 text-start">
<div class="d-flex justify-content-start align-items-center">
{{ output.post[0].create_date_type_mdhi }} by
<div class="mx-2">
<img v-if="output.post[0].avatar_url" :src="output.post[0].avatar_url" style="max-width:1.5rem;"/>
<i v-else class="fas fa-user-circle"></i>
</div>
{{ output.post[0].reg_name }}
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div><p v-html="output.post[0].contents[0].content"/></div>
<div class="d-flex align-items-center justify-content-start my-4" v-if="output.post[0].tags && output.post[0].tags.length>0">
<span v-for="tags in output.post[0].tags" class="badge bg-white border me-1 fw-normal text-hbnc-secondary me-2 px-3 py-2">
{{ tags.tag }}
</span>
</div>
</div>
</div>
</div><div id="post" data-post-key="<?= $output['post'][0]['post_key']; ?>" class="me-3">
<div class="py-3">
<div class="row">
<div class="col-12">
<div class="d-flex justify-content-between align-items-center py-3 border-bottom">
<div>
<small class="ms-1 fw-bold"><?= $output['post'][0]['board_name']; ?></small>
</div>
<? if ($output['user']['auth_flg'] && $output['post'][0]['member_seq'] == $output['seq']) { ?>
<div class="d-flex justify-content-between align-items-center" vv-if="output.user.auth_flg && output.post[0].member_seq == output.user.seq">
<a href="'./modify.html?post_key=<?= $output['post'][0]['post_key']; ?>" class="mx-1 btn btn-dark d-flex justify-content-between align-items-center lh-1"><small class="smaller d-none text-white d-md-block">Edit</small></a>
<a href="#" data-return-url="./list.html" data-post-key="<?= $output['post'][0]['post_key']; ?>" class="h-btn-delete mx-1 btn btn-dark d-flex justify-content-between text-white align-items-center lh-1"><small class="smaller d-none d-md-block">Delete</small></a>
</div>
<? } ?>
</div>
<h1 class="fs-3 mt-4 mb-4"><?= $output['post'][0]['subject']; ?></h1>
</div>
</div>
<div class="row">
<div class="col-12 text-start">
<div class="d-flex justify-content-start align-items-center">
<?= $output['post'][0]['create_date_type_mdhi']; ?> by
<div class="mx-2">
<? if ($output['post'][0]['avatar_url']) { ?>
<img vv-if="output.post[0].avatar_url" src="<?= $output['post'][0]['avatar_url']; ?>" style="max-width:1.5rem;"/>
<? } else { ?>
<i class="fas fa-user-circle"></i>
<? } ?>
</div>
<?= $output['post'][0]['reg_name']; ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div><p><?= $output['post'][0]['content']; ?></p></div>
<? if (is_array($output['post'][0]['tags']) && count($output['post'][0]['tags']) > 0) { ?>
<div class="d-flex align-items-center justify-content-start my-4">
<? foreach ($output['post'][0]['tags'] as $arrTags) { ?>
<span vv-for="tags in output.post[0].tags" class="badge bg-white border me-1 fw-normal text-hbnc-secondary me-2 px-3 py-2">
<?= $arrTags['tag']; ?>
</span>
<? } ?>
</div>
<? } ?>
</div>
</div>
</div>Related Links
User Discussions
ADD- There are no posts yet.