Blog sprinkle for Userfrosting.
- Add the sprinkle
blog
to your sprinkles.json file. It should look something like below (you may have other sprinkles already loaded).
{
"require": {
"archey347/uf_blog" : "^v0.2.1"
},
"base": [
"core",
"account",
"admin",
"blog"
]
}
- Run Composer Update (Not As Root)
composer update
- Run the bakery migration to create the required database tables. Go to the root folder of your Userfrosting instance in a command line and run:
php bakery migrate
- If you have multiple sprinkles, you may need to change the side menu twig template.
To do this, open templates/navigation/sidebar-menu.html.twig
and edit the directory in the first line so that it extends the side menu template in one of the sprinkles rather than the main admin sprinkle.
The blog can be included into a webpage using an iframe, like below:
<iframe src="https://{{site.uri.public}}/blogs/b/{{blog_slug}}/view"></iframe>
Make sure to replace {{blog_slug}}
with the blog you want to display, or define it as a variable when you call the twig template engine on the main page.
The blog uses the CKeditor 5 to allow for basic formatting in blog posts
To change the formatting of the blog, edit the twig template at templates/pages/blog-view.html.twig
.
When the sprinkle is first installed, there are two permissions:
uri_blog_manager
uri_blog_manager_view
Both permissions allow access to managing the blogs, however, uri_blog_manager_view
gives only read access to the blog managment (This is useful if you want to allow somebody to add or remove posts to the blogs but not actually manage them).
For each blog, a read and write permission is created which can be used to control who has access. There is also a 'public' option which doesn't require an authenticated session to view the blog.
Please read the contributing guidelines.