The Serendipity Handbook

You can now read the (german) handbook here: PDF - https://github.com/s9y/Book (LaTeX source).

Forum-Information

Before posting about errors, make sure that the answer cannot already be found in our FAQ or by searching this forum!
Posting is restricted to registered users (registering is free and simple!) due to recent spam attacks. When having trouble with this board, contact garvin(-at)s9y(-dot)org.

Board index Development Smartyfication of existing plugins mini-HowTo, pls

Discussion corner for Developers of Serendipity.
LazyBadger
Regular
 
Posts: 175
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia

Postby LazyBadger » Sat Mar 19, 2011 9:11 pm

Using part of serendipity_smarty_init() from serendipity_event_relatedlinks (or any other templated plugin) as live example
Quis custodiet ipsos custodes?

User avatar
Timbalu
Regular
 
Posts: 3857
Joined: Sun May 02, 2004 3:04 pm

Postby Timbalu » Sun Mar 20, 2011 10:00 am

Dear LazyBadger

I can't follow you!
You are posting/talking like the Delphi Oracle... is it spam, is it a question, is it a reminder for yourself, is it ... :?:
Regards,
Ian

LazyBadger
Regular
 
Posts: 175
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia

Postby LazyBadger » Sun Mar 20, 2011 2:36 pm

It's easy
I
- ask
- some hints
- in the area of converting hardcoded front-end output of plugin into templated output, as it was done with serendipity_event_relatedlinks
- for existing plugin (namely - event_freetag)
Quis custodiet ipsos custodes?

User avatar
onli
Regular
 
Posts: 1417
Joined: Tue Sep 09, 2008 10:04 pm

Postby onli » Sun Mar 20, 2011 2:46 pm

event_freetag is already smartified. Or: which area of it?

LazyBadger
Regular
 
Posts: 175
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia

Postby LazyBadger » Sun Mar 20, 2011 4:11 pm

onli wrote:event_freetag is already smartified.

Less than wanted. This part drive me nuts
Code: Select all
    function displayTagCloud($tag)
    {
        $tags = $this->getTagCloudTags($tag);

        echo '<div class="serendipity_Entry_Date freetag_cloud">';
        echo '<h2 class="serendipity_date">';
        $tagTitle = is_array($this->displayTag) ? implode(' + ',$this->displayTag) : $this->displayTag;
        printf (PLUGIN_EVENT_FREETAG_USING, htmlspecialchars($tagTitle));
        echo '</h2>';
        echo '<div class="serendipity_freetag_taglist">';
        echo '<p class="serendipity_freetag_taglist_related">' . PLUGIN_EVENT_FREETAG_RELATED_TAGS . '</p>' . "\n";

In real life it's on top of all /plugin/tag/* pages before first entry
Quis custodiet ipsos custodes?

User avatar
garvinhicking
Core Developer
 
Posts: 29527
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Mar 21, 2011 11:52 am

Hi!

We really appreciate your input and feedback, and work on Serendipity. But it's really, really hard to understand your postings. You seem to have a good english vocabulary, but you really need to write longer sentences that better explain what you are thinking/talking about.

As for the code of your related tags - there's a configuration option in the plugin that toggle if the cloud should be displayed or not. So if you want to remove that part from the html output of your bloig, you can disable the 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/

LazyBadger
Regular
 
Posts: 175
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia

Postby LazyBadger » Mon Mar 21, 2011 12:13 pm

garvinhicking wrote:if you want to remove that part from the html output of your bloig, you can disable the option...

I'll try to make my English better - I haven't live practice rather long and here I have to fight with English-German mix in my head on writing. About output of related tags - no, I don't want suppress it totally, I just think about easy implementation of different design solutions (which now can be done only by editing code, it's uncommon solution for s9y)
Quis custodiet ipsos custodes?

User avatar
garvinhicking
Core Developer
 
Posts: 29527
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Mon Mar 21, 2011 2:14 pm

Hi!

If you prefer german, feel free to head over to the german section of this forums. But if you prefer to brush up on your english, that's fine as well. :-)

I think I understand what you want. Even though adding smarty output to that section is not really that hard, the performance impact of doing that would be a huge overhead. Do you have any specific modifications in mind? Because much can be solved with CSS.

The first step would be to simply edit the plugin file and use $serendipity['smarty']->assign to pass through the variables needed in that HTML to simply the core of s9y, without rendering a .tpl file. Instead, editing your base index.tpl template would then make it possible to use those variables. The overhead of this would be neglectible...?

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/

LazyBadger
Regular
 
Posts: 175
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia

Postby LazyBadger » Mon Mar 21, 2011 3:24 pm

garvinhicking wrote:If you prefer german, feel free to head over to the german section of this forums.
Ich wähle Englisch, weil mein gebrochenes Deutsch-Russischen (wie ich sie verstehe) noch schrecklich ruinen des Englischen
[/quote]I think I understand what you want. Even though adding smarty output to that section is not really that hard, the performance impact of doing that would be a huge overhead. Do you have any specific modifications in mind? Because much can be solved with CSS.[/quote]
Well, sometimes I see as a must a modification in a logic too. Just an example of my small changes (pure for aesthetic purposes)
/* echo '<h2 class="serendipity_date">';
...
echo '</h2>'; */
(only because a/ topic title are h4 b/ if theme have {$head_subtitle|@default:$blogDescription}
Code: Select all
printf (PLUGIN_EVENT_FREETAG_USING
duplicates the same text) plus some classes replacements, but latter is personal. But - I can suggest my changes as universal: b/ case is uncommon and themes can differ


The first step would be to simply edit the plugin file and use $serendipity['smarty']->assign to pass through the variables needed in that HTML to simply the core of s9y, without rendering a .tpl file.

And every changer have to repeat this step, yes? I can't see big difference this editing pure HTML and, also, these changes will stay a targets of future plugin updates, that I want to eliminate but give a possibility of flexible output

Instead, editing your base index.tpl template would then make it possible to use those variables. The overhead of this would be neglectible...?
If it possible, repeat this part in detail, please, for the "slowpoke-rhino" - I see nothing, that I do in index.tpl (checked default theme, saw one big
Code: Select all
<td id="content" valign="top">{$CONTENT}</td>
only)
Quis custodiet ipsos custodes?

User avatar
garvinhicking
Core Developer
 
Posts: 29527
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany

Postby garvinhicking » Tue Mar 22, 2011 11:05 am

Hi!

First I wanted to add an option to use a smarty template file to the plugni as an example, but I found out the plugin already has way too many options.

So I decided to add the smarty template by default, and simply hope everyone can take the small performance penalty. Version 3.20 now contains that change, you can get it via CVS and see how I implemented it. Hope that helps!

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/

LazyBadger
Regular
 
Posts: 175
Joined: Mon Aug 25, 2008 12:25 pm
Location: Russia

Postby LazyBadger » Tue Mar 22, 2011 6:56 pm

garvinhicking wrote:I decided to add the smarty template by default, and simply hope everyone can take the small performance penalty.

Thanks! It's excellent solution - and I hope to learn something new from comparing old and new code
Quis custodiet ipsos custodes?



Return to Development

Who is online

Users browsing this forum: No registered users and 1 guest