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

Scott
Scott

I've been experimenting with these technologies for a while now, and I've finally hit something I'm happy with! This repo provides the scaffolding for an October SPA theme.

https://github.com/scottbedard/oc-vuetober-theme

With this, here are just some of the tools we can take advantage of...

Last updated

Crazymodder
Crazymodder

Hi Scott,

Wow thats looks really great. Thanks for sharing thats a great starting point:)

Regards Crazymodder

amdad
amdad

Wow, that's cool! Thanks for sharing.

There are any limitations? Some cons in compare to traditional themes?

Last updated

Scott
Scott

@amdad the only downside I can think of is it might take a bit more work to integrate with plugins. Since we aren't using any of October's front end tools, we'll need to make json apis to communicate with them.

Last updated

amdad
amdad

So every plugin we want to use, need additional API layer (plugin) to JSON output? Static Pages component is supported by default?

Scott
Scott

If it's a plugin that is used by the frontend, then yes we'll need to make an API for it. The reason for this is that we aren't using components. Our pages are almost entirely rendered by Vue, not by October. Backend-only plugins can still be used the same as they normally would.

amdad
amdad

Of course, backend here have nothing to do, because it's only frontend theme ;)

So all of this is JSON API driven. Do you plan to keep it like this? Or maybe there is a way to integrate this with existing component output in some way? As I guess it's a little bit more work with creating JSON request for each component. If plugin is advanced so API will be a lot of work, right?

Last updated

Scott
Scott

It might be possible to integrate with October's front end tools, I believe that's how the old Angular plugin worked. As for this approach, Vue expects it's data to be plain javascript objects. So if we have the server returning JSON, we can simply chuck it in our data and we're off and running :)

https://github.com/scottbedard/oc-vuetober-theme/blob/master/template/src/pages/blog/index.vue#L43

As for the complexity of making API plugins, it's really not that bad. For the blog api, all I did was register a route and execute a query. I suppose it might get complicated for a huge plugin with lots of moving parts, but even that isn't so bad. Basically all you need to do is move the logic from a component to a controller, and register the route.

Last updated

ribbsousa
ribbsousa

Hello!

This theme can now be used in a project, or is still developing?

Thanks! great job

Scott
Scott

@ribbsousa Go ahead and use it in projects, I have been for a while now. I don't expect to make any big changes to this until Vue 2.0 is released.

1-10 of 10

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