This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

rts
rts

I'm currently in the process of making a plugin for my October website. However, I've got a couple of questions.

The plan for my plugin is when people visit /mycustomroute/id, it will process that ID and make a HTTP request to fill the page with content from that HTTP call. I'm currently using routes to do this as explained here and pull the information.

How do I go about integrating the results into my custom theme? In other words, I'd like this page to look like the rest of static pages that I've added on the website. I presume it's something to do with rendering a view as the response but I need it to also use a custom layout that I've made.

Any help and advise on best practises for this kind of thing would be greatly appreciated.

mjauvin
mjauvin

How do you render the page currently? Can you show some code?

Last updated

yfktn
yfktn

rts said:

I'm currently in the process of making a plugin for my October website. However, I've got a couple of questions.

The plan for my plugin is when people visit /mycustomroute/id, it will process that ID and make a HTTP request to fill the page with content from that HTTP call. I'm currently using routes to do this as explained here and pull the information.

How do I go about integrating the results into my custom theme? In other words, I'd like this page to look like the rest of static pages that I've added on the website. I presume it's something to do with rendering a view as the response but I need it to also use a custom layout that I've made.

Any help and advise on best practises for this kind of thing would be greatly appreciated.

I think you need to create component in your plugin to achieve this. You can check how RainLab.Blog components using parameter variable at the theme page to load, as example: the list of the blog. With this, whatever URL you used in your theme, as long as your component able to get the ID of current page, it would render records data from your plugin.

1-3 of 3

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.