Anything like api.decoreateCooked() for topics displayed via Page Publishing?

Is there anything analogous to api.decorateCooked() for Page Publishing display of a topic?

I have some j/s in a theme component which is called by using api.decoreateCooked(). Works great. But when I view the topic via Page Publishing, the j/s doesn’t get called. So I’m assuming that api. method doesn’t apply.

Here’s a topic that shows it in action. Everything you see below the “Upcoming Events” H1 is not actually in the topic. That content is added into the DOM dynamically.

https://forum.podcaster.community/t/podcaster-community-calendar/123

Here’s that same topic using Page Publishing. The stuff in the yellow box (local CSS rule styles the div explicitly) is what is literally in the topic. When it’s “cooked” the j/s replaces the DIV (see below) with other DOM elements…

https://forum.podcaster.community/pub/calendar

So you can see what’s going on, here’s the actual DIV in the topic. The j/s in the theme component spots DIVs like this one and modifies the DOM.

<div data-custom="umbconn" data-umbconn="/vcalendar">

A list of calendar events appears here if viewed on the Podcaster Community forum at https://forum.podcaster.community/t/podcaster-community-calendar/123

</div>

oh, crud, Page Publishing - #76 by pfaffman

Hi Craig :slight_smile:

You may be interested in this alternative:

Be aware of this though:

1 Like

I’m using j/s to insert things into the DOM. I’m asking if it’s possible to fire some j/s from a component, on Page Publishing pages…

1 Like

I understood that and I’m aware that published pages don’t load theme components; that’s why I proposed an alternative that, of course, may not fit everyone for various reasons. :slight_smile:

(my sentence was badly worded though, I’ll change it)

1 Like