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

Stranger Pings
Stranger Pings

Hi there,

I have made a simple plugin that uses 2 models. 1 is Posts and the other is Categories.

In the posts model I have

ID, title, content, image, is_published 
and I have set a $belongsTo relation to the category which has
 ID, name,  image

I have then made a component and can loop the contents of Posts. My question is how do I go about creating a url for each post and also list categories in the frontend which then link to posts by that category?

Thanks for reading i'm a bit lost on where to go from here.

Last updated

programmieraffe
programmieraffe

Hi,

I'm very new to OctoberCMS, but I think you could do the following:

Check out the code for the blog plugin - there should be a solution for this problem. https://github.com/rainlab/blog-plugin

Best regards, Matthias

1-2 of 2

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