« Succesfully migrated from MobileMe to One.com | Main | iWeb : iframe alternative in the HTML Snippet »

donderdag, 18 augustus, 2011

HTML as PHP (cont.)

Discovered that one.com does not support this Apache Directive :

<files widget*.html>
AddType application/x-httpd-php .html
</files>

See this blog post for details :

HTML as PHP »

If applied, the widget markup file downloads.

Sent Tweet for answers :

Does one.com support this directive

Update 19 aug 2010 :

Got the answer : AddType will not work etc...

Well, this problem is not unique. Some searching showed that it is common with other providers as well. See this discussion :

Make PHP to work in your HTML files with .htacess

So now we have to find a solution for at least the iWeb Widget issue. And as per usual, I found one.

Here's how to proceed.

In the Finder do Command-Shift-G and paste this line :

/Applications/iWeb.app/Contents/Resources/Widgets/

Hit Return.

Right-click file HTMLRegion.iwdgt and choose Show package content from the pop-up menu.

Open file Info.plist in either the Property List Editor (part of Xcode) or a Plain Text editor.

Find this :

<key>DynamicResourceValuePrefsKeys</key>
<dict>
<key>x-html-markup</key>
<string>$WIDGET_ID_markup.html</string>
</dict>

and change the extention to php.

<string>$WIDGET_ID_markup.php</string>

Save the file (you need Administrator right to do this) and start iWeb.

The drawback is that the HTML Snippet behaves differently now. When you add code it also shows the code it will add when you publish the pages. The HTML Snippet expands when more code is added. It doesn't take the various widths and heights of <divs> into account. You have to manually resize the HTML Snippet yourself.

But it will publish the widget markup file as php.

So use it when you feel certain you can cope with it.

You may have to update pages with the old extension.

And if you haven't been there yet, here's a sample page.

Posted by wyodor at 6:51 PM
Categories: Design, Web