• Resolved jamoboggins

    (@jamoboggins)


    I’m trying to get sIFT fonts working on my static homepage. I had the XHTML and CSS coded by a PSD to HTML site, and so now trying to work backwards to skin a custom homepage by building a custom template.

    I’ve installed the CG-Flashytitles plugin, but because the XHTML and CSS is already there I don’t want to define the style with the limited variables in the plugin style editor.

    I’ve got as far as displaying the flash-replaced font, but the non-flash alternative is still displaying. I’m having trouble using the <span> correctly in the html.

    This is the html in the original build:

    <div class="column-head">
    <h3><span>Upcoming festivals</span></h3>
    </div>

    but to get it working as far as I have done I had to go into Firebug and inspect the output html that was created after the <span> returned true for sIFR flash (i.e. the alternate non-sIFR text shouldn’t display). I then pasted it into the opening <span> tag in my custom template. Here’s the code:

    <div class="column-head"><
    <span>
    <embed width="234"
    height="29"
    src="wp-content/plugins/sifr/bunny.swf"
    quality="best"
    flashvars="txt=Upcoming festivals&amp;
    textcolor=#3e392b;
    &amp;hovercolor=#78b24c&amp;
    linkcolor=#333333&amp;
    w=234&amp;h=29"
    wmode="transparent"
    bgcolor="transparent"
    sifr="true"
    type="application/x-shockwave-flash"
    class="sIFR-flash"
    style="width: 234px; height: 29px;"/>
    Exciting Adventures</span></h3></div>

    This is the relevant CSS:

    /*sIFR*/
    .sIFR-flash {
        visibility:visible !important;
        margin:0;
    }
    .sIFR-replaced {
        visibility:visible !important;
    }
    span.sIFR-alternate {
        position:absolute;
        left:0;
        top:0;
        width:0;
        height:0;
        display:block;
        overflow:hidden;
    }
    .sIFR-flash + div[adblocktab=true] {
      display: none !important;
    }
    .sIFR-hasFlash .today h2{
        margin:0;
        font-size:20px;
        visibility:visible;
    }
    .sIFR-hasFlash .column-head h3{
        margin:0;
        font-size:25px;
        visibility:visible;
    }
    .sIFR-hasFlash .content-heading h2{
        margin:0;
        font-size:44px;
        visibility:visible;
    }
    .sIFR-hasFlash .green-heading h3{
        margin:0;
        font-size:44px;
        visibility:visible;
    }

    How do I get the <span> to run correctly? At the moment I’m getting two titles: <h3> text displayed with the flash-alternative CSS, and then the Flash replacement image displaying correctly (apart from picking up text colour).

    The flash image appears immediately to the right of the of the alternative text, as if the current <span> is adding an additional title.

    I’ve realised that the above code manually inserts “Upcoming festivals”:

    flashvars="txt=Upcoming festivals&amp;

    When it should be picking up “Exiting adventures” within the <h3> tags. So at the moment it displays “Upcoming festivals” twice, once styled with Flash, once styled as using the alternative CSS.

    Any help greatly appreciated!

Viewing 1 replies (of 1 total)
  • Thread Starter jamoboggins

    (@jamoboggins)

    OK I’ve fixed it myself, though not completely sure how I did it.

    The first thing I noticed was that in the original HTML there was something in the <head> tag relating to the javascript that runs the sFIR:

    <script type="text/javascript" src="js/sifr.js"> </script>
    <script type="text/javascript" src="js/sifr-addons.js"></script>

    Because WordPress templates work by calling up various templates to create eage page, I needed to put this in the header.php template, not the custom homepage template I actually want the Flash replacement font to appear on. I also needed to change the file path so that src= wp-content/plugins/sifr, and also copied the additional javacript file ‘sifr-addons.js’ there (the FlashyTitles plugin doesn’t come with it).

    I then deleted all of the computed html I’d put in (see above) and just left the <span> tag as it originally appeared:

    <div class="column-head">
    <h3><span>Upcoming festivals</span></h3>
    </div>

    I defined the font and colors within the the FlashyTitles interface in wp-admin. Then I named the CSS selector .sIFR-hasFlash .column-head h3.

    That seemed to work, but to be sure what was happening I used Firebug to compare the output html from the local HTML/CSS build with my live WordPress site. It showed that the additional Flash arguments I added through the plugin interface were being duplicated. It seemed to pick up all the necessary CSS from the style-sheet, and directly with the sfir folder in /plugins rather than having it all defined through the plugin.

    Note that all the filepaths lead to wp-content/plugins/sifr, and not wp-content/plugins/cg-flashytitles/sifr.

    The only thing that’s different between the local build and the live WordPress version is that the image has rendered slightly darker, despite the same CSS colour code being used.

    Hopefully this is useful for someone else trying to skin a WordPress theme from an HTML/CSS build.

Viewing 1 replies (of 1 total)
  • The topic ‘Flash replacement fonts’ is closed to new replies.