I'm trying to get a page's content dynamically so I can open in a modal. What's the best way of getting the html from a page given an ID/page url?
1 Answer
I like the suggestion which is provided by @jammykam. To fit to your requirements I would create a new device and there you can create your own layout for that specific modal.
You can create your device under /sitecore/layout/Devices
:
Then your new device will apear in the Layout Details:
Then you can access to the device related rendering defintion through the following url: http://[url]?sc_device=modal
-
2Exactly how we do things too. We typically create a slimmed down layout file specifically for modals too.– jrapCommented Jan 12, 2018 at 13:54
src
property rather than scraping HTML from Sitecore...?