Customizing the Front Page

The default PamelaWare front page HTML is a CSS-styled table containing four links:

  • A login link, which is in the form of the Information Card icon or ICI (also known as the purple "i").
  • A registration link, which is a regular anchor link containing the text "Register"
  • An account recovery link which is a regular anchor link containing the text "Lost my card"
  • A help link which is a regular anchor link containing the text "What's this?".

Read on to learn how you can customize and/or optimize this table:

Changing the icon size or using your own icon

The URL of the icon used on the front page is defined in the pw-config.php file, found in the main directory of the plugin. The line looks like this: define ('PW_FRONTPAGE_ICON', PW_PLUGINSUBPATH . '/pwlib/images/infocard_60x42.png' );

Any one of the following lines will work without needing to upload a new image:

 //medium, default
define ('PW_FRONTPAGE_ICON', PW_PLUGINSUBPATH . '/pwlib/images/infocard_60x42.png' );
//smaller
define ('PW_FRONTPAGE_ICON', PW_PLUGINSUBPATH . '/pwlib/images/infocard_30x21.png' ); 
//bigger
define ('PW_FRONTPAGE_ICON', PW_PLUGINSUBPATH . '/pwlib/images/infocard_114x80.png' );

Alternatively, this definition can be changed to any location within the plugin framework (be sure to test), for example: define ('PW_FRONTPAGE_ICON', '/mysubdirectory/customstuff/fancycardicon.png' );

Editing the frontpage CSS file

Front page code is stored in a CSS file called "frontpage.css", stored within the plugin-specific subdirectory in the "interface directory. For example, you would find the wordpress frontpage.css file at <wordpress installdir>/wp-content/plugins/wp-infocard/wp/interface/frontpage.css. The drupal frontpage.css file would be at <drupal installdir>/sites/all/modules/pw_infocard/dru/interface/frontpage.css.

Replacing the styles in the Frontpage Code

There are two styles used in the code - one is a class put on the table that encapsulates the links. The other is on the text links only.

To change the class associated with the table, edit this line in the pw-config.php file and change "pw_frontpage" to be whatever class you wish: define ('PW_FRONTPAGE_TABLE_CLASS', 'pw_frontpage' )

To change the class associated with the links, edit this line in the pw-config.php file and change "pw_frontpage_links" to be whatever class you wish: define ('PW_FRONTPAGE_LINKS_CLASS', 'pw_frontpage_links' );

Removing styles from the PamelaWare Frontpage HTML Altogether

To simply use the default values for either the tables or the links or both, edit the lines shown above, and set the value for PW_FRONTPAGE_LINKS_CLASS and/or PW_FRONTPAGE_TABLE_CLASS to be empty strings. If neither default class value is used, the code will not bother importing the frontpage.css file.

For example, to remove class settings from both the table and the links, set

Replacing classes with new values or no value

If you don't want PamelaWare to choose the style at all, you can change the class associated with either the table or the links or both. You can also remove the style such that default styling will apply to the

Replacing or Optimizing the HTML

If you are concerned with performance and your front page has to be screamin fast, you can replace the currently dynamically constructed html with a hard-coded string that does the same thing.

# Open the frontpage, and Just copy the function "getFrontPageLinks" in cardforms.pwlib.php to cardforms.pw.php, and then