feature request: recent entries and recent comment
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
feature request: recent entries and recent comment
Hi all,
I'm working on a drop down menu to be placed into a theme which uses the serendipity_showPlugin hook to display the recent comments and recent entries. My drop down is now working flawlessly and just needs some final styling.
Howerver the recent comments, and recent entries plugins have their html output hard coded into the php file. Is their any way these could be converted to use a smarty tpl file, and then also check to make sure one exists within the users template folder otherwise use the tpl file in the plugin folder?
This would allow theme designers to customise the placing of plugins, we wouldn't be restricted to the sidebar and the styles used. We could add our own styles, and format the output ourselves so they more closely fit into our design.
Hope this isn't too much of an issue, look forward to your responses.
Carl
I'm working on a drop down menu to be placed into a theme which uses the serendipity_showPlugin hook to display the recent comments and recent entries. My drop down is now working flawlessly and just needs some final styling.
Howerver the recent comments, and recent entries plugins have their html output hard coded into the php file. Is their any way these could be converted to use a smarty tpl file, and then also check to make sure one exists within the users template folder otherwise use the tpl file in the plugin folder?
This would allow theme designers to customise the placing of plugins, we wouldn't be restricted to the sidebar and the styles used. We could add our own styles, and format the output ourselves so they more closely fit into our design.
Hope this isn't too much of an issue, look forward to your responses.
Carl
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: feature request: recent entries and recent comment
The problem is that these plugins are "core" plugins and thus are optimized for performance. Tweaking them into Smarty .tpl files would cost performance pennies, which I'd like to avoid...
Soooo, bottom line: Can't it maybe be solved via CSS?
)
Many of the external plugins, BTW, use such a .tpl smarty customization (like staticpages, contactform or similars). But for most of the core bundled plugins I like to keep Smarty utilizing to a minimum, because seldomly the HTML output of those plugins needs to be altered...
Best regards,
Garvin
Soooo, bottom line: Can't it maybe be solved via CSS?
Many of the external plugins, BTW, use such a .tpl smarty customization (like staticpages, contactform or similars). But for most of the core bundled plugins I like to keep Smarty utilizing to a minimum, because seldomly the HTML output of those plugins needs to be altered...
Best 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/
# 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/
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
Garvn,
I understand what you're saying, makes sense, it just means my stylesheet has to much bigger because I need to duplicate almost every sidebar style, but prefix it with #nav so I can change the style when it appears in the menu.
Performance wise, which is better, a longer stylesheet, or changing hte core plugin? You're probably right, I guess I'm just getting carried away with the potential for theming. Just ignore me.
Cheers
Carl
I understand what you're saying, makes sense, it just means my stylesheet has to much bigger because I need to duplicate almost every sidebar style, but prefix it with #nav so I can change the style when it appears in the menu.
Performance wise, which is better, a longer stylesheet, or changing hte core plugin? You're probably right, I guess I'm just getting carried away with the potential for theming. Just ignore me.
Cheers
Carl
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi Carl!
Since the CSS is cached on the client side, that is much(!) faster than making Smartyficiation of the plugin.
And maybe you only need to override some little styles, and not all sidebar styles?
I won't ever ignore you!:) This case just is a performance weakness, were we just have to resort to things that are technically sane(tm). As much as I like the smarty abstraction,in some places it's just too expensive.
Best regards,
Garvin
Since the CSS is cached on the client side, that is much(!) faster than making Smartyficiation of the plugin.
And maybe you only need to override some little styles, and not all sidebar styles?
I won't ever ignore you!:) This case just is a performance weakness, were we just have to resort to things that are technically sane(tm). As much as I like the smarty abstraction,in some places it's just too expensive.
Best 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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Judebert,
but that wouldn't make it very intuitive for users of a template? They would need to first configure some plugins to enable that option for the theme, which would be annoying I guess?
Bestregards,
Garvin
but that wouldn't make it very intuitive for users of a template? They would need to first configure some plugins to enable that option for the theme, which would be annoying I guess?
Bestregards,
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/
# 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/
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
Garvin, perhaps what we need to do is continue to hard code the output within the core plugin file, but tidy up the code in this area so it is more flexible for theme designers. I haven't properly thought this through, so I don't have an alternative code for you, but as an example, the recent comments has three <br /> hard coded into it. Nightmare if you're aiming for tight integration since <br />'s can't be styled. Yes you can adjust line-heights, margins etc. but it isn't the same as separate div's.
Removing those <br />'s and allowing us to style the blocks would be more appropriate. Does anyone else share my concern?
To the developers, these aren't criticisms of s9y, its brilliant, the criticism stems from us trying to push the limits on what what has been done in the past and then realising that different developers seem to output different html.
Carl
Removing those <br />'s and allowing us to style the blocks would be more appropriate. Does anyone else share my concern?
To the developers, these aren't criticisms of s9y, its brilliant, the criticism stems from us trying to push the limits on what what has been done in the past and then realising that different developers seem to output different html.
Carl
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi Carl!
I agree, that having sensible hard-coded markup is a workable approach.
But you should be able to style "br" tags within plugins!
should work, doesn't it?
The problem with removing is, is that all existing templates would need CSS modification.
And, of course criticism is great and useful! We can only improve with criticism.
If you find other issues in plugins that can be solved withoutbreaking too much backwards compatibility, please let me/us kjnow!
Regards,
Garvin
I agree, that having sensible hard-coded markup is a workable approach.
But you should be able to style "br" tags within plugins!
Code: Select all
.serendipity_plugin_comments br {
display: none;
}
The problem with removing is, is that all existing templates would need CSS modification.
And, of course criticism is great and useful! We can only improve with criticism.
If you find other issues in plugins that can be solved withoutbreaking too much backwards compatibility, please let me/us kjnow!
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/
# 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/
-
Guest
Arghhh!
You're right, but the style needs to be written as;
Thanks, just goes to show when you get too close to the problem...
Carl
You're right, but the style needs to be written as;
Code: Select all
.container_serendipity_plugin_comments br {
display: none;
}
Carl
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
Can I request a modification to the recent comments html, this shouldn't affect other themes, and will still be backwards compatible, and will allow theme developers to further refine things.
Specifically what I want is for the output to include a couple of <span>'s so that I can style the three lines differently. At present everything is dumped into serendipitySideBarContent, but what I really want to be able to do is style the following differently;
1. the author name and link to entry
2. the date and time the comment was posted
3. the body of the comment
Perhaps we could use the span names comment_author, comment_date, and comment_body.
Is that a workable solution to retain compatibility with existing themes?
Carl
Specifically what I want is for the output to include a couple of <span>'s so that I can style the three lines differently. At present everything is dumped into serendipitySideBarContent, but what I really want to be able to do is style the following differently;
1. the author name and link to entry
2. the date and time the comment was posted
3. the body of the comment
Perhaps we could use the span names comment_author, comment_date, and comment_body.
Is that a workable solution to retain compatibility with existing themes?
Carl
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi Carl!
Sure, request like this are perfectly the ones I requested.
I added those selectors to the SVN trunk, which'll be part of the nightly snapshots. I needed to prefix the spans with "plugin_", because else it might break some templates that use a ".comment_author" selector for comments...
Best regards,
Garvin
Sure, request like this are perfectly the ones I requested.
I added those selectors to the SVN trunk, which'll be part of the nightly snapshots. I needed to prefix the spans with "plugin_", because else it might break some templates that use a ".comment_author" selector for comments...
Best 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/
# 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/
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact:
oops, tried it and it has a wee small problem. Somehow the final </span> which appears after the comment body isn't appearing in the html output. Unfortunately this prevents my styling from working at all. I tried moving it around in the plugin, but I only succeeded in getting a rather nasty smarty error. No php programming for me!
Anyway, I can see that the final </span> is actually included within the logic, but when I view the source from my browser after the page has generated the final </span> is missing.
Sorry to be the bearer of bad news, but if you could make it work I would be ecstatic.
Cheers
Carl
Anyway, I can see that the final </span> is actually included within the logic, but when I view the source from my browser after the page has generated the final </span> is missing.
Sorry to be the bearer of bad news, but if you could make it work I would be ecstatic.
Cheers
Carl
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Carl: You were right, the </span> was placed wrongly. The line needs to be:
I just committed it 
Regards,
Garvin
Code: Select all
. '<span class="plugin_comment_body">' . strip_tags($entry['comment'], '<br /><img>') . '</span>'
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/
# 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/
-
carl_galloway
- Regular
- Posts: 1331
- Joined: Sun Dec 04, 2005 5:43 pm
- Location: Andalucia, Spain
- Contact: