SEO and HTML Alternative Pages

Viewing the HTML alternative pages on the fly

Just visit this address with your browser:

http://localhost/mywebiste.com/deploy/noflash.php

This is what the visitor sees if he has not flash installed for his browser. So, basically, you can test your HTML alternative website, without having to deactivate the flash addon on Mozilla. How cool is that?

How exactly HTML alternative pages work

Every flash page has its own html alternative. This is the page that google robots see when they visit your site.

To define the alternative page, just open structure.xml and set the seosource attribute:

<data swf="%site%/page.swf"
      ...
      seosource="content_source/page.php"/>

Dynamic html pages

Fleb works with XML files. So you want the alternative pages to represent the exact flash pages (which are based on separate XMLs). Here is how.

Adding texts

Say for example that your company xml file is something like that:

<?xml version="1.0" encoding="UTF-8"?>
<page>
    <title><![CDATA[Company]]></title>
    <text><![CDATA[First text]]></text>
    <text><![CDATA[Second text]]></text>
</page>

To dynamically show these texts add the code below in page.php.

<?php

$output = "";

if ($source == "home") {
    ...
} else {
    $xml = new SimpleXMLElement($source, null, true);
    $title = $xml->title[0];
    $output .= "<p><h1/>" . $title . "</h1></p>";

    $nTextNodes = count($xml->text); // count text nodes
    for ($i = 0; $i < $nTextNodes; $i++) {
        $output .= "<p>" . $xml->text[$i] . "</p>";
    }
}

?>

Adding images

Say for example that your photo gallery xml file is something like that:

<?xml version="1.0" encoding="UTF-8"?>
<page>
    <photos>
        <item filename="images/photoGallery/img01.jpg"></item>
        <item filename="images/photoGallery/img02.jpg"></item>
    </photos>
</page>

To dynamically show these images add the code below in photoGallery.php.

<?php

$output = "";

$xml = new SimpleXMLElement($source, null, true);
$title = $xml->title[0];
$output .= "<p><h1/>" . $title . "</h1></p>";

$nImages = count($xml->photos->item); // count img nodes
for ($i = 0; $i < $nImages ; $i++) {
    $output .= '<img src="' . $xml->photos->item[$i]->attributes()->$att . '"></img>';
}

?>

Static html pages

If you want to create static HTML pages use this code instead:

<?php

$output = '
    <h1>My header</h1>
    <p>My text</p>
    ';

?>

Just make sure that the static html page represents the exact flash page.

Post A Comment

Anti-Spam Quiz: