[ic] Getting category name from tree to page title

JT Justman interchange-users@interchange.redhat.com
Fri Sep 21 08:22:00 2001


Where's the straight line?
(disclamer: I'm a designer, not a programmer)

Hi, everyone! I've been quiet a while, and that means things are going well.
I've also gotten better at locating things in the archives. But I'm stumped
again.

I use a tree tag to display my category list. The tree looks great. I link
each entry to a search for the category's contents, like thus:
(this is the content of
http://edenclothing.com/~eden/cgi-bin/cart.cgi/type_category_index.html
minus the addition I describe below)

    [tree
 table=cat
 start=0
 master=parent
 subordinate=index
 autodetect=1
 spacing=4
 full=1]
        <tr>
        <td>
        [if-item-param mv_level]
                [item-calc]
                        return '&nbsp' x [item-param mv_spacing];
                [/item-calc]
        [/if-item-param]
<A href="[area href=scan search=|
fi=products
st=db
sp=category_display
sf=type_category
se=[item-param index]
op=eq
|
]">[data table=cat column=cat key='[item-param index]']</A>
 </td>
        </tr>
        [/tree]
        </table>

Works good. Not pretty code-wise I'm sure but it gets the job done, pages
look good and all.

Then I want the result page to show the name of the category being
displayed. Things get tricky.

I tried using [cgi mv_searchspec] or [cgi se] or other variants to simply
retrieve the searchspec and use it to get the name from the cat DB. This
didn't work, as it seems the "scan" does weird things to the url:

http://edenclothing.com/~eden/cgi-bin/cart.cgi/scan/fi=products/st=db/sp=cat
egory_display/sf=type_category/se=201/op=eq.html

And so [cgi] doesn't seem able to extract the searchspec.

So I go to plan b: put the category's index number in the url:

...
se=[item-param index]
op=eq
|
+ arg=[item-param index]
]">[data table=cat column=cat key='[item-param index]']</A>
...

This was the only way I could seem to do this reliably.
arg="this_cat_index=[item-param index]" would cause "this_cat_index=####" to
be returned. (I'm open to suggestions of a more elegant solution to this)

So, on the results page (category_display) I put:

In category: <b>[data table=cat field=cat key='[cgi mv_arg]']</b><BR>

Which works dandy.

Keen! I spend twenty minutes paging through my long list of items and tweak
the results page some making it look okay.

But page titles are important to me. I'd prefer "Eden Clothing -- Baby-Ts"
over "Eden Clothing -- Category Display". This will be vital to search
engine positioning, especially when I do the brand-name pages.

But I can't get the !$%@& value to display in the page title without
modifying the page directly or making a special template. If I put "[data
table=cat field=cat key='[cgi mv_arg]']" in the "Page Title" in the UI, it
isn't interpolated. The problem is, I can't find where IC sets the [scratch
page_title] to change it.

So, how do I:

1) Cause the stuff in the UI to be interpolated, or
2) Give a variable to the UI that it will accept, or
3) Do something to make this work?

Or am I way off-track?

It's late, and i'm sure I'm guilty of several spelling mistakes and / or
missed endtags but appreciate what help you can offer : )

Thanks,

JT