Search code examples
laraveloctobercmsoctobercms-backend

Open/Create blog post page on OctoberCMS


I used this link: Hide content of blog posts when displaying blog post list in OctoberCMS?

as a tutorial to create a new plugin and show my blog posts by my own style (just post title, date, etc)

But now I need to show the full content of the post. I've migrated from wordpress, where each post creates a new page automaticaly. Does OctoberCMS do the same thing? If yes, how can I relate the post title to the post page. (if not I'll create a "read more" link and show the content on the same page, but, if the users get redirect to the post page, it would be great!)

thanks! Regards


Solution

  • October CMS is not like word-press, To make posts you need actual plugin and with in that plugin you can add models/tables for you post data

    Then you need to create components which can show your records to front-end.

    If you are not using rainlab-blog plugin then you need to do this stuff

    So basically you need to create this things :

    Page where you want to list all post and then add listposts component which will show list of posts (you need to make it manually) then for that component you need to pass single post detail page

    For single post again you create new page add another component which can read slug and show respective post data

    For redirection from post list to single post you need to create link as you are passing single post detail page to component you can create link with slug and redirect to single post page

    For better reference check out https://octobercms.com/plugin/rainlab-blog plugin and read its documentation and code

    Then you understand how things works.

    Its kind of pain to do thing manually as you are coming from wordpress, But it will give you more control and more flexiblity

    Once you made your plugin you can fully Extend it and reuse it as you want.

    if any doubt please comment.