Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title = "Blog Post"
- url = "/:slug"
- layout = "default"
- description = "Viewing a single blog post"
- is_hidden = 0
- [blogPost]
- slug = "{{ :slug }}"
- categoryPage = "blog/category"
- [resources]
- less[] = "pages/blog.less"
- ==
- function onInit()
- {
- $slug = str_replace('.html', '', $this->param('slug'));
- $this->addComponent('blogPost', null, ['slug' => $slug]);
- }
- ==
- <?php
- function onEnd()
- {
- if ($this->post) {
- $this->page->title = $this->post->title;
- }
- else {
- return Redirect::to($this->pageUrl('404'));
- }
- }
- ?>
- ==
- {% set image = post.featured_images.first %}
- {% set nextPost = blogPost.nextPost %}
- {% set lastPost = blogPost.previousPost %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement