Adding web content

You can use the Web Content Proxy widget to extend your Rhythm for Civics pages with your own controls or HTML markup. You can specify the URL of an external site to be displayed within the widget, or you can enter you own HTML.

If you specify a URL, you can also forward the current window's query strings to the external site to generate dynamic content.

To enter your own HTML, use the Web Proxy Content field. Example:

<html>
<body>
  <div>
    <span>Validation Code: </span>
    <input placeholder="" type="text" name="name" id="name" tabindex="1" autofocus />
    <div id="name-error" class="error"></div>
  </div>
  <div>
    <a href="#" onClick="$.ajax({url: 
     'http://rhythm.local.com:8080/delegate/civics-api/api/someservices?something=
     ' + $('#name').val(),success: function(result){ $('#name-error').html
     (result.data.ipsVersion);}})">click here</a>
  </div>
</body>
</html>

When using the URL configured proxy, you must modify the cross domain policy header to allow Rhythm for Civics to render the web content. To modify the cross domain policy, add this code to the Web.config file:

<configuration>
  <system.webServer>
    <httpProtocol>
      <customHeaders>
        <add name="Access-Control-Allow-Origin" value="*" />
        <add name="Access-Control-Allow-Methods" value="POST,GET,OPTIONS,PUT,DELETE" />
      </customHeaders>
    </httpProtocol>
  </system.webServer>
</configuration>