Estimating entry length? Dynamically parameterizing plugins?
Posted: Tue Dec 09, 2008 10:12 pm
Well, my next idea: I would like to make my sidebars conditional, so their content depend on the entry length (so I build long sidebar along the long article, but cut it to the minimum along the short note). I am in particular looking for the following suggestions:
a) what could be the best method to estimate the entry length (while displaying it, from index.tpl)? It need not be very accurate, but it would be nice to know whether it is rather about 30 lines, or maybe about 300... Which variable should I access to avoid performance costs?
b) It would be nice if I could dynamically set the numer of items shown by serendipity_plugin_recententries and serendipity_plugin_comments. What could be the easiest way to achieve this? Note: I am currently rendering them calling explicite:
{serendipity_showPlugin id="..."}
in some .tpl. Ideal solution would be if I could just pass some params here and have them overwrite the configuration saved in the database...
a) what could be the best method to estimate the entry length (while displaying it, from index.tpl)? It need not be very accurate, but it would be nice to know whether it is rather about 30 lines, or maybe about 300... Which variable should I access to avoid performance costs?
b) It would be nice if I could dynamically set the numer of items shown by serendipity_plugin_recententries and serendipity_plugin_comments. What could be the easiest way to achieve this? Note: I am currently rendering them calling explicite:
{serendipity_showPlugin id="..."}
in some .tpl. Ideal solution would be if I could just pass some params here and have them overwrite the configuration saved in the database...