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

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:

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

Instead, you could do something like this:

<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 to do it

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

That will automagically generate a div like

<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.

8 Likes