How to handle module topics in a web application?

I created a CMS that allows users to choose which modules to show on the website. I also have templates / themes that define how the site looks like. I have a problem:

Suppose I have posted a voting module on the site. When I click View Results, it displays the results with graphical columns like this demo page: http://osc.template-help.com/joomla_25754/index.php?option=com_poll&id=14:joomla-is-used -for

My first question is, is this graphic bar not responsible for themes / templates, not modules? If the modules can decide what to show, they may display some graphics that do not match the templates / themes.

How do I handle all this? I'm not really sure how best to explain the problem, but the problem is that in the current version some modules will display graphics / appearance that looks bad against some templates. All gfx and the like should be responsible for the templating system, right? But how could I achieve this ... how would modules and templates work together to build something like this, or do you have any other ideas?

+2


source to share


4 answers


Images should be defined by CSS theme

It is true that the appearance of graphical elements (in this case, result bars) must be defined in the theme's CSS file to match other themed elements.

But there are two possibilities, depending on your topics.



1. The graphic style does not change significantly (i.e. the icons will always be the same)
If your themes do not change the graphic style (i.e. from grunge to strict business-smart), but most likely by the color scheme, I suggest you use PNG with an alpha channel that will almost certainly fit into any color scheme.

2. The graphical style changes significantly (ie, every visual can / will change)
In this case, I suggest that you define all images within the theme's CSS files as background images. Elements <IMG>

should only display transparent images of the correct size (can also be determined by the theme), but the CSS file defined by a specific theme should determine the actual image to be displayed against the background of that transparent image. This way you will be able to use the same HTML but themed CSS files.

+4


source


Generally, you should try to use CSS class names that are standard for the CMS. For example. Joomla has classes called sectiontableentry1 and sectiontableentry2 for alternating rows in a table. If you can capture any of these classes, it will allow your extension to fit into the template's color scheme. If none of the standard class names are appropriate, it is best to try to switch to a neutral color scheme — usually grayscale.



Below is a list of basic CSS classes for Joomla: http://docs.joomla.org/Template_reference_material

+2


source


It cannot be done completely right. Most open source cmsms / blogs that are of some sort do not support it on all extensions, simply because the extensions are not within the control of the cms author (not inside the theme creator control). So the theme will look good on basic cms and maybe some common extensions, but after that she just crossed her fingers.

No matter how many elements / types / classes you define in advance for the decision makers, there will always be something that was not mentioned in the theme settings. The only way out of this is with very strict design guidelines, and even that will never get you 100% coverage, only closer than you could be without it.

Example: a histogram will be shown by some plugin. Your first attempt at a theme was to always require the theme to display 10 colors to be used in the diagram, of course this diagram needs 11 :-) Now your next iteration of the teasing engine requires the theme authors to map out to create an infinite the number of colors to use in the graphs (you just made the tester a little harder ...) Now of course the graph to be displayed requires 3 sets of every 2 similar colors ... you will never win this race.

I would say your best bet is to make sure the theme creators have a good set of base css classes to define (along with a large series of reference pages from your base cms so they can test their projects). You should now encourage your producers to use the default styles as often as possible and encourage them to do so by making it easy to test their extensions with multiple themes. As a final but very necessary option, you should allow the people who customize the site to easily override / fix the extension style within a specific theme - this should make the issues with the theme system just gibberish, not a deal breaker.

+1


source


As an option, we considered the possibility of overriding the theme of how the base elements of the module are displayed at the html level.

With asp.net mvc, this is pretty easy to implement and it will look like an Items folder with a specific file for each item like header.ascx, button_confirm.ascx, button.cancel.ascx, votes.ascx, tags.ascx and etc.

All of these files must have a common Model parameter, which must provide access to both module properties and content item properties. (I hope your content elements have a base class)

We stopped, it was just out of scope.

+1


source







All Articles