Customizing the Embed Template

Hi, I’m using the embed feature to load posts form my blog.

When this comes through to Discourse, it displays the following line wrapped in a ‘small’ tag: “This is a companion discussion topic for the original entry at LINK”

I’d like for this to be wrapped in an ‘h4’ tag instead and say something like “Read the article: LINK”

Any ideas how I could accomplish this? Thanks for the help.

1 Like

To wrap the text in an h4 tag would require a plugin. The tag is set in the TopicEmbed::imported_from_html method. You would need to re-open that method in a plugin to change the tag.

You can change the text content that is displayed from your site’s Admin / Customize / Text section. Search for embed.imported_from.

If you just want to make the text larger, you could try making the change with CSS. Either override the text size for all small elements on your site, or try to target the imported_from text with something like this:

.cooked hr + small {
    font-size: 16px;
}
3 Likes

This is all very helpful, thanks Simon. I’ll give it a go :slight_smile:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.