I have a channel that stores ads (HTML ads I created and the Google Adsense Code block), and displays either my html or Google's JS to allow a random ad on each page load. I want to insert that channel entry code from my Ad Channel in the middle of every post from my Article Channel – say after the 6th paragraph.
I could split the post entry field into two fields and do something like: " {postHalfOne}{adCodeSnippet}{postHalfTwo} ", but that doesn't allow for changing the breakpoint in the future.
Basic HTML can be inserted after a certain number of paragraphs via javascript, but it is my understanding that javascript can not be used to pass ExpressionEngine code. My test code works to insert HTML (fiddle), just not with my exp:channel:entries code. Can I change my code to work with EE or is JS the wrong solution here?