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.

@media print {
  .site-info, .entry-meta, .nav-links, .tags-links, a::after, #bit, .fa {
    display: none;
  }
  #masthead .site-title, .hentry .entry-title {
    font-size: 30px;
    font-family: Handlee;
  }
  #masthead .site-title {
    padding-bottom: 0px;
  }
  .post {
    padding-top: 0px;
  }
  .hentry .entry-content {
    padding-top: 0px;
  }
  h2 {
    font-size: 24px;
    margin-top: 5px;
  }
  table.easy-table {
    max-width: 90%;
  }
  .easy-table th, .easy-table td {
    padding-top: 1px;
    padding-bottom: 1px;
  }
}

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:

$t_menubox_array = array(
	'add_quickie' => array('POSITION' => 'gm_box_pos_4', 'STATUS' => 0),
	'admin' => array('POSITION' => 'gm_box_pos_101', 'STATUS' => 1),	// Admin Info
	'bestsellers' => array('POSITION' => 'gm_box_pos_112', 'STATUS' => 0),
	'cart' => array('POSITION' => 'gm_box_pos_107', 'STATUS' => 1),
	'categories' => array('POSITION' => 'gm_box_pos_2', 'STATUS' => 1),	// Kategorien
	'content' => array('POSITION' => 'gm_box_pos_104', 'STATUS' => 1),	// Mehr über ConeleK
	'currencies' => array('POSITION' => 'gm_box_pos_12', 'STATUS' => 0),
	'extrabox1' => array('POSITION' => 'gm_box_pos_22', 'STATUS' => 0),
	'extrabox2' => array('POSITION' => 'gm_box_pos_123', 'STATUS' => 0), 
	'extrabox3' => array('POSITION' => 'gm_box_pos_127', 'STATUS' => 0),
	'extrabox4' => array('POSITION' => 'gm_box_pos_128', 'STATUS' => 0),
	'extrabox5' => array('POSITION' => 'gm_box_pos_131', 'STATUS' => 0),
	'extrabox6' => array('POSITION' => 'gm_box_pos_133', 'STATUS' => 0),
	'extrabox7' => array('POSITION' => 'gm_box_pos_135', 'STATUS' => 0),
	'extrabox8' => array('POSITION' => 'gm_box_pos_137', 'STATUS' => 0),
	'extrabox9' => array('POSITION' => 'gm_box_pos_139', 'STATUS' => 0),
	'gm_bookmarks' => array('POSITION' => 'gm_box_pos_24', 'STATUS' => 0),
	'gm_counter' => array('POSITION' => 'gm_box_pos_20', 'STATUS' => 0),
	'gm_ebay' => array('POSITION' => 'gm_box_pos_8', 'STATUS' => 0),
	'gm_scroller' => array('POSITION' => 'gm_box_pos_31', 'STATUS' => 1),	// Neuigkeiten (Scrollbox)
	'gm_trusted_shops_widget' => array('POSITION' => 'gm_box_pos_142', 'STATUS' => 0),
	'infobox' => array('POSITION' => 'gm_box_pos_103', 'STATUS' => 1),	// Kundengruppe
	'information' => array('POSITION' => 'gm_box_pos_1', 'STATUS' => 1),	// Informationen
	'languages' => array('POSITION' => 'gm_box_pos_10', 'STATUS' => 0),
	'last_viewed' => array('POSITION' => 'gm_box_pos_26', 'STATUS' => 1),
	'login' => array('POSITION' => 'gm_box_pos_102', 'STATUS' => 1),	// Kundenlogin
	'manufacturers' => array('POSITION' => 'gm_box_pos_116', 'STATUS' => 0),
	'manufacturers_info' => array('POSITION' => 'gm_box_pos_125', 'STATUS' => 0),
	'newsletter' => array('POSITION' => 'gm_box_pos_18', 'STATUS' => 0),
	'order_history' => array('POSITION' => 'gm_box_pos_108', 'STATUS' => 0),
	'paypal' => array('POSITION' => 'gm_box_pos_140', 'STATUS' => 0),
	'reviews' => array('POSITION' => 'gm_box_pos_16', 'STATUS' => 0),
	'search' => array('POSITION' => 'gm_box_pos_2', 'STATUS' => 0),
	'specials' => array('POSITION' => 'gm_box_pos_105', 'STATUS' => 1),	// Angebote
	'trusted' => array('POSITION' => 'gm_box_pos_118', 'STATUS' => 0),
	'whatsnew' => array('POSITION' => 'gm_box_pos_106', 'STATUS' => 1),	// neue Artikel
        'yoochoose_also_clicked' => array('POSITION' => 'gm_box_pos_46', 'STATUS' => 0),
        'yoochoose_top_selling' => array('POSITION' => 'gm_box_pos_48', 'STATUS' => 0),
	'ekomi' => array('POSITION' => 'gm_box_pos_144', 'STATUS' => 0)
);

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:

'categories' => array('POSITION' => 'gm_box_pos_2', 'STATUS' => 1), // Kategorien

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

'STATUS' => 1

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

'POSITION' => 'gm_box_pos_2'

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

Die Box Kundenlogin

'login' => array('POSITION' => 'gm_box_pos_102', 'STATUS' => 1),	// Kundenlogin

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

'POSITION' => 'gm_box_pos_102'

und ist eingeschaltet, da

'STATUS' => 1

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:

<span class="shadow-left"> </span>
<span class="shadow-right"> </span>

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

.shadow-right {
    background-image: url("../images/shadow-r.png");
    /* ... */
}

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:
    .shadow-right,
    .shadow-left {
        background-image: none;
    }
  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:

public static final String PARAM_PARAMETER = "parameter";
@ConfigurationParameter(name = PARAM_PARAMETER, mandatory = false, description = "Description", defaultValue = "true")
private boolean parameter;

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:

${imp:import(org.apache.uima.fit.descriptor.ConfigurationParameter)}
public static final String PARAM_${paramNameCapitalized} = "${paramName}";
@ConfigurationParameter(name = PARAM_${paramNameCapitalized}, mandatory = false, 
    description = "${description}", defaultValue = "${defaultValue}")
private ${type} ${paramName};${cursor}

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:

${imp:import(org.apache.uima.fit.descriptor.ConfigurationParameter)}
public static final String PARAM_${paramNameCapitalized} = "${paramName}";
@ConfigurationParameter(name = PARAM_${paramNameCapitalized}, mandatory = true, description = "${description}")
private ${type} ${paramName};${cursor}

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:

${imp:import(org.apache.uima.UimaContext, org.apache.uima.resource.ResourceInitializationException)}

@Override
public void initialize(final UimaContext context) throws ResourceInitializationException
{
    super.initialize(context);
    ${cursor}
}

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:

${imp:import(org.apache.uima.analysis_engine.AnalysisEngineProcessException)}

@Override
public void collectionProcessComplete() throws AnalysisEngineProcessException
{
    ${cursor}
}

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):

[user]
    email = my mail address
    name = Roland Kluge
[core]
    editor = vim
    excludesfile = ~/.gitexcludes
[branch "master"]
    mergeoptions = --no-ff
[alias]
        l = log --graph --pretty=oneline --abbrev-commit --decorate
        lt = log --topo-order --graph --pretty=oneline --abbrev-commit --decorate
[color]
        # turn on color
        diff = auto
        status = auto
        branch = auto
        interactive = auto
        ui = auto
[color "branch"]
        current = green bold
        local = green
        remote = red bold
[color "diff"]
        meta = yellow bold
        frag = magenta bold
        old = red bold
        new = green bold
[color "status"]
        added = green bold
        changed = yellow bold
        untracked = red
[push]
        # 'git push' should only do the current branch, not all
        default = current
[branch]
        # always setup 'git pull' to rebase instead of merge
        autosetuprebase = always
[alias]
        st = status
        ci = commit
        br = branch
        co = checkout
        df = diff