Understand the Geocode Factoy style sheet CSS |
IntroductionThis article applies to all versions of Geocode Factory since v2.8.0. For version prior to v2.8.0 you need to manually edit your template CSS file. Geocode Factory can generate multiple elements on the web site front end. To be adaptable to many applications, all styles are customizable via both "template" and by editing the included CSS file. Generating the map templatePlease read this tutorial creating an advanced map for the basics on how to create your map template. Main elements such as the map itself, the side-list of entries, buttons, etc are rendered using predefined placeholders in the Geocode Factory administration console for the map you are using. In this article we want to use our Joomla 2.5 demo server for Geocode Factory and Sobipro. There are 2 markersets :
This is the sample template defined in back-end map manager : <div style="width:100%"> In green you see the 3 placeholders we have used in this template. The front-end result is visible here :
Enable the component's CSS fileYou can also do more styling via editing the provided CSS file. To prevent this this file from being overwritten during component updates, we have choice to rename this file by default. To activate this CSS file it needs to be renamed. You can use whatever method works for you, but we will use the example of FTP client or eXtplorer. Open the appropriate tool and browse to : components/com_geocode_factory/assets/css You will see this original file : REMOVE_geocode_factory.css This file will be updated at each component update. If you rename this file : geocode_factory.css. this file will be loaded anytime a Geocode Factory map is loaded. It doesn't matter if the map is loaded in a module or via component link. The styling follows the map. Which map it is applied to depends on the map ID as defined in the next section. Editing the CSSTo customize the CSS for a Geocode Factory element you name it with an ID in the style code. Here is an example of a map container that could be entered into the "Component Template" of the map manager : <div id="gf_map_1" style="width:100%; height:500px;"></div> The map ID in green is a sample div ID and it determines which styling is applied to the map. If you wanted to add a border to the map, simply edit the CSS file, and add the following lines: #gf_map_1{ The result is below. The map now has a 2 pixel wide grey border. (the corner of the map is visible behind the CSS editor shown in the picture) :
We can add styles to other elements this way as well. You can edit the side lists [sidelists], remove the borders, make the length unlimited etc. In this next example you can see the ID's that correspond to the name of each sidelist in the demo. It is all done through CSS styling. Here are some example CSS styles as displayed on the demo page : #sidelists{
Styles can be almost endless! A simple method to find the style of an element on a web page is by viewing the source code of the element or page. Firebug is a popular extension for the browser Firefox, but there are similar extensions for most popular browsers. Have fun!
|
| Last Updated on Sunday, 04 March 2012 12:20 |



