Logo

mobilize.js v0.1 documentation

Integrating with Wordpress

«  Usage   ::   Contents   ::   Developing with mobilize.js  »

Integrating with Wordpress

Front page

To correctly convert the front page it must follow the default theme structure( Wordpress 3.1).

Posts

<div class="posts">
  <div class="post">
    <div class="entry-title"><a src='url-to-post'>title</a></div>
    <div class="entry-content">...</div>
    <div class="entry-date">...</div>
  </div>
</div>

Pages

<div class="menu">
  <ul>
    <li><a>Page</a></li>
  </ul>
</div>

Post page

For content there should be element with class=”entry-content”. For the post content there should be element with id=”comments”.

The content inside those tags are used as-is.

Content

<div class="entry-content">
  • Test 1
  • Test 2
<body>
    <script type="text/javascript" src="http://cdn.mobilizejs.com/releases/0.1/js/mobilize.core.debug.js"></script>

    <!-- Your custom extender goes here -->
    <script type="text/javascript" src="http://localhost/mobilize.mysite.js"></script>
mobilize.extends(mobilize, {

    initPlugins : function() {

       mobilize.extend(mobilize.cdnOptions, {

           // Identifier tag for this extender
           // This is used for error reporting, etc.
           bundleName : "mobilize.yoursite",
           // CSS files to load *after* mobilization
           cssBundles : ["./mobilize.yoursite.css"],
           // CSS files to load *after* mobilization
           javascriptBundles : ["./mobilize.yoursite.css"],

           // HTML barebone tmeplate for the mobile site
           template : "templates/wordpress.html"
       });

    },

    constructBody : function() {
        // Perform transformation here
    }

});

Pages

<div id="comments>

«  Usage aSD asd asD asd asD asdsaDasd   ::   Contents   ::   Developing with mobilize.js  »