staticpage list sidebar truncation

Creating and modifying plugins.
Post Reply
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

staticpage list sidebar truncation

Post by Timbalu »

After realizing there is no smarty template used for the staticpage sidebar list and wondering why my headlines were to long and how to solve this, I recently added a cut function based on two new config vars (length and etc) to the staticpage sidebar plugin, ... until one day someone will rewrite the staticpages and put them into core! ;-)

Edit: added capability to use the permalinks name instead.
Edit: added truncate utf-8 combat, if mb_* available

[The extension php has been deactivated and can no longer be displayed.]

Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: staticpage list sidebar truncation

Post by garvinhicking »

Hi!

Instead of hotfixing this with a cluttered config option, wouldn't you maybe like to add a "Use smarty template" option? :-))

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: staticpage list sidebar truncation

Post by Timbalu »

Well, yes.., but this was easier for the moment.
I think this is getting neccessary in future somehow, when Smarty3+ ships with Serendipity, including utf8 substr.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: staticpage list sidebar truncation

Post by Timbalu »

Ok, here it is, using a "Use smarty template" option ...,
but is has no utf8 mb_substr support, as we are with smarty 2.6.x, and the js node string option is still done in the plugin, which hasn't have truncation support at all. But you can use it within the tpl file also and in there is some CSS magic to have something (nearly) similar. Just copy the files right into the serendipity_event_staticpage folder.

Maybe Garvin, you could just have a look if this is ready to update ... ;-)
plugin_staticpage_sidebar.zip
(3.64 KiB) Downloaded 192 times
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Post Reply