Satyajit Flagrow ads extension allow us to show ads in- between posts. But I want to put ads/HTML gadgets in discussion post, I mean just after the first or second paragraph. How's that possible? Please help.
Shahiem Satyajit You have to make a custom extension for that and extend the discussion posts with JavaScript. https://flarum.org/docs/extend/start/ import { extend } from 'flarum/extend'; import Post from 'flarum/components/Post'; app.initializers.add('acme-hello-world', function() { extend(Post.prototype, 'view', function(vdom) { vdom.children.push(':D'); vdom.attrs.style = 'background-color: yellow'; }); })
clarkwinkelmann hgence it's not an easy task, it requires direct DOM manipulation and knowledge of Mithril and TextFormatter to pull off. If you are developing such an extension and are having difficulties, can you share some of the code you need help with?
hgence clarkwinkelmann I am not a dev, but isn't this https://s9etextformatter.readthedocs.io/Plugins/HTMLElements/Synopsis/ the way to make it compatible
clarkwinkelmann hgence I was assuming the OP wanted to automatically insert ads inside the user-generated content, not allowing the user-generated content to include user-provided HTML. Maybe you can describe what you're looking for in more details than the OP did?