2006-04-07
Askaaron
I found this, when playing around with the "arctic" template, which offers to use links for the actions like 'edit', 'login' etc. I wondered, why "useless" separators appeared in some situations.
Well - these links are generated using tpl_actionlink() and separated through a separator symbol. The author of the "arctic" template was already aware, that certain links will not show up in all situations and tried to avoid printing unneccessary link separators - but his workaround does not work in all situations and is actually more a "quick hack" than a clean solution, because tpl_actionlink() does not report, if it generated a link or not.
A better solution: tpl_actionlink() returns true or false - true, if a link was generated, false, if not. So templates using tpl_actionlink() can decide, if they might need a separator to the next link or not.
I tried this with a modifed version of "arctic" and it works perfectly without much additional overhead.