Closed dlopez closed 7 years ago
If I understand your question properly, when you install canvas using the command line, you are simply running an install wizard that will get some inputs (it'll ask you for an email, a password and some other details) and configure your blog. It creates the config/blog.php file, and adds the info to the database. To autoload will simply refer to the vendor files without needing to clone anything.
On how to customize the built-in views and create a theme, however, I'm still trying to figure it out. I noticed that for creating your own theme and having it picked up automatically, it needs to be located in the vendor/cnvs folder and be prefixed canvas-theme. I'm really not sure about this. I'd like to see this handled differently to be honest.
Good questions @dlopez @PatrickJoannisse. You're pretty spot-on with the description of what is going on in the backend during the installation.
As far as themes are concerned, right now they are kept in the cnvs
organization repo, added to Packagist from there by me, and then you'd be able to require them and start using one. Definitely open to other ways of doing it if you guys want to suggest some.
@dlopez Canvas views and controllers are loaded from the core package (Easel) [/vendor/cnvs/easel/], this is the correct behavior.
/app/Http/Controllers
as per a regular Laravel install. /resources/vendor/canvas
.
Note: Any customization to views may be overwritten when you change themes so I suggest building your customizations into a theme.@PatrickJoannisse anyone can create a canvas theme. Its composer.json
needs 2 special properties to be picked up automatically as a canvas theme:
Example composer.json:
{
"name": "someone/mytheme",
"description": "Theme for Canvas.",
"keywords": ["canvas", "theme"],
"type": "canvas-theme",
"license": "MIT",
"authors": [
{
"name": "Someone",
"email": "someone@some.site"
}
],
"extra": {
"canvas-theme": {
"title": "MyTheme",
"directories": {
"public": "public",
"views": "resources/views"
}
}
}
}
You may use the following repository as a starting point to create your theme: https://github.com/cnvs/canvas-theme-paper
Official theme documentation is coming soon...
@reliq Thanks for the quick breakdown of how to create a theme. Definitely, the documentation would help. We all hate writing it but I guess somebody has to ;)
You're welcome @PatrickJoannisse. It's coming soon 😸
I've installed canvas, and wanted to customize certain views and add functionality to the posting. But after running the
php artisan canvas:install
command, and setting everything up. I didn't see the library clone over the built in views, controllers, etc. Was this supposed to happen? If not, then I have some questions.Customize the built in views; Were we supposed to clone over the built in views from
/vendor/cnvs/easel/resources/views/*
?Expand functionality; Same question as above but with the controllers from
/vendor/cnvs/easel/src/Http/Controllers/*
?