Custom fields for posts

For example, to have caption for the featured image (using <figcaption> in the theme with the custom field), and many other possible things.

It’s currently a feature tagged “later”, with the author of the above issue offering to work on it.

I would go even further than custom fields and say that Ghost could use custom content types (ideally with an admin interface to add them, on a concept similar to pods.io for WP)…

I think this would be the feature that will allow Ghost to move beyond just a publishing platform for blogs and become truly a platform for journalism as it would allow small and medium sized publishers to build their websites by offering them a flexible content structure.

Just my 2 cents :wink:

12 Likes

The Custom Post Type that is now available on Wordpress is pretty much a work in progress for Ghost too. Check this out:

I’ve seen that, but I guess I only browsed it as I was left with the impression it’s only about homepage and categories.

An input or similar to allow the automatically generated canonical URL to be overridden on a per-post basis.

3 Likes

As far as I know this feature exists. While editing your post click the gear icon in the top right -> change the text under Post URL

Correct, but to be more specific the desire is to be able to change the canonical URL independently from the post URL. The posts from my pre-imported-to-Ghost blog were under the slug /blog/year/post-title, but after the import I now have them at /post-title. If I could change the canonical URLs independently then I could recoup the share stats associated with those old URLs.

2 Likes

I came looking for exactly this. I run a few different blogs with some slight overlap in content and would like to edit canonical urls for cross posting purposes. It would be great as a built-in input underneath “Post URL”.

1 Like

A lot of really good blogs do link posts, a great example being Daring Fireball.

Currently, Wordpress has an easy plugin for this, which can be found here. Unfortunately, Ghost has no easy way to do this (without hacking together something in the core services). Even looking online, there seems to be one blog post talking about how you might achieve this, but it’s from years ago.

I was wondering if this was ever going to be a native feature to Ghost?

2 Likes

I hope so. It’s a small feature, but definitely not a trivial one if you’re involved with more than a single blog.

:bulb: As of Ghost 2.17.0 it’s now possible to override the default generated canonical URL. You can find the setting under the meta data section of the post/page settings menu.

Awesome, thanks for the canonical feature, been looking forward to it for a while! Unfortunately I seem to have come across two bugs though.

Bug #1, https vs. http: Prior to using Ghost my old blog didn’t have a certificate and used plain old http. My current Ghost blog of course uses https. When I went to add one of my old post URLs it seemed fine, but as soon as I selected outside of the canonical box the s got automatically added in to the end of the http, which then became https. I nonetheless checked the live post to see if the old canonical stats came through, but they unfortunately didn’t. I then checked out and tested Facebook’s debugger page to see if there was any difference between the http and https URLs, and there in fact was. Any chance that the automatic s addition can be undone?

Bug #2, saving is kinda wonky: I decided to leave said post by clicking on < Posts after those tests, but couldn’t do so properly. That is, I got the “Are you sure you want to leave this page?” box. I re-saved, but when trying to exit I still got the box (as you can see at the bottom left of the image below the post is definitely saved, but I can’t leave the page without the warning box appearing).

I tried opening up a different post, made regular adjustments, saved it, and could exit the post via < Posts regularly. However, I then tested the canonical feature again with a different post: I adjusted the canonical URL, saved the post, tried clicking on < Posts, but couldn’t exit the post without the warning.

I don’t think it’d make a difference, but I’m using Firefox 65.0.2.

Hi @Stromfeldt! Thanks for testing new feature out! These are really awesome findings :slight_smile: Could you please share more details about where is your old blog hosted (meaning same domain but only different protocol, or is it run on a subdirectory/subdomain)?

I suspect the issue with http → https conversion comes from the fact that your old blog was served under the same domain and now there’s no way to distinguish for new Ghost blog (other than protocol) which makes it harder to distinguish which URL’s should be treated as local and which ones are external (like your old blog instance).

Just for more context, Ghost transforms all local absolute URL’s to relative and stores them in the relative form in the db. The reason for this is when the blog is migrated to a different domain local URL’s keep working.

Sure thing! My blog and its posts used to be at http://domain.com/blog/year/post-title, and they’re now at https://domain.com/post-title, with the “domain.com” portion being the exact same.

@Stromfeldt if you’ve moved your blog posts and have 301 redirects set up then you should not be trying to set the canonical to point at the “old” URL, that’s a misuse of the canonical tag and will hurt your SEO, the canonical should be left as the default so that your posts are self-referencing.

2 Likes

Hello @naz, thanks for the explanation! However, I think I may have left out the intention behind my intended usage of the canonical function in that long screed of mine. As I stated in another comment I left in this topic last year,

This link mentions a bit about transferring one’s old share stats from a http URL to a https URL, but it requires one to be able to temporarily change the canonical URL to http in order to get it to work – which is exactly what my “Bug #1” was stating that I can’t currently do. Is there any way that the http syntax (rather than just https) could be allowed in the canonical input box?

p.s. I’ve now updated to version 2.18.1, and for whatever reason the “Bug #2” I mentioned is no longer occurring. :smile:

It’s not related to canonical tag, I’m still trying to track it down but as you’ve experienced it’s not consistent at all so it’s a difficult one to pin on anything in particular.

Any update on whether you can add custom fields to posts yet, or if this is in development?

4 Likes

Canonical url is automatically converted into the same protocol your Ghost instance is using if it detects same domain. If your preferred option is https why not point from old http posts to new https ones?

If you still really need to point backwards to http, the only way would be modifying canonical_url field for those posts on db layer (note saving that post from admin UI will override the protocol back to https)

1 Like

I don’t understand why this hasn’t been added yet. Custom fields is a feature that was added to WP ages ago.

4 Likes