Introduction
This tutorial will show how one goes about modifying the layout of Cxense Content Recommendations using the Cxense Content Recommendation GUI shown to the right. The tutorial is part of a series of tutorials on Cxense Content Recommendations. The two other tutorials in the series are:
-
Cxense Content Recommendation Tutorial
-
Cxense Content Recommendation Config Tutorial
This tutorial assumes some basic understanding of CSS and that you have completed the first tutorial listed above or already posses the knowledge.
Generating the Javascript Code from the Default Javascript Template
Before we start editing CSS, we will generate the HTML towards which we will be working. Below we see the default Javascript template to the to the left, and to the right we see the HTML generated based on template (notice we have clicked the HTML tab above the window to the right).
Below we are repeating the default Javascript template shown to the left window in the GUI above.
|
Below we have taken the generated html code from the right side of the GUI screen shot above and integrated it into the structure of a complete html web page after having swapped the click and image urls to test files on our local computer. The reason the item structure (the div with class attribute set to "item") repeats itself 3 times is that we set the size of the widget to 3:
|
Whatever CSS we were to enter under the Styles tab in the GUI can now be tested here by inserting in the html code above where it says // HERE IS WHERE YOUR CSS STYLE WILL END UP.
Incremental CSS Changes
Starting with no CSS at all, we will, step by step, do increasingly more and more sophisticated modification to the widget layout using the html code above as our test framework.
Not Applying any CSS Style at all
Let's start by not doing any change. That is, by not adding any CSS at all. The result can be seen below.
Notice how the items were displayed vertically, that there are no action upon hoovering the mouse above any of the items, and the links are underlined and have the browser's default font type and size.
Going from Nothing to the Default CSS Style
Below we see how we can make the items be listed horizontally rather then vertically. The key here is the left floating.
|
Below we see how one can make the background change when hoovering the mouse above one of the items.
|
Below we remove the underlining of the link with the anchor text (text-decoration: none) and set the text font type, size and color of the title (the title appear within a h3 element, hence why we do the settings for this element).
|