# Custom OG/Twitter Metadata Image per Category

**URL:** https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313
**Category:** Feature
**Created:** [16 במרץ,‏ 2017,‏ 9:50pm UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313 "2017-03-16T21:50:47Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)
#### Post date: [17 בדצמבר,‏ 2018,‏ 8:11am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/21 "2018-12-17T08:11:55Z")

</div>

Should I rename the new column to `sharing_image_id` instead then? But also keeping this as sharing\_image\_id might make it look weird as compared to uploaded\_logo\_id etc. Also this is more of back-end naming since user anyway sees the translated value - `Category Sharing Image`.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 בדצמבר,‏ 2018,‏ 6:29am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/22 "2018-12-19T06:29:20Z")

</div>

> [@tgxworld](#):
>
> opengraph\_upload\_id

Isn’t this used for oEmbed as well?

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [19 בדצמבר,‏ 2018,‏ 6:43am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/23 "2018-12-19T06:43:53Z")

</div>

I’m not sure which model you’re referring to here ❓

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 בדצמבר,‏ 2018,‏ 6:50am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/24 "2018-12-19T06:50:51Z")

</div>

My concern is if this image is used for “sharing” in any context outside of opengraph, then the name falls down.

I guess we do not?

Honestly this is such an edge case of a feature it makes me uneasy even to have it. I would much prefer if we just re-thought a lot of this just did, long/square/tall/background category images vs dictate usage upfront. Then themes that want to make use of a tall category image can, and so on.

Anyway … the current name `uploaded_meta_id` can not stand, that just is mega confusing.. I also find `uploaded_sharing_id` somewhat confusing, and `opengraph_upload_id` not too confusing but long term limiting.

I just don’t know what the “right” thing is to do here, maybe just redo all image management on categories longer term, I don’t know.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 בדצמבר,‏ 2018,‏ 6:55am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/25 "2018-12-19T06:55:45Z")

</div>

> [@Patrick\_David](#):
>
> I occasionally post to twitter/facebook/google+ about posts _from that category_ . Right now, the social platform picks up the `default opengraph image url` and `twitter summary large image url` values and shows the images correctly. But they’re site-wide.

Maybe you missed this part from the first post @sam?

The issue is right now category URLs, when shared, have _no_ image metadata apparently. Which is odd because there are two images per category already:

 ![image](https://global.discourse-cdn.com/meta/original/3X/3/c/3caf1329bcad8240194f1c6268edc16723e7a88c.png)

- Category logo image
- Category background image

As to why one of these _existing_ images could not be used for the social sharing metadata, and why we needed a _third_ image here, I’m not really sure.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 בדצמבר,‏ 2018,‏ 7:17am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/26 "2018-12-19T07:17:21Z")

</div>

> [@codinghorror](#):
>
> As to why one of these _existing_ images could not be used for the social sharing metadata, and why we needed a _third_ image here, I’m not really sure.

Our default behaviour when sharing topics is just to fall back to one of the global images:

[https://review.discourse.org/t/dev-raise-error-if-search-term-length-is-less-than-required/798](https://review.discourse.org/t/dev-raise-error-if-search-term-length-is-less-than-required/798)

Which is a fine default IMO.

If we **unconditionally** fell back to category stuff would start looking like this:

This onebox:

> **[Opening network photo](https://discuss.pixls.us/t/opening-network-photo/10371)**
>
> I have tried and failed to open a photo on a network drive. I go to the file pane and click on the network drive and I see the file tree for my local umbuntu computer. What am I doing wrong.

Would unconditionally look like:

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/c/acdfcd69baee179b64420adf400aefbf0cc2fe8d.png)

Maybe we just thought about this whole feature completely wrong.

Maybe we simply allow people to **opt in** to using a category image as default sharing image. `When sharing topics in this category use category image as default`

Then we get rid of this extra image and confusing category setting.

- Upside far less confusing to name and explain

- Downside less flexible

I think offering fidelity here is important, cause it is legitimate to prefer to promote a forum image vs category image.

Also in all this mess we did not think through how “parent” categories would work in this case. Maybe you want all the subcategories to inherit this behaviour.

Honestly I think we should just revert this all for now and re-think what flexibility we want to offer here.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 בדצמבר,‏ 2018,‏ 7:19am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/27 "2018-12-19T07:19:41Z")

</div>

> [@sam](#):
>
> Our default behaviour when sharing topics is just to fall back to one of the global images:

No no no, you misunderstand. This is about one thing and one thing only: **sharing the category URL directly**. Scroll up and see:

> [@charleswalter](#):
>
> This is how **sharing a category currently looks**. Would be nice to also be able to overwrite the og:title, so instead of just Thalia for example, it could say something like “What’s the community saying about Thalía?”

So I think we should cancel all of this third category image stuff, I honestly didn’t pay much attention to this topic because it seemed so trivial, but now that I have I see what I was originally thinking:

Re-scope this request to simply add proper metadata for the EXISTING category image when sharing a category URL. That’s it. That’s all. That is why it is a starter task!

This whole third image thing was never meant to happen, the first post kinda got us off track.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 בדצמבר,‏ 2018,‏ 7:24am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/28 "2018-12-19T07:24:51Z")

</div>

Yeah the OP is asking for something different:

> [@Patrick\_David](#):
>
> I occasionally post to twitter/facebook/google+ about **posts _from that category_**. Right now, the social platform picks up the `default opengraph image url` and `twitter summary large image url` values and shows the images correctly. But they’re site-wide.

Which to me reads like David wanted **ALL** topics from that category to fallback to using the category image as the first fallback.

I agree, revert all of this stuff.

[https://forums.gearboxsoftware.com/c/battleborn-open-beta](https://forums.gearboxsoftware.com/c/battleborn-open-beta)

Can I guess look like:

 ![image](https://global.discourse-cdn.com/meta/original/3X/e/8/e867322a7630d3a8f7f8b243eed25c7424b061c4.png)

And this is the ONLY scope of the change.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 בדצמבר,‏ 2018,‏ 7:26am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/29 "2018-12-19T07:26:23Z")

</div>

> [@charleswalter](#):
>
> For now, was just thinking the category link. That will go far. I don’t think we want to get into impacting behavior on topics from the category, though it’s not a bad idea.

This was my thinking, the first post is rather muddied in what it is proposing.

Right now category links show the site-level logo (and possibly other metadata?) which isn’t good. Category links should show category metadata.

It is not a _terrible_ idea to have topics with no images, when shared via opengraph etc fall back to the _category_ image rather than the _site_ image as well..

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [19 בדצמבר,‏ 2018,‏ 7:32am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/30 "2018-12-19T07:32:07Z")

</div>

> [@codinghorror](#):
>
> It is not a _terrible_ idea to have topics with no images, when shared via opengraph etc fall back to the _category_ image rather than the _site_ image as well…

It’s not a terrible idea but it complicates things and presents lots of questions:

- Is this configurable? What if you prefer promoting your site logo vs a category logo which may, for example, just be a picture of a bug or something else generic.

- What about subcategories, is this behaviour inherited to all child categories, eg: [Forums](https://discuss.newrelic.com/c/support-products-agents) has a gazzilion child categories (and a generic problem image imo, so it highlights multiple issues)

- What about resolution, what if you want a square image vs a very wide image you use for your categories.

So even though I don’t think it is a bad idea… I do think it is a very very complicated idea.

---

<div class="post-metadata">

### Author: ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)
#### Post date: [19 בדצמבר,‏ 2018,‏ 8:22am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/31 "2018-12-19T08:22:45Z")

</div>

Just to add, the third image was added because the request mentioned this:  
`I know that the projects would love to be able to control this branding themselves possibly. Perhaps as another image option on the category settings? Maybe as a “Category Metadata Image”?`

> [@codinghorror](#):
>
> Right now category links show the site-level logo (and possibly other metadata?) which isn’t good. Category links should show category metadata.

I agree with this and I think this was the purpose of this request and pull request.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 בדצמבר,‏ 2018,‏ 9:27am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/32 "2018-12-19T09:27:58Z")

</div>

As @sam indicated we don’t want any new images at this time. Use the existing category image.

---

<div class="post-metadata">

### Author: ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)
#### Post date: [19 בדצמבר,‏ 2018,‏ 10:16am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/33 "2018-12-19T10:16:17Z")

</div>

I can change it to use category image and metadata. No issues 🙂

But I think customers wanted ability to customize the image that is shared to social platforms. For example:

> [@charleswalter](#):
>
> Wanted to lift up this topic. Often the image for the category is a specific size that suits the top of the category. However, I’d like to propose that the category og:image could take the og:image associated with the About the category topic.

Should we ignore this for now then? Because it can happen category image might look good at top of category but when shared via other platforms, it doesn’t work well.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 בדצמבר,‏ 2018,‏ 10:24am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/34 "2018-12-19T10:24:09Z")

</div>

> [@saurabhp](#):
>
> Should we ignore this for now then?

For now, yes we should ignore it. All we want is “better than what we have” and right now categories don’t even use their own images in the opengraph / oembed meta tags.

---

<div class="post-metadata">

### Author: ![Patrick\_David](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/patrick_david/32/119657_2.png) [@Patrick\_David](https://meta.discourse.org/u/Patrick_David)
#### Post date: [19 בדצמבר,‏ 2018,‏ 1:22pm UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/35 "2018-12-19T13:22:20Z")

</div>

I’m terribly sorry for any confusion! (I failed at effectively describing a feature request and am shamed 🙂 ).

> [@codinghorror](#):
>
> categories don’t even use their own images in the opengraph / oembed meta tags.

This was literally all I was looking for.

I really only meant that when linking _a category directly_, such as: `https://discuss.pixls.us/c/software/rawtherapee`  
that the category logo would be used, or the background image (or possibly a third option specifically for this use).

This wasn’t about _topics_ in the categories (the current behavior is great - using the image from the first topic post). This is only for links directly to categories (or subcategories).

[edit] - The only other possibility I was considering was if a topic in a category doesn’t have an image in the first post, it might be possible to use the same category logo/image, but this wasn’t necessary - just a nice to have.

It could even have been a single checkbox to allow use of the existing logo for this purpose.

I’m super sorry for any confusion. ☹

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [19 בדצמבר,‏ 2018,‏ 10:13pm UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/36 "2018-12-19T22:13:34Z")

</div>

No worries! I wasn’t blaming you at all. We at Discourse should have been more clear what the actual starter task was!

---

<div class="post-metadata">

### Author: ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)
#### Post date: [21 בדצמבר,‏ 2018,‏ 6:12am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/37 "2018-12-21T06:12:45Z")

</div>

> [@codinghorror](#):
>
> As @sam indicated we don’t want any new images at this time. Use the existing category image.

Final question hopefully 🤞 - should we use a category background image or category logo image? Or some sort of priority that if logo not present than background image?

I have made the change to use the logo image. I will make the change in code if we need to use other image.

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [21 בדצמבר,‏ 2018,‏ 6:13am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/38 "2018-12-21T06:13:49Z")

</div>

Why in the world would we use the background image???

---

<div class="post-metadata">

### Author: ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)
#### Post date: [21 בדצמבר,‏ 2018,‏ 6:17am UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/39 "2018-12-21T06:17:52Z")

</div>

I don’t know 😅 I m not sure where people share the category link.

Noted - to use logo image.

---

<div class="post-metadata">

### Author: ![saurabhp](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/saurabhp/32/125182_2.png) [@saurabhp](https://meta.discourse.org/u/saurabhp)
#### Post date: [12 בינואר,‏ 2019,‏ 5:23pm UTC](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313/40 "2019-01-12T17:23:26Z")

</div>

This topic can be closed. PR is merged. 😄

[Previous page](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313.md?page=1)

[Next page](https://meta.discourse.org/t/custom-og-twitter-metadata-image-per-category/59313.md?page=3)
