29 November 2004

TxP: <txp:c /> and <txp:s />

Why didn’t I know about these. Why did I put all this code in my page? shrug

Why didn’t I find about this till reading the forums extensively…

I wanted to display section and catgeory in my headers, so I started messing with GLOBALS.

I created a custom form called “grab_globals”, which I included at top of every page.

<? php
        $nuff_section = $GLOBALS['s'];
        $nuff_category = $GLOBALS['c'];
        if(!empty($nuff_category))
        {
            $nuff_category = " ::: " . $nuff_category;
        }
    ?>

Then within my pages I could use this variable:

<h2><? =$nuff_section?><? =$nuff_category?></h2>   

I got my result, but would of been so much easier to use built in TxP stuff

<h2>< txp:s /> ::: < txp:c /></h2>

The only advantage my workaround possesses is no “:::” before category if it doesn’t exist..,

 

Comment



note: you can only submit after you hit preview


nuff-respec is a weblog written by daniel bulli a senior web programmer in boston, ma.
more >

contact | resume | profile | twitter

recently :::