<p>Load the entries into a div then create several buttons to change the width of the div, or use JS to resize the div. Thus showing your users what happens to the responsiveness of the design at different widths. It doesn't need to be a iframe. Or just send them to a template with a UI element showing them to resize the browser.</p>

CC BY-SA 3.0
2015-03-12T01:16:00.400Z
OK I'll try out using just a div. I see most of the examples showing within an iframe but since I'm using the same css for examples I guess this makes sense.
julzmon
CC BY-SA 3.0
2015-03-12T17:44:44.867Z
Nope that doesn't work because the div will not trigger a media query only the browser window and I guess that's why it has to be contained in an iframe.
julzmon
CC BY-SA 3.0
2015-03-12T21:46:16.523Z
Then create route in the CP to a specific url. Output those entries in the specified template of that route. Then use the url of the route to load in your iframe.
a-am
CC BY-SA 3.0
2015-03-17T16:11:37.537Z
I'm not sure what you mean by "Then use the url of the route to load in your iframe." Could you please expand on that?
julzmon
CC BY-SA 3.0
2015-03-17T19:35:24.067Z
When you create a route in the CP you are creating a url to a page. A page with a specified template.
a-am
CC BY-SA 3.0
2015-03-18T17:58:18.337Z
Yes I understand what routes are but not sure I understand how to pass the url to the iframe.
julzmon
CC BY-SA 3.0
2015-03-19T16:31:47.470Z
Sorry, use the src tag for that route.  <iframe src='route/url'>   That will show load those items into the iframe.
a-am
CC BY-SA 3.0
2015-03-11T17:26:38.837Z
2015-03-11T17:26:38.837Z
a-am
<p>I'm trying to showcase some responsive code and would like to create entries just with that code example. I would like them to appear in a template that has some js to resize an iframe and show responsiveness of the entry.</p>

<p>Any thoughts on how I can accomplish this?</p>

CC BY-SA 3.0
2015-03-11T16:03:59.080Z
I'm finding it a bit hard to understand what you're really asking here, or how its related to Craft specifically. Can you rephrase or perhaps give an example in pseudo-code of what you want to achieve?
Mats Mikkel Rummelhoff
<templating>
How would I pass an entry URL to an iframe in a template?
# How would I pass an entry URL to an iframe in a template?

(Asked by: username_0 on 2015-03-11)

I'm trying to showcase some responsive code and would like to create entries just with that code example. I would like them to appear in a template that has some js to resize an iframe and show responsiveness of the entry.

Any thoughts on how I can accomplish this?

**Tags:** templating
> **Comments:**
> **username_1**: I'm finding it a bit hard to understand what you're really asking here, or how its related to Craft specifically. Can you rephrase or perhaps give an example in pseudo-code of what you want to achieve?  

---

## 1 answers

### Answer by username_2 on 2015-03-11. Score: 2

Load the entries into a div then create several buttons to change the width of the div, or use JS to resize the div. Thus showing your users what happens to the responsiveness of the design at different widths. It doesn't need to be a iframe. Or just send them to a template with a UI element showing them to resize the browser.

> **Comments:**
> **username_0**: OK I'll try out using just a div. I see most of the examples showing within an iframe but since I'm using the same css for examples I guess this makes sense.  
> **username_0**: Nope that doesn't work because the div will not trigger a media query only the browser window and I guess that's why it has to be contained in an iframe.  
> **username_2**: Then create route in the CP to a specific url. Output those entries in the specified template of that route. Then use the url of the route to load in your iframe.  
> **username_0**: I'm not sure what you mean by "Then use the url of the route to load in your iframe." Could you please expand on that?  
> **username_2**: When you create a route in the CP you are creating a url to a page. A page with a specified template.  
> **username_0**: Yes I understand what routes are but not sure I understand how to pass the url to the iframe.  
> **username_2**: Sorry, use the src tag for that route.  <iframe src='route/url'>   That will show load those items into the iframe.  

---

