The Flat template is—in my opinion—a simple and elegant WordPress template.

Still, when printing blog pages, the output contains a large amount of whitespace.

CSS Customization

Using the template customization feature of WordPress, I adjusted the CSS of the Flat template to suit my needs.

The following CSS fragment is a suggestion for producing a more concise print rendering using the Flat WordPress theme.

Testing

I tested the print template live inside Firefox using the Developer Toolbar (Tools → Web Developer → Developer Toolbar) and the command media emulate print.

Chromium also offers a similar functionality in the Developer Tools (Ctrl+Shift+I) → Menu → More tools → Rendering → Emulate CSS media.

Dieser Artikel beschreibt, wie die Boxen in Gambio GX2 ohne Styledit platziert werden können.
Leider war es mir nicht möglich, die Platzierung der Boxen einfach aus Gambio in Gambio GX2 zu übernehmen.

Der Vorteil des Templatese gambio und gegenüber des neuen Templates EyeCandy ist, dass Boxen auf beiden Seiten platziert werden können: Links, wo der potentielle Kunde zuerst hin schaut, sollen nur wirklich relevante Informationen stehen. Diese sind das Feld für die Schnellsuche, der Produktkatalog und Links zu diesem Wiki (in dem sich die technischen Informationen für unsere CEK Module befinden) und die Sitemap. Rechts erscheinen Informationen, die nur für Besucher, die in Erwägung ziehen etwas zu kaufen, oder mehr allgemeine Informationen benötigen. Nur das Template gambio bietet die Möglichkeiten von beidseitigen Boxen.

Das Ergebnis kann man sich im Shop von ConeleK ansehen.

Platzierung der Boxen

Die Reihenfolge der Boxen kann in der Datei

/templates/gambio/template_settings.php

verändert werden. Die Information über die Positionierung und den Status der jeweiligen Box finden wir im Array  $t_menubox_array .

Im Folgenden ist das Array so wiedergegeben, wie es für unseren Shop definiert wurde:

Die Kommentare (//) geben den Titel an, unter welchem der Inhalt in der Seite erscheint.

Die Position der jeweiligen Box wird jeweils durch die Konstante 'POSITION' definiert.

Der Status der Box, also ob sie sichtbar oder unsichtbar ist, wird durch die Konstante 'Status' festgelegt.

Beispiel:

In diesem Beispiel handelt es sich um die Box Kategorien. Sie ist eingeschaltet

und befindet sich auf der linken Seite des Shops an Position 2.

Die Boxen für die rechte Seite haben für die Werte ≥ 100.

Die Box Kundenlogin

befindet sich auf der rechten Seite des Shops in der ersten Position 2, da

und ist eingeschaltet, da

Siehe auch

Allrounder is a very versatile template for Joomla. In its default version, the bottom corners of modules have a shadow that make the corner “lift” from the background (as if they were a piece of paper, see image).

"Lifted" corners at the bottom of a module

“Lifted” corners at the bottom of a module

I could not find a switch to disable this behavior, but the template offers to add custom CSS code. I took a look at the page’s source code and found that there are two <span> tags that build the left and right corners:

The shadow is actually a background image that is set via CSS:

The simplest way to fix this, is to reset the background-image to none.

Walkthrough

  1. Go to Extensions -> Template Manager and open the Allrounder style.
  2. Switch to the tab Advanced Template Options and scroll to the very bottom. (Here, you can also disable the header and footer Ribbons)
  3. Set Use Custom CSS Code to Yes
  4. Add the following CSS code in the text box:
  5. Click  Save and Close and refresh the site.

In a previous post, I described how to simplify the task of creating initialize and collectionProcessComplete methods using Eclipse templates. A similar technique can be applied to generate the idiomatic code for a uimaFit configuration parameter.

The shape of UIMA configuration parameters

An example of configuring UIMA components using uimaFit’s @ConfigurationParameter looks like this:

This snippet demonstrates some best practices that the community or I introduced:

  • The name-giving constant (here: PARAM_PARAMETER) is always public and bears the name of the parameter field as its value (here: “parameter”)
  • You should always provide a default value for non-mandatory parameters. The defaultValue property is always a String and the toString method normally cannot be applied due to compile time restrictions.
  • If a defaultValue attribute is given, uimaFit injects the default value automatically. That means that after the initialize method is complete, parameter has the value true.

For mandatory configuration parameters, only two parts have to be changed:

  1. There is no more defaultValue.
  2. The attribute mandatory is set to true.

Template for optional parameters

In order to create a new code template, open Window -> Preferences -> Java/Editor/Templates and Use the following metadata:

  • Name: uima_optional_param
  • Context: Java
  • Description: Generates an optional uimaFit configuration parameter

Pattern:

When you now type uima_optional_param in an editor, you will be prompted for the different parts of the template:

  • type is the type of the new parameter. You may choose any primitive type (int, boolean,…), any class that has a ‘single String’ constructor (e.g. File), enum types, and Locale/Pattern.
  • paramName is the parameter name. In Java, you should camel-case it, e.g. shallDeleteAll would be a valid parameter name.
  • paramNameCaptialized is the capitalized form of the parameter name. You should follow Java coding conventions, as illustrated in the following example: Parameter shallDeleteAll yields the  constant PARAM_SHALL_DELETE_ALL.
  • defaultValue is the default value of the configuration parameter. It will be injected into the class member by uimaFit.

Template for mandatory configuration parameters

Most things that I described about optional configuration parameters also apply to mandatory configuration parameters. The template for mandatory parameters can be created as follows: Create a new code template in Window -> Preferences -> Java/Editor/Templates and use the following metadata:

  • Name: uima_mandatory_param
  • Context: Java
  • Description: Generates a mandatory uimaFit configuration parameter

Pattern:

The variables in the template have the exact same meaning as in the template for optional parameters.

 References

  • [1] uimaFit wiki on @ConfigurationParameter

When I write UIMA annotators/consumers in Java, often code needs to be executed before and after the processing of all CASes. For this purpose, the base classes for annotators (JCasAnnotator_ImplBase) and consumers (JCasConsumer_ImplBase) offer two methods:

  • initialize(UimaContext) gets called in the beginning and
  • collectionProcessComplete() get called when the complete collection has been processed

Re-typing the skeletons of these two methods is tedious and you may even forget to execute the essential super.initialize(UimaContext) in the first method (otherwise your component will be in a rotten state!).

In Eclipse you can create templates for such tasks. Open Window -> Preferences -> Java/Editor/Templates and select New. We create templates for both methods separately.

Initialize

Use the following metadata:

  • Name: uima_init
  • Context: Java
  • Description: Generates a stub of the overriden initialize(UimaContext) method.

As pattern:

Besides the known Java code, the pattern defines that ResourceInitializationException should be imported and that the cursor is located after the call to super.initialize.

The template can be inserted by typing uima_init in the editor and selecting the template from the menu via Enter.

CollectionProcessComplete

Use the following metadata:

  • Name: uima_complete
  • Context:  Java
  • Description: Generates a stub of the overriden collectionProcessComplete() method.

As pattern:

Besides the known Java code, the pattern defines that AnalysisEngineProcessException should be imported and that the cursor is located inside the new method.

The template can be inserted by typing uima_complete in the editor and selecting the template from the menu via Enter.

References

  • [1] Stackoverflow thread with many useful templates (or links to them)
  • [2] JCasConsumer_ImplBase (uimaFit 2.0.0)
  • [3] JCasAnnotator_ImplBase (uimaFit 2.0.0)

The following is a suggested setup of the Git configuration file (_~/.gitconfig):