The basic challenge: I have a 'normal' custom query, e.g. of news posts from a certain category and want to add in several elements (CTAs, generally speaking) at every nth position, while the loop of cta_elements (see below) is being repeated when more news posts exist than cta_elements could fill up. HTML example below, with a CTA element after every fourth (news) post:
<div class="news_list">
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="cta_element" id="cta_1">Some different content</div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="cta_element" id="cta_2">Some different content</div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="cta_element" id="cta_3">Some different content</div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<div class="news_item"></div>
<!-- 1st CTA again, since there are only 3 CTAs, but more posts in news query. -->
<div class="cta_element" id="cta_1">Some different content</div>
...
</div>
This means in fact that a query would have to be 'paused' in order to insert single elements of another type/loop (generally speaking), which themselves repeat once there are not enough cta_elements elements that could fill in at every further nth position (see example above).
Ideally, the cta_elements would be widgets from a custom widget area, so the user can add a) add different kinds of predefined 'widgets' to the list of cta_elements to be inserted and b) order them according to their wishes with a simple drag'n'drop and c) could have different widget areas for different loops, e.g. front page CTAs, archive page CTAs, author archive page CTAs.
Alternatively, one could possibly go with letting out the complications widgets possibly introduce and use a custom post type (and use categories in order to have different loops on different archive pages).
Is there any way of solving this in a simple way? Pardon me if the question itself is too complex and should be subdivided into several questions. I still want to find the most user-friendly and efficient way to solve this.