Update to HTML output

Add your enhancement requests to our ToDo list.
Post Reply
Posts: 5
Joined: Sat Oct 25, 2008 5:19 pm
Location: UK

Update to HTML output

Post by moose45 » Sun Feb 26, 2012 10:24 pm

I've been fiddling about with the html output by modifying the .css file.

But there are two formatting items that are hardcoded into the html page.

The main one being within the body tag <body bgcolor='#FFFFFF'>, which is hardcoded into every page. Could this be moved to be a class in the .css file?

On the index page the list of initial letters (underneath Relatives of XXX) the table is hardcoded and doesn't appear in the .css. Again it would be great if this be moved to be a class in the .css file?

Also when displaying the Name of an individual and (year of birth - year of death) the wrapping often occurs in between the two years. Ideally could these spaces be replaced with non-breaking-spaces so that if the text wraps the names would be on one line and the years on the next?

Posts: 23
Joined: Sat May 09, 2009 5:23 pm
Location: Glasgow, UK

Post by daj » Sat Apr 07, 2012 4:59 pm

I agree with the above. Although I'm not sure what you mean when talking about the list of initial letters. What's the issue there?

What would be even better is if the HTML output could use a template file so users could then customise it.

At the moment, I incorporate the HTML pages into my website using an iFrame. I'm not a huge fan of this technique but it's the only way to keep some continuity for my visitors. Sadly the Frame can be broken out of then the visitor is lost. Also search engines miss the context.

I have been experimenting with some code which I run the HTML files through -- this rips out all the headers, retaining everything between the Body tags and wrapping it in my own code.

What would be great is if we could use a template. So as the HTML files are being built iFamily reads the template and uses that as the basis for each of it's HTML files. For example, it looks for a certain tag (say <#iFamilyData>) and replaced this with it's own code for the core of the HTML page.

For those of us who want to produce more advanced web sites we then have much more flexibility. iFamily simply ships with a default template with all the standard HTML by default.

Posts: 23
Joined: Sat May 09, 2009 5:23 pm
Location: Glasgow, UK

Post by daj » Sun Apr 08, 2012 3:50 pm

Ok, here's a quick fix for the embedded style element for the body...a little command to remove the element.

Generatre your HTML as normal, but before uploading it to your site...

Open the Terminal App (in your Utilites folder) on the Mac
at the command line type (or copy and paste this)...

Code: Select all

find /users/daj/iFamilyData/Reports/Jamieson_webPages_31/HTMLFiles/ -type f | xargs perl -pi -e "s/  bgcolor='#FFFFF0'//g"
Replace the full path (in this case /users/daj/iFamilyData/Reports/Jamieson_webPages_31/HTMLFiles/) with the location to your newly generated website.

Note the section at the end of the line.

Code: Select all

"s/  bgcolor='#FFFFF0'//g"
This tells the command to Search for <space><space>bgcolor='#FFFFF0' and Replace it with nothing. If you wanted to replace it with something different then specify this between / and /g at the end.
(in my case the bgcolor element had two spaces at the start but check yours)

When you press Return the command will go through every file looking for the bgcolor='#FFFFF0' and replace it with nothing, so
<body bgcolor='#FFFFF0'> becomes <body>
Therefore removing the inline element :-)

I have just over 600 files and it took about 1 second to do it

Now quit the Terminal App and upload the files to your site.

You need to do this each time you re-generate your HTML files.

You can see the background colour is now gone on my webpages... http://jamiesontree.co.uk/page/public I have a nice white (i.e not background) rather than pale-yellow

Post Reply