3 # -----------------------------------------------------------------
4 # Category trail/path utilities
5 # page trail looks like trail=id/id/id
7 # adds an ID, esults in the full trail as a string
8 MACRO trail_append(node_id) BLOCK;
9 trail = CGI.param('trail');
10 trail ? trail _ '/' _ node_id : node_id;
13 # last trail component/id as a string
14 MACRO trail_endpoint BLOCK;
15 trail = CGI.param('trail');
16 list = trail ? trail.split('/') : [];
20 MACRO trail_splice(page_id) BLOCK;
21 trail = CGI.param('trail');
22 list = trail ? trail.split('/') : [];
25 path = path ? path _ '/' _ id : id;
26 IF id == page_id; LAST; END;
31 # -----------------------------------------------------------------
32 # Determines the full path to image URLs
33 # Use absolute and fully-qualified image URLs as-is.
34 # For all others, use the kpac base path.
35 MACRO kpac_img_path(img) BLOCK;
36 IF img.match('^/') OR img.match('^https?://');
39 ctx.media_prefix _ '/images/kpac/' _ img;