Hello,
I have a site with an iframe(projects.html) in it... The iframe is assigned the template "blank" so basically no template. The parent window has my default template. Is there a reason that the iframe is using its parents template? Even when i click inside of the iframe and do "show this frame only" it will open up using the wrong template... I know the template change is being saved because if i goto projects.html BEFORE i view the page with the iframe, it will show the correct template. I have cleared my cache tried it on other machines etc. and get the exact same results. So..... is there something special i have to do in order to use iFrames in modx?
-
MODX Staff
- 2,502 Posts
Can I ask why you are using an iframe for a document on your site? Why not put the content into a chunk and you can just put the chunk call into the document instead of using an iFrame. Typically people use iFrames to display remote web pages.
Since you are using an iFrame you need to give the iframe dimension (width and height) if you don’t it may expand to fill space that it shouldn’t.
Cheers,
Jay
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
Good question! I’m just converting a site that i did not originally do to use modx. I was just trying to make it a painless conversion... The iFrame has height and width set. The page loads in the iframe just as it’s supposed to, yet it uses the template of the parent. I suppose i could use a div and scroll it... But i’m not getting paid enough on this project to go through that... It’s using images to scroll the frame up and down and the code is already there to do that.
-
MODX Staff
- 2,502 Posts
You don’t need to code anything. You can just copy the source code of your browser into a new chunk and then place the {{newChunk}} in the document. That is not coding it is copying and pasting.
Otherwise it sounds to me like you are trying to show a document in a document and this may cause issues. Do you have a link to the result? The page with the iframe has to have a template of blank as well as the subdocument. Also make sure that you are clearing the cache.
Hope this helps.
Cheers,
Jay
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub
-
MODX Staff
- 2,502 Posts
Great. If you figure out what did it that might be good for someone searching the forums in the future.
Cheers,
Jay
Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup
magician.
Blog ✦
Twitter ✦
LinkedIn ✦
GitHub