# Interaction among theme component, theme javascript, and "previews"

**URL:** https://meta.discourse.org/t/interaction-among-theme-component-theme-javascript-and-previews/190303
**Category:** Development
**Created:** [May 13, 2021, 12:36pm UTC](https://meta.discourse.org/t/interaction-among-theme-component-theme-javascript-and-previews/190303 "2021-05-13T12:36:50Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![david](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/david/32/157490_2.png) [@david](https://meta.discourse.org/u/david)
#### Post date: [May 13, 2021, 1:35pm UTC](https://meta.discourse.org/t/interaction-among-theme-component-theme-javascript-and-previews/190303/2 "2021-05-13T13:35:27Z")

</div>

Unfortunately there isn’t a javascript API for modifying the ‘excerpts’ of topics in the topic list. Theme components also do not have any access to server-side rendered content (i.e. emails) for security reasons. If you wanted to modify emails, you would have to use a plugin.

However, I wonder if we can solve this in a different way. Right now you are pasting something like this in the composer:

```html
<div data-custom="umbdv">/vmm/longstringhere</div>

```

Instead, you could do something like this:

```html
<div data-custom="umbdv" data-theme-longstring="/vmm/longstringhere">
  fallback content for emails/excerpts
</div>

```

Or if you’re feeling super fancy, you could use [the generic bbcode wrapper](https://meta.discourse.org/t/generic-bbcode-wrapper-for-theme-components/123516) to do it

```plaintext
[wrap=umbdv longstring="/vmm/longstringhere"]
Fallback content
[/wrap]

```

That will automagically generate a div like

```plaintext
<div class="d-wrap" data-wrap="umbdv" data-longstring="/vmm/longstringhere" dir="ltr">
<p dir="ltr">Fallback content</p>
</div>

```

Then you will need to tweak your theme component code so that it deletes the fallback content, and replaces it with whatever you want to show.

---

_[View the full topic](https://meta.discourse.org/t/interaction-among-theme-component-theme-javascript-and-previews/190303)._
