Work with LiveSite Components ‘Offline’

8 August 2008
by Billy Czajkowska

If you are developing LiveSite components in a shared environment, the chances are high that your editing will be interrupted by other users performing builds. To get around this you can bypass the online environment, and access the component files direct.
1) Use Samba or a tool such as FileZilla to access the component files. If you are using FileZilla, set the editor to VIM.
2) Select “view/edit” in FileZilla to access each LiveSite component.
3) The component file is very difficult to read as the XSL code has amongst other things,  < and > replaced with < and >
4) To remedy the above, add the following functions and menu options to your VIM environment :-
” Make a LiveSite component more readable
func MakeComponentReadable()
%s/ /<cr/>/g
set syntax=xml
” Restore a LiveSite component back to it’s original state prior to uploading
func RestoreComponent()
%s/<cr/>/ /g
set syntax=
amenu one.Make LS Component Readable :call MakeComponentReadable()<CR><ESC>
amenu one.Restore LS Component :call RestoreComponent()<CR><ESC>
5) The first function adds readability to the component file, whilst the second is used to restore the standard component formatting once your editing is done, and you are ready to upload the component back to the LS environment.

Our Latest News