archey347/uf_blog

Blog Sprinkle for Userfrosting

Installs: 91

Dependents: 0

Suggesters: 0

Security: 0

Stars: 5

Watchers: 2

Forks: 2

Open Issues: 6

Type:userfrosting-sprinkle

v0.2.2 2023-02-26 03:34 UTC

README

Blog sprinkle for Userfrosting.

Screenshot of Blog and Dasboard

Installation

  1. 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"
	]
}
  1. Run Composer Update (Not As Root)
composer update
  1. 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
  1. 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.

Using The Blog

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.

WYSIWYG Editor

The blog uses the CKeditor 5 to allow for basic formatting in blog posts

Blog Formatting

To change the formatting of the blog, edit the twig template at templates/pages/blog-view.html.twig.

Permissions

When the sprinkle is first installed, there are two permissions:

  1. uri_blog_manager
  2. 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.

Contributing

Please read the contributing guidelines.