7.0
Summary of content (63 pages)
PAGE 37
Styling - Edit forms
PAGE 38
4.9 Sub menus Several sections have one or multiple sub menus. Sub menus are used to navigate to sub sections of that specific section. Sub menus have their own classes and styles. The sub menu of the Settings section Like the Main menu and the User Info block the sub menus are created using HTML lists (
- tag and
- tags).
-
PAGE 39
Styling - Sub menus } #submenu li.level1{ padding-left: 1em; } #submenu .selected{ font-weight: bold; } 4.9.1 Multiple sub menus The Template.php file allows pages to have multiple sub menus. The source code of such a page has a unique id for each sub menu. In the style documents these IDs are grouped by separating each selector with a comma: #submenu li.level0, #submenu1 li.level0, #submenu2 li.level0{ } #submenu li.level1, #submenu1 li.level1, #submenu2 li.level1{ padding-left: 1.5em; } #submenu .
-
PAGE 40
5 Special variables In this section we list the special variables you can use in the Template.php and Style.php files. Objectif Lune Inc.
-
PAGE 41
5.1 Variables for template files The functions in this section can be used in templates files (e.g. Template.php). 5.1.1 generateString The generateString function retrieves a language string based on the supplied parameter. It is used to insert language dependent text. generateString(cSystemName); ?> /* Renders to following text */ PrintShop Web Custom strings can be added to the language strings. A string is made up of a name and a value, which are seperated by the = symbol.
-
PAGE 42
5.2 Variables for style files The PSM Web style files (e.g. Style.php) are regular CSS files. Its a PHP file that renders a CSS file. By including the skin_customization.php line at the beginning of your Style.php file the values entered in the Edit Web Design pages can be used in your style. Once included special PHP functions can be used to retrieve style information that is entered in the Edit Web Design page of the companies in PSM Web.
-
PAGE 43
Special variables - Variables for style files #tableOverview .subhead td { background-color: generateSkinContrastColor(); ?>; border-width: 0 1px 0 0; border-color: #FFFFFF; } 5.2.2 generateSkinContrastColorHighLight The generateSkinContrastColorHighLight function retrieves the skins contrast color set in the Edit Web Design page. A parameter can be supplied to change the tint of the color. Fractional values are used, where 0.0 will be black, 1.
-
PAGE 44
Special variables - Variables for style files 5.2.5 generateSkinHeaderColorHighLight The generateSkinHeaderColorHighLight function retrieves the skins header color set in the Edit Web Design page. A parameter llows the tint of the color to be changed. Fractional values are used, where 0.0 will be black, 1.0 the original color and higher values will result in a lighter tint of this color.
-
PAGE 45
Special variables - Variables for style files 5.2.9 generateSkinMainColorHighLight The generateSkinMainColorHighLight function retrieves the skins main color set in the Edit Web Design page. The parameter of this functions lets you change the tint of the color. Fractional values are used, where 0.0 will be black, 1.0 the original color and higher values will result in a lighter tint of the main color. Below an example on how this color can be set using this function.
-
PAGE 46
6 Creating page exceptions The Template.php file contains the main outline of the PSM Web web site, it contains HTM code with a few snippets of PHP. It is invoked for each page request and outputs the final page contents. The skinning engine lets you create templates for pages (page exceptions). This method can be used to add information and/or custom functionalities to a specific page. The Welcome page showing a banner image and custom side menus. Objectif Lune Inc.
-
PAGE 47
6.1 Creating a page specific template file To create a page specific template file you should create a copy of the main template.php file in the directory of your skin. Then, you need to rename to the file to template-
.php. The ID of the page should match the name of the class name of the body-element of that page (view the HTML source of the page in your browser or use webdevelopment plug-in like Firebug for Fire Fox). Use the class name of the body element in the template name ( ). -
PAGE 48
6.2 Modifying a page specific template file The duplicated template file contains various function blocks that render the final output. The position of these blocks combined with the style files define the presentation of the web site. By inserting HTML and PHP code you can add functions and information to the page. In some cases you might want to remove unwanted elements from the template, be very careful when experimenting with this at it might lead to a non working skin.
-
PAGE 49
Creating page exceptions - Modifying a page specific template file A custom welcome page. As the web site is created in PHP custom statements could be added based (for example based on the logged on user). With a little help of Javascript (jQuery) you could create an image rotator to show images as slide show. The following code creates a very simple image rotator. Note that we added display:none to the second banner in order to initially hide the image.
-
PAGE 50
7 DOM manipulation using jQuery jQuery is a fast and concise JavaScript Library that simplifies HTML document traversing, event handling, animating, and Ajax interactions for rapid web development. With the introduction of PrintShop Mail Web 2.x the jQuery library is part of the PSM Web installation. Information about jQuery can be found at: http://www.jquery.com The following sections describe the jQuery basics and give you helpful tips about how to use jQuery in PSM Web. Objectif Lune Inc.
-
PAGE 51
7.1 Launching code on Document Ready jQuery has a simple statement that checks the document and waits until it's ready to be manipulated, known as the ready event. Inside the ready event you can add the code that you want to run right when the page is loaded. You can add this Javascript code in the head section of the template.php file or create an external Javascript file.
-
PAGE 52
7.2 Populating fields with computed values The following sample populates a user input field of a PSM document with the current date (New Document section). First a string is created (toDay) with the current date. The last line in the code retrieves the input field based on the fields label (Today:) and populates the input field with the computed date string. Removing elements is not without risk and should be tested carefully (especially save actions). Objectif Lune Inc.
-
PAGE 54
7.4 Adding information to the DOM The following snippet adds an HTML snippet to the DOM. An comment line is added to the web form of the User Input fields page.