Thanks for your reply. Thanks for the help with the HTML editor. It did not work for me. But due to some changes I made, it is not this important any more. I will explain the changes lateron.
To be straight and honest: My PR does not preserve compatability. This is why I was starting this thread. However, I have a newer version that almost will. But before coming to that, let me describe the current changes and their reasons:
Initial problem was that the <style> tag was generate somewhere in the <body>. This does not comform to HTML specification. The HTML validator marks this as an error although most browsers seem to accept it. Since I liked to have HTML compliant code, this problem got me started to work on the plugin. Additionally, the logo does not provide an alt-attribute. This as well is required by HTML. And whoever worked with visually impaired persons knows that this attribute is truly helpfulp. Adding the alt-attribute was easy. It just requires an extra configuration option. Although sidebarlogo already has a lot of options another option seemed to be acceptable for me. Solving the stylesheet problem was a different story.
The first approach I took was simply adding the style definitions from the plugins in to the css of my theme and use the classes inside the plugin. This does work for me. However, it requires the classes to be added to the theme style. That would make the plugin almost useless for users that simply want to select a theme and some plugins without knowing HTML and CSS. Therefore I searched for a better option.
The second thought was to move the <style> tag before the <body> tag where it belongs. I cannot see any way how a sidebar plugin could do and I believe not sidebar plugin should ever do it. Especially not if it is a simply as the sidebarlogo plugin.
The third option was to search for ids or classes defined by default in any of them are approriate for sidebarlogo. This is true for image and description but not for all the other fields. However, using predefined classes as much as possible seems to be a good approach.
The last option was to use style attributes for each div generated by sidebarlogo. That would leave us with the same flexibility we have now plus producing valid HTML. However, someone pointed out that inline styles should be avoided whenever possible. Therefore, I introduced an option to either specify an ID a class or inline styles. This works nicely. The big downside for me was that now for each element available for layout there is another option for styling it. The long list of options that was confusing for me in the beginning now was much longer. And we had a lot of inline styles since no classes where available. Therefore I decided to drop some fields like sitename, copyright and contact since they can easily be generated within the description field.
From the blogs I know, an about box with some text and a image is pretty common. Some themes for s9y even provide such a box and this is how I started as well. But from my understanding this is not the way it should be. There should be a plugin for that. Sidebarlogo provides many other fields and can be confusing for someone you simply wants such an about box. Therefore I stripped its functionality. This is the version that is included in my pull request.
However, I do not like to break compatability. Maybe someone uses these fields. But yet, due to my changes and even before that, sidebarlogo is quite complex for the simple functionality it provides and especially regarding what many people want. Yet my answer to your question about HTML nugget is the answer why I am now working on a version of sidebarlogo that includes all these field and yet remains simply to use for someone who only needs basic functionality. This version will include all fields that were present in the original version as well as the option to sort them. Regarding this, the compatability will be reached with that version. However it still breaks compatability regarding the handling of style sheets. I cannot see how to solve that. What I can offer is a feature compatible plugin but not an option compatible one.
A last note on this new version: It will hide a the advanced option like the fields that are not commonly used, the style options and the sorting of elements in a group "More options" and "Styles". Therefore, the user will be presented with a really simple interface first and can switch to the full potential as needed. I consider this a very good approach since it neither cripples functionality nor overwhelms someone who simply wants to add an image with some text. Simple at first, more complex if needed. However, there is something I need to fix before I upload this version. Currently, the groups are displayed first before the ungrouped options. Is there a way to change that? This is the code I use:
Code: Select all
$propbag->add('groups', array('FRONTEND_FEATURES'));
$propbag->add('config_groups', array(
PLUGIN_SIDEBARLOGO_GROUP_MOREOPTIONS => array(
'sitename',
'sitetag',
'contact',
'copyright',
'sequence'
),
PLUGIN_SIDEBARLOGO_GROUP_STYLES => array(
'imagestyle',
'descriptionstyle',
'sitenamestyle',
'sitetagstyle',
'contactstyle',
'copyrightstyle',
)
));
I must admint that I do not understand the meaning of the first line nor could I find any explanation for it. I just kept it from sidebarlogo and added the groups the same way as I have seen it with other plugins.
Regarding your question concerning HTML nugget: Well, sidebarlogo itself is basically a little more than HTML nugget. It is simply more convenient for someone you does not know HMTL and CSS or does not want to mix content and layout. I like sidebarlogo because it allows me to select the image just by choosing it from my media library and changing text just by typing. No HTML there. However, this of course proves wrong my argument about stripping those extra fields. I said you could add them by using HTML but yes, then the persons is in the same position I do not want to be in. That it why I will reintroduce those fields as described above. Sidebarlogo in all versions is simply taking away the burden of writing HTML if all you need is a small about box. Yes, it has some more fields and options but that does not change the intention of the plugin. If you want to, I can upload some images to show the advantage of sidebarlogo over HTML nugget.
To sum up my rather long explanation:
My current proposal for sidebarlogo is neither option compatible nor feature compatible. After solving the question I have asked above there will be a new proposal that is feature compatible and adds a few features. However, it will not be option compatible regarding the styles sheets. As explained above, I do believe that this will not be possible. However, for someone who did change the CSS it will be possible to do the same with the new version. Users that did not change the default CSS will not even notice since the styles almost remain the same.
Regards,
Oliver