Hopefully this how-to will replace or at least substitute my google docs editable content how-to.
I needed to add editable business hours and contact info to the sidebar of my RapidWeaver inventory site. This was fine when the web host allowed me to use the php include() function to show content from an outside domain. Now that feature has been removed from my particular host for security reasons. I think this method will be more elegant anyways because I am using WordPress for the whole site rather than both the latter and Google Docs.
I built a page in the WordPress backend and typed in the business hours on one page and contact info on another. Then I made a copy of the inventory main page and called it pages.php under the inventory subfolder. The page is an exact copy except I took out the sidebar content and eliminated this code from the content area:
<div class=”blog-entry-title”><?php the_title(); ?></div>
<div class=”blog-entry-date”> <!– <?php the_time(’Y-m-d G:i’); ?> | –>
<span class=”blog-entry-category”><?php the_category(’, ‘); ?></span> |
<span class=”blog-entry-permalink”><a href=”<?php the_permalink(); ?>”>Print This Item</a></span> |
<span class=”blog-entry-permalink”><a href=”<?php the_permalink(); ?>#respond”>Inquire About This Item</a></span> | </div>
This how-to will follow me as I work through the process of building a site starting with RapidWeaver. The site will be bare-bones structured in RapidWeaver, then I will take the home page and turn it into a Joomla theme. Then content will be added to the site using Joomla articles. I will also use the FaceBook Connect platform to get a family website off the ground quickly by adding the family members’ FaceBook pictures and feeds to each of their pages. Although there is not much I have found for rich Flickr content, I will also be adding Flickr sets to the page for easy gallery uploads. The first installment will be showing you how I tricked Joomla into thinking a RapidWeaver page was a fully functional theme without any changes to a bare-bones Joomla theme. Stay Tuned…
If you have a website you are building for a client and they need to edit one or two pieces of information and you don’t want to go to a full blown CMS solution consider using Google’s *free Google Docs account to manage it. The process is a little tricky, so just read through these steps and apply it to your own situation. I will let you refer to Google on how to set up the account and save your content. You will need to create the following files:
- A Google Docs file - Your client will edit this
- This PHP file - Save it as google.php and upload to your server
From the Google Docs website, open your client content file you created and at the top-right of the page there will be a blue drop-down button “Share”. Select “Publish as Web Page”. On the following page, click “Publish Document”, then click “Automatically re-publish when changes are made”.
Now on your website, replace the formerly static content with
<iframe src =”paste_PHP_file_URL_here” width=”100%” height=”200″ frameborder=”0″ scrolling=”no”>
<p>Your browser does not support iframes.</p>
</iframe>
Adjust the <iframe> height and width parameters to fit your site. Also, you can change the text inside the <p> tag above to include more relevant information in case the user’s browser doesn’t support it (universal access, text only browsers).
Your Google Docs page should now show up on the client’s site. Any time they edit the document from Google Docs it will automatically be changed on their website as well!
To summarize, you have created a Google Docs document with full rich text and image capabilities that a client can edit quickly and easily which will be visible on their website and updated automatically. This is done by using a PHP page that makes some minor changes to the Google Docs document so it looks nice in a web page. This modified page is then included in their site inside the <iframe> tag which makes a web page within a web page.