I'm writing come custom code, but I can't seem to find a way to get the current cpath. I would like to get the number for current cpath as well as current top level parent category.

Can someone help?

Thanks,
TJ