Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

iWeb (3.0.4) codes the widget file path with .// (double forward slashes) and my webhost doesn't like it!

I spent a many long hours trying to get the widgets to display on my iWeb site pages.


The problem finally turned out to be that the widget file path is coded as .//<directory>/<widget_filename> and the webhost refused to access this path and kept showing 404 errors in the widget boxes.

I had to manually remove the extra forward slash from all the paths to get it to work.


however, everytime i publish the site, the forward slashes get added.

It is utterly annoying, is there a way to fix this?


cheers

cray101

iWeb 3.0.4-OTHER, OS X Mountain Lion (10.8.2)

Posted on Jan 11, 2013 5:02 PM

Reply
16 replies

Jan 12, 2013 3:54 AM in response to Roddy

Roddy wrote:


I had this problem thrown at me about a year ago by someone who switch to a dubious web host from MobileMe. It disappeared when I uploaded their files to Host Excellence...


http://www.iwebformusicians.com/iWeb/Website-Hosting.html

Hi Roddy,


It may be the web host's issue. However, I'm using (or trying to!) Amazon S3 and not using another random web host. Not saying it can't be a problem at their end, but I'd like to understand if it's iWeb that's coding the path incorrectly or the web host's incapability to process valid code.


Sorry, I'm a C programmer, with very limited understanding of html and sucklike.


cheers

cray101

Jan 12, 2013 10:57 AM in response to cray101

Try this.


Copy line below :

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


In Finder, do Command-Shift-G


Paste line. Hit Return.


Right-click file HTMLRegion.iwdgt and choose Show package content.


Open file PasteBody.html in a HTML editor of your choice.


Change this line :

var $WIDGET_ID_htmlMarkupURL = "$WIDGET_SITE_PATH/$x-html-markup";

to :

var $WIDGET_ID_htmlMarkupURL = ".$x-html-markup";

In other words, replace :

$WIDGET_SITE_PATH/

with a dot (.)


Save file.


You may need Administrator rights to save the file.


Open iWeb.


Make a simple change to the page with the HTML Snippet, save and publish.


Open the published page in browser. It should work as before.


To verify, look at the source of the webpage.


Instead of :

var widget1_htmlMarkupURL = ".//album_files/widget1_markup.html";

you'll now see :

var widget1_htmlMarkupURL = "./album_files/widget1_markup.html";


where album_files is the folder with the name of the page. Your pagename is probably different.


Note : If you use relative links to files outside the folder with the sitename, use ../../ instead of ../../../


See : Using the HTML Snippet


It works as advertised in pages I tested. Perhaps there are exceptions. That's too bad.

Jan 12, 2013 5:05 PM in response to cray101

how do I fix it again?

i don't work for apple, i don't post fixes here... it's apple problem, the problem was reported to aple/iweb sw guys and they did nothing.


I'm a C programmer...

It's just a blank square

$WIDGET_SITE_PATH provides relative path to the markuped page, and iweb pages have more than just one level deep (subdirectories) - try it in blog entry page, you'll see it's four deep.

replacing $WIDGET_SITE_PATH with a dot (.) forces markup page to be in one level and isnt the solution.

Jan 13, 2013 2:16 AM in response to Cyclosaurus

Cyclosaurus wrote:


how do I fix it again?

i don't work for apple, i don't post fixes here... it's apple problem, the problem was reported to aple/iweb sw guys and they did nothing.

Where is it that you DO post fixes then Cyclosaurus? I think the whole point of having a community is sharing the issues and potential fixes that you think may be worth considering. It is certainly no use sitting around waiting for apple to fix problems.


Moving on,

Thanks for the pointer Wyodor. I tried fixing it the other way around, i.e.

changing

var $WIDGET_ID_htmlMarkupURL = "$WIDGET_SITE_PATH/$x-html-markup";

to

var $WIDGET_ID_htmlMarkupURL = "$WIDGET_SITE_PATH$x-html-markup";

(without the forward slash)


But the result is the same. The generated webpages have the path correctly coded. And I assume this should solve the issue Cyclosaurus mentions:

$WIDGET_SITE_PATH provides relative path to the markuped page, and iweb pages have more than just one level deep (subdirectories) - try it in blog entry page, you'll see it's four deep.

However, the widgets still don't display inside iWeb. Looks like it is expecting the two forward slashes in the pathname.

Jan 13, 2013 7:09 AM in response to cray101

Final try.


Here's the complete code of the PasteBody.html file :

<script type="text/javascript"><!--//--><![CDATA[//><!--

var $WIDGET_ID_htmlMarkupURL = "$WIDGET_SITE_PATH/$x-html-markup";



if (!$WIDGET_ID_htmlMarkupURL.indexOf(".//")) {

$WIDGET_ID_htmlMarkupURL = $WIDGET_ID_htmlMarkupURL.substring(3,99);

}



//--><!]]></script>

<div id="$WIDGET_ID-htmlRegion" class='html_region_widget'></div>

The if statement checks for ".//" and if true uses the url from pos 3.


A page can have multiple HTML Snippets.


HTML Snippets urls on Blog pages do not start with ".//" and are ignored.


To see the result, look at the source of the published webpage.


If copy/paste of the code does not work, here's the original page :


http://home.wyodor.net/demoos/div/PasteBody.html


Look at the source and copy/paste that.


If I find a better solution, I'll post.

iWeb (3.0.4) codes the widget file path with .// (double forward slashes) and my webhost doesn't like it!

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.