Plone 4 connects to Mysql and displays the result of the SQL query on the Plone page

advertisements

I was able to connect to MySQL db and create Zope page Template to run some queries and display the results. Now I'm thinking to embed/add/insert the output of SQL queries results into a Plone page,

so when the user goes to www.plone_page.com it can see the output on this page.

how can I do it?


1.If you know how to write a browser:view, do create one and in the pt you can write something like:

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      lang="en"
      i18n:domain="csi.wifistats"
      metal:use-macro="context/main_template/macros/master">
<body>
    <metal:content-core fill-slot="content-core">
        <metal:content-core define-macro="content-core">
         <!-- Your dynamic content -->

            </metal:content-core>
        </metal:content-core>
    </body>
    </html>

2.If you don't know how to create a browser view, better to learn it and then go to step 1. ;) http://collective-docs.readthedocs.org/en/latest/views/browserviews.html