Iframe in Tempate – how to?

Notice: This thread is very old.
Pitt
Member | 6
+
0
-

I would like to have an Iframe in template. That iframe should contain an article which ID and other variables should be pass in src.

I have tried it as a signal but obviously it rendered whole page inside of that iframe.

Any idea?

nanuqcz
Member | 822
+
0
-

Hello,

  1. first, you have to create iframe in template with correct URL
<iframe src="{link Articles:detail, id => 1}"></iframe>
  1. second, you want to prevent application from rendering layout
<iframe src="{link Articles:detail, id => 1, showLayout => FALSE}"></iframe>
class ArticlesPresenter extends BasePresenter {

    function renderDetail($id, $showLayout = TRUE) {
        if (!$showLayout) {
            $this->setLayout(FALSE);
        }

        ...
    }

}

But, I think iframe isn't best way to making nice web pages. :-)

Pitt
Member | 6
+
0
-

Thank you!
It works beautifully! I had to just change routing a bit.

But, I think iframe isn't best way to making nice web pages. :-)

Indeed, but this is just as a preview for comments – I hate when I have to go back to see what I am commenting.