Hi Thomas,
When you say "the page sitemap", are you referring to the specific X3 sitemap XML page?
https://demo.photo.gallery/sitemap/
Before I give a direct answer, I would like to inform that modal-type plugins (like X3 modal) can load external content by AJAX, but this is meant to be pure
fragments of html, loaded and injected into the modal/popup element for display. The loaded content however, is
not meant to be
full standalone pages (like the sitemap you are referring to), because they include full page code (<html> <body> <style> <script> etc). After Ajax loads a
full page like that, it can't simply "inject" a "full page" into an existing element (modal) on your page. Thus, the highly preferred Ajax method cannot be used to load "full pages".
Iframe
Thus, if you want to load a
full page into either the X3 modal or the X3 popup, this will have to be done with the less elegant <iframe> method, instead of AJAX.
Modal Iframe
Since you can't use built-in Ajax methods, you would have to load the given page into an <iframe> container inside the modal element. The problem with <iframe> content (unlike content injected directly into the page from ajax), is that you don't really know the height, so you just need to set a fixed height to the iframe container. The following code would work:
<button data-reveal-id="modal_id">sitemap in modal</button>
<div id="modal_id" class="reveal-modal" data-reveal aria-hidden="true" role="dialog">
<iframe src="https://demo.photo.gallery/sitemap/" width="100%" frameborder="0" style="height:400px;"></iframe>
</div>
Not sure X3 modal is a better choice than the X3 popup though ...
X3 Popup
When loading an external URL into X3 popup, it will automatically use <iframe> method. Additionally, it will always set the height to 100% viewport height. You have already tried this and technically got it working ...
Thomas wrote:I also tried using data-popup but every other line has a black background and so not very readable ...
This can be solved by adding your own custom CSS to your X3 popup. The
data-popup-class setting is already touched upon in
https://demo.photo.gallery/examples/plugins/popup/:
<!-- Use the data-popup-class to define your own custom CSS wrapper class for the popup. Useful if you want to define your own CSS rules for popup-content or popup-links. -->
<a data-popup-content="Howdy! This content is wrapped inside an element with a <em>custom_css_class</em>." data-popup-class="custom_class">Custom</a>
Let me know if you need help to create a custom popup class that would be more appropriate for loading the sitemap page on top of. Basically it would require a light background, since that is what the standalone sitemap page is based upon.