
from tw.api import Widget

class IFrameWidget(Widget):
    params = ['id', 'url']
    template = """
      <iframe id="${id}" src="${url}" width="100%" height="100%">
        <p>Your browser does not support iframes.</p>
      </iframe>
    """
    engine_name = 'mako'


from tw.api import Widget

class IFrameWidget(Widget):
    params = ['id', 'url', 'title', 'height', 'width']
    template = """
      <h1>${title}</h1>
      <iframe id="${id}" src="${url}" width="${width}" height="${height}">
        <p>Your browser does not support iframes.</p>
      </iframe>
    """
    title = ''
    height = width = '100%'
    engine_name = 'mako'

iframe_widget = IFrameWidget('iframe_widget')

Make our IFrameWidget more configurable
Make our IFrameWidget more configurable

  
  from tw.api import Widget
  
  class IFrameWidget(Widget):
-     params = ['id', 'url']
+     params = ['id', 'url', 'title', 'height', 'width']
      template = """
+       <h1>${title}</h1>
-       <iframe id="${id}" src="${url}" width="100%" height="100%">
+       <iframe id="${id}" src="${url}" width="${width}" height="${height}">
          <p>Your browser does not support iframes.</p>
        </iframe>
      """
+     title = ''
+     height = width = '100%'
      engine_name = 'mako'
  
+ iframe_widget = IFrameWidget('iframe_widget')
+ 
Make our IFrameWidget more configurable
## Code Before:

from tw.api import Widget

class IFrameWidget(Widget):
    params = ['id', 'url']
    template = """
      <iframe id="${id}" src="${url}" width="100%" height="100%">
        <p>Your browser does not support iframes.</p>
      </iframe>
    """
    engine_name = 'mako'

## Instruction:
Make our IFrameWidget more configurable
## Code After:

from tw.api import Widget

class IFrameWidget(Widget):
    params = ['id', 'url', 'title', 'height', 'width']
    template = """
      <h1>${title}</h1>
      <iframe id="${id}" src="${url}" width="${width}" height="${height}">
        <p>Your browser does not support iframes.</p>
      </iframe>
    """
    title = ''
    height = width = '100%'
    engine_name = 'mako'

iframe_widget = IFrameWidget('iframe_widget')
