Re: Spyce example

"Jonathan Ellis" <[email protected]>
Newsgroups gmane.comp.python.spyce.general
Message-ID <[email protected]>
On Sat, 27 May 2006 12:22:56 -0400, "Bruce Webber"
<[email protected]> said:
> > (Personally I would put the html generation part of writeLinkHTML in the
> > .spi, but whatever floats your boat. :)

> I agree - that keeps HTML out of .py files (better separation of content, 
> presentation and code). So I changed the writeNavHTML tag to the
> following:

It's even cleaner if you let Spyce do the string interpolation:

    <div id="navbox">
    <ul>
    [[ for tLink in tNavLinks:{ ]]
        [[ if tLink[0] == sCurrPage:{ ]]
            <li class="current">[[= tLink[0] ]]</li>
        [[ }else:{ ]]
            <li><a href="[[= tLink[1] ]]">[[= tLink[0] ]]</a></li>
        [[ } ]]
    [[ } ]]
    </ul>
    </div>

-J
-- 
C++ is history repeated as tragedy. Java is history repeated as farce.  --Scott McKay



-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.