I’m trying to port my current blog over to Ghost. One of the features I have on my blog right now is the option to add a custom hex colour code to my post, which is then used in a custom <style> tag on the Post page.
Is it possible to do something like this with Ghost? I don’t need any fancy editor features like a colour picker, just a key/value input that I can use in my handlebars templates.
Ghost doesn’t have custom fields in the same way, but it does have a codeinjection_head and foot block as well as an HTML card - so you can include your custom styles into any of those.
I’ve migrated sites in the past that did exactly what you describe, and we just put the <style> block directly into codeinjection_head. It works the same but without a specific UI
Yup, tags have an accent colour and I use those colours in my theme. But posts don’t.
I solved it by calling a JS function with the post colour in the codeinjection block (because it needs to apply a bunch of styles and calculate the proper values based on the given colour). Still, this seems like something that should be applied on the backend rather than the frontend.
Ghost doesn’t have custom fields. If you want to request it, there’s an ‘Ideas’ category for that. :) I can’t move your post, but feel free to start a new one there, explaining what you want custom fields for.
I’m not the Ghost dev team, but I generally think that being really focused on blogging and newsletters is a strength of Ghost. The data model is absolutely intended for blogs/newsletters, not other types of content like products (your example). Custom fields would definitely be useful, but they might also be a distraction from the core mission of being an awesome blogging and newsletter platform. If you really need custom fields and can’t figure out a workaround*, you might want to consider a different platform.
Tags can be a good way to add some extra organizational content to your posts, but without knowing what you’re trying to accomplish, I’m not sure if that’s a good fit for you or not!
For example I only need comments, likes and authors follows. I can do it separately inside the db ant then create custom controllers to CRUD these data. But problem is, how I can attach to main post object one of these data? How to extend the post object?
ANother solution may be using apis, so basically creating small components that fetches api, but don’t thik is a good idea because too many requests.