XSL
From VYRE
VYRE Unify uses XSL scripts extensively for transforming XML formatted data from the Content module, Users and groups module and more. XSL scripts can be managed in the Publishing module by going to Publishing > Files > XSL. Under that folder there are a number of sub-folders for storing XSL scripts for different purposes. XSL scipts will be available to different portlets and features based on what sub-folder they belong to. Within each of those folders you can create named folders for convenience of categorizing the files. There is a XSL quick start guide available to get you started with writing XSL scripts.
Contents |
Creating XSL folders
XSL folders in Unify can be used to organise XSL stylesheets. Each folder has title and description fields. The values entered should reflect the way in which the XSL stylsheets within the folder will be used or the site on which they will be used.
The folder title field will be displayed before the name of each XSL stylesheet when users are selecting XSL in a portlet configuration. So if a stylesheet called "list all" was within a folder called "news" portlet configuration menus will display "news - list all". For this reason XSL folder titles should be clear and concise.
The following form is used to create new XSL folders. Click the "Save" button in the context menu to create the folder.
Editing existing XSL folders
It is possible to edit the values of an XSL folders fields. You may need to do this if a sites name changes for example. This form is used to change the title and description of a user created XSL folder. Click the "Save" button on the context menu to save your changes.
Creating XSL files
To create a XSL script click on the appropriate folder under Publishing > Files > XSL and choose "Create" from the top menu bar. You will now be prompted for a Title and Description of the file and can either provide an existing File or edit the Contents. For most types of templates a relevant example will be provided in the content part. Press "Save" to create the file, you will then be taken to the edit page for the file. Note: a warning will be shown at the top of the edit page saying "No version has been deployed". The template will be available for use in the backend before deploying it, but not for the published versions of the site until you deploy it. You can deploy the template by pressing "Deploy" in the edit or edit source pages.
Modifying the XSL source
In the edit page or XSL list pages you can go to the edit source page for XSL files. After you have created the XSL file you will most likely modify it several times before you are ready to deploy the XSL. The screen shot below shows the XSL source edit screen. If you make a mistake causing the XSL not to be valid a warning box will appear when you try to save as shown on the screen shot.
The "Clean/Reformat code and save" option will reformat the source indentation before saving.
WARNING: using the reformat option can cause changes in the whitespace of the output HTML causing cosmetic variation in the end result.
The "Deploy" button deploys the current version to all sites making the changes available to the public.
Deploying all XSL files
It is possible to deploy all XSL files at once.
Comparing XSL stylsheet versions (since 4.4.1)
It is now possible to view the differences between any two versions of an XSL stylesheet within Unify. To compare versions select Edit > List all versions, then use the radio buttons to choose the versions that you wish to compare then click compare.



