[[:en:v2:vistrax:verbindungseinstellungen|BACK]] [[:en:v2:vistrax:einrichtungshilfen|NEXT]] \\ \\ \\ ===== CHAPTER 10: The XML Layout Scheme ===== ==== Introduction ==== Within vistrax, XML layout templates are employed at two important points: * Templates for visitor badges * Templates for visitor briefings The use of XML-based layout templates enables you to create and use an individualized layout. The layout used can be changed during use. Placeholders for dynamic information (so-called XML elements/tags) can be inserted or removed by you as required. XML files for vistrax must be saved with UTF8 without BOM coding. In certain circumstances, other codings cannot be correctly processed during import. When modifying an exported XML layout template it must be ensured that a suitable editor is used which does not change the required coding of the XML files. We recommend the free editor Notepad++. ==== XML Structure ==== === Available Main Elements === The following list shows the main XML elements available for designing layouts * Root element of a layout * Definiert eine Seite des Layouts * Defines a page of a layout * Defines layout size via its sub-elements * Element for displaying text * Image element * Background image (Warning: must only be used once per element!) === The Element === The element is the root element of an XML-based layout template which encloses the complete layout definition. === The Element === The corresponds to one page of a visitor badge or briefing. All layout elements enclosed within a tag are displayed on the same page. The first element in a layout definition must contain the element through which the size of the layout is defined. The tag offers the optional attribute paper. This allows a paper type to be pre-defined (e.g. paper = “DIN A4"). The paper type corresponds to the name of the paper template in the database. The paper attribute can be specified in each element, but currently only the attribute of the first element in a layout is evaluated and used as paper type for all existing pages. === The Element === The defines different properties of a layout page. These include the size of the layout. The element includes the following sub-elements: * Name of the layout (optional, will be shown as title-text of the preview window) * Vertical size in mm * Horizontal size in mm * Flipping of the content around the horizontal axis when printing (optional, standard: 0, 0 = deactivated, 1 = activated) === The Element === The element creates a text in the layout. The element includes the following sub-elements: * Top page margin (mm, decimal number e.g. 10.5) * Left page margin (mm, decimal number e.g. 10.5) * Width (mm, decimal number e.g. 10.5) * Height (mm, decimal number e.g. 10.5) * Rotation angle clockwise in ° (optional, standard: 0, whole number) rotation point is the center point of the text box. * Font size (e.g. 8) (optional, standard: 12, whole number) * Content of the text box * Bold font (optional, standard: 0, 0 = deactivated, 1 = activated) * Bold, overwrites (optional, standard: 0) * Italic font (optional, standard: 0, 0 = deactivated, 1 = activated) * Underlined (optional, standard: 0, 0 = deactivated, 1 = activated) * Capitalized (optional, standard: 0, 0 = deactivated, 1 = activated) * Text color (optional, standard: 000000, hex color) * Name of the font to be used * Antialising (optional, standard: 1, 0 = deactivated, 1 = activated) * Horizontal alignment (optional, standard: l; l = left , r = right, c = center) * Adjusts the text if the textbox is too small (optional, standard: 0, 0 = deactivated, 1 = activated) * Word wrap when the text reaches the end of the textbox (optional, standard: 0, 0 = deactivated, 1 = activated) * Cut of the text when textbox is too small (optional, standard: 0, 0 = deactivated, 1 = activated) * Insert a vertical space between text and text box border (optional, standard: 1, 0 = deactivated, 1 = activated) * Right-to-left alignment of the text, e.g. Arabic (optional, standard: 0, 0 = deactivated, 1 = activated) The tag also has the optional attribute type, with which the text box can be categorized. This type attribute allows font, color etc for all elements of the same type to be changed in the “Change Layout” input dialog. The following values are available for selection: * caption * label * content * footer All elements of the same type must possess the same formatting, i.e. if the tags described above are used within the element they must all include the same values. If the element in the “Change Layout” input dialog is not intended to be editable via a type group, the attribute must be left out. === The Element === The is used to display lines and frames. The element includes the following sub-elements: * Top page margin (mm, decimal number e.g. 10.5) * Left page margin (mm, decimal number e.g. 10.5) * Width (mm, decimal number e.g. 10.5) * Height (mm, decimal number e.g. 10.5) * Rotation angle clockwise in ° (optional, default: 0, int) The rotation point is the center point of the frame. * Solid (0 = FALSE, 1 = TRUE) * Color (optional, default 000000 -> Hex black) === The and Elements === The is used to insert images to the template. The element includes the following sub-elements: * Oberer Seitenabstand (mm, Kommazahl z.B. 10.5) * Linker Seitenabstand (mm, Kommazahl z.B. 10.5) * Breite (mm, Kommazahl z.B. 10.5) * Höhe (mm, Kommazahl z.B. 10.5) * Horizontale Ausrichtung (optional, Standard: l; l = Links , r = Rechts, c = Mitte) * Vertikale Ausrichtung (optional, Standard: t; t = Oben , b = Unten, c = Mitte) * Rotationswinkel im Uhrzeigersinn in ° (optional, Standard: 0, ganzzahliger Wert). Rotationspunkt ist der Mittelpunkt der Grafik. * Name des Bildes (Name aus der Datenbank) The special element identifies an optional background image. It serves the same purpose as the element, but may only be used once per and must be the first element defined on the page. Images inserted without “container markers” (i.e. static images) much be present in the database in order to be displayed. They can either be imported together with the layout as a .vxlt file or inserted manually via the media browser. ==== Content Maker ==== As well as supporting static texts and images, the layout system also offers the option of filling texts and images with dynamic content. This content is then determined by the current runtime information (the mandator, visitor, company etc). Dynamic content is inserted with defined placeholders (so-called “content markers”). - Content Marker === - Contentmarker === Bei einer Textbox kann der statische Inhalt des '''' Unterelementes durch einen der folgenden Contentmarker ersetzt werden: %%badge_no%% Badge number \\ %%badge_barcode%% Badge number as barcode \\ %%mandator_name%% Mandator's name \\ %%company_name%% Name of visitor's company \\ %%company_city%% City of visitor's company \\ %%company_country%% Country of visitor's company \\ %%company_remarks%% Remarks about the visitor's company, activate the wrapping element of the element for long texts (1). \\ %%visitor_salutation%% Visitor salutation \\ %%visitor_title%% Visitor title \\ %%visitor_firstname%% Visitor’s first name \\ %%visitor_lastname%% Visitor’s surname \\ %%visitor_email%% Visitor email \\ %%visitor_phone%% Visitor phone number \\ %%visitor_mobile%% Visitor mobile phone number \\ %%visitor_category%% Visitor category \\ %%visitor_name%% <Firstname> <Lastname> </code> \\ <code> %%visitor_name2%% <Lastname>, <Firstname> </code> \\ <code> %%visitor_name3%% <Firstname> <Lastname> </code> \\ <code> %%visitor_remarks%% Remarks about the visitor, activate the wrapping element of the <textbox> element for long texts (<wrapping>1</wrapping>). </code> \\ <code> %%identitycardno%% Identity card numbe </code> \\ <code> %%employee_salutation%% Employee salutation </code> \\ <code> %%employee_title%% Employee title </code> \\ <code> %%employee_firstname%% Employee firstname </code> \\ <code> %%employee_lastname%% Employee division </code> \\ <code> %%employee_division%% Employee email </code> \\ <code> %%employee_email%% Employee email </code> \\ <code> %%employee_phone%% Employee phone number </code> \\ <code> %%employee_mobile%% Employee mobile phone number </code> \\ <code> %%employee_name%% <Title> <Firstname> <Lastname> </code> \\ <code> %%employee_name2%% <Lastname>, <Firstname> </code> \\ <code> %%employee_name3%% <Firstname> <Lastname> </code> \\ <code> %%valid_from%% Validity start date (date and time) </code> \\ <code> %%valid_from_dateonly%% Validity start date (date only) </code> \\ <code> %%valid_from_timeonly%% Validity start date (time only) </code> \\ <code> %%valid_to%% Validity end date (date and time) </code> \\ <code> %%valid_to_dateonly%% Validity end date (date only) </code> \\ <code> %%valid_to_timeonly%% Validity end date (time only) </code> \\ <code> %%valid_date_time_line1%% Information on validity period, dependent on validity mode. Only use with …_Line2. </code> \\ <code> %%valid_date_time_line2%% Information on validity period, dependent on validity mode. Only use with …_Line1. </code> \\ <code> %%date%% The current date </code> \\ <code> %%time%% The current time </code> \\ <code> %%now%% The current date and current time </code> \\ <code> %%vehicle%% Vehicle number plate </code> \\ <code> %%visit_remarks%% Remarks about the visit, activate the wrapping element of the <textbox> element for long texts (<wrapping>1</wrapping>). </code> \\ <code> %%reason%% Reason for visit </code> \\ <code> %%gate%% Gate </code> \\ <code> %%whereabouts%% Whereabouts </code> \\ <code> %%_%% A blank between two other content markers. This avoids unnecessary blanks if one of the enclosing content markers is without content. If several successive "%%_%%" are created by replacing the other content markers (for example, because the content of a content marker does not exist), they are grouped into one blank. Combinations of a blank and a "%%_%%" are combined to a space. Leading and trailing "%%_%%" are removed. </code> \\ \\ == Examples: == * DayLong: %valid_date_time_line1% = 01.02.2013 - 02.02.2013 %valid_date_time_line2% = <empty> * DayToDay: %valid_date_time_line1% = 01.02.2013 - 02.02.2013 %valid_date_time_line2% = 08:00:00 - 17:00:00 * Continuous: %valid_date_time_line1% = 01.02.2013 08:00:00 - %valid_date_time_line2% = 02.02.2013 17:00:00 \\ \\ === <bitmap> - Contentmarker === For an image, the static content of the sub-element can be replaced by the following content markers: <code> %%company_logo%% Logo of the visiting company </code> <code> %%mandator_logo%% Mandator logo </code> <code> %%visitor_photo%% Photo of the visitor </code> <code> %%employee_photo%% Photo of the employee </code> \\ \\ ==== Structure of a Layout Template ==== === Basic Structure === The basic structure of a layout template comprises a single <layout> element and multiple <page> (incl. <badgedata>) elements. The structure is outlined below: <code> <?xml version=“1.0“ encoding=“UTF-8“?> <layout> <page> <badgedata> <vsize>120</vsize> <hsize>90</hsize> </badgedata> </page> </layout> </code> The basic structure above will only display a blank page. The basic structure can be expanded with further page elements. [[:en:v2:vistrax:xmllayout:beispiel|→You can find a more detailed example herer← ]] \\ \\ <col xs="3"><btn type="success" size="lg" >[[:en:v2:vistrax:verbindungseinstellungen|BACK]]</btn></col> <col xs="1"><btn type="success" size="lg" >[[:en:v2:vistrax:einrichtungshilfen|NEXT]]</btn></col>