Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Para realizar la instalación sobre Joomla 1.5, es necesario realizar pequeñas modificaciones al archivo php del template para poder inyectar dinámicamente la librería de JavaScript y la variable de entorno. Hemos preparado una breve guía, sin embargo para más información, puede encontrar mucha documentación en internet.

Instalación de la libreria hotelrsv.js

Como visto en la guia de instalación, es necesario que la libreria hotelrsv.js este colocada en el segmento <head> </head>de toda pagina en donde se ejecutara el motor de reservaciones, en Joomla, lo ideal es que se inyecte desde el mismo template.

Determinar el “nombre” del template activo:

Entrar al administrador de Joomla

Dar click en Administrador (columna izquierda en página principal)

En Extensions ->Template Manager, encontrará una lista de templetes, normalmente hay uno marcado como ADMINISTRATOR y otro como SITE (o Sitio). El que esté marcado como SITIO es el template activo, y por tanto, ese es el nombre del template.

Editar index.php del Template activo

Conectarse via FTP o SFTP al servidor donde esté la instalación de Joomla

Abrir el directorio del template, normalmente desde la raiz joomla, el directorio del template se encuentra en PUBLIC_HTML_ROOT/JOMLA_ROOT/templates/mi_template

Descargar el archivo index.php

Abrir el archivo index.php en un editor de texto, por ejemplo notepad++.

Localizar la linea de codigo con el unico </head>

En la linea inmediatamente superior, agregar estas lineas de codigo:

Code Snippet

Code Block
themeDJango
<!-- HOTELRSV code -->
<script type="text/javascript" src="https://app.hotelrsv.com/app/js/hotelrsvplugin/hotelrsv.js"></script>
<script> INCLUIR_AQUI_EL_OTRO_CODIGO_INDICADO_POR_EL_EQUIPO_DE_SOPORTE </script>
<!-- END HOTELRSV code -->

El resultado final, debe de ser:
Final Snippet Outcome
Code Block
themeDJango
<head>
...
<!-- HOTELRSV code -->
<scripttype="text/javascript"src="https://app.hotelrsv.com/app/js/hotelrsvplugin/hotelrsv.js"></script>
<script> INCLUIR_AQUI_EL_OTRO_CODIGO_INDICADO_POR_EL_EQUIPO_DE_SOPORTE </script>
<!-- END HOTELRSV code -->
</head>

Guardar el archivo index.php

Subirlo al mismo directorio.
Cerrar FTP
Tip

Se recomienda guardar una copia del original de index.php

Con estas instrucciones, la libreria de hotelrsv.js siempre se cargara en todas las paginas de su sitio Joomla. Ahora puede seguir la guia de instalación para los botones o bien, leer las instrucciones siguientes para saber como instalar en los menús de Joomla.

Instalación de boton en Menu Joomla (class injection)

Para poder colocar uno de los botones en el menu de Joomla, se deben realizar las siguientes instrucciones.

Find id of the menu item

The steps are the following ones:

Login into Joomla

Click on Administrator (left column of the main page)

Go to Menus->Menu Manager on the backend.

Find the corresponding menu (for home page menu is “Main Menu”) and press “Menu Items”

Find the corresponding menu name that you want to be the one associated to the widget, let’s take for example “Reserve”

On the right of the table copy the corresponding Id (in the case of “Reserve” it’s 41) under the column ItemID

Inject class in the menu item

  1. Connect through ftp to your joomla 1.5 server
  2. Locate the folder of the menu module, which usually from the joomla root installation folder is under JoomlaRoot/modules/mod_mainmenu/tmpl
  3. Download the file default.php
  4. Open it with any text editor, and locate the line with “if (isset($path) && $node->attributes(‘id’) == $path[0]) {“
  5. Just above it paste the following lines of codeCode Snippet Menu Item
Code Block
themeDJango
if(($node->name() == 'li') && ($node->attributes('id') == 41)) {
    if($node->attributes('class')) {
        $node->addAttribute('class', 'rsv-app-launcher '.$node->attributes('class'));
    }
}
  6. Replace the 41 with the id that you found in the previos section
  7. The final outcome should like the following:
Code Block
themeDJango
...
if(($node->name() == 'li') && ($id= $node->attributes('id'))) {
        if($node->attributes('class')) {
            $node->addAttribute('class', $node->attributes('class').' item'.$id);
        } else{
            $node->addAttribute('class', 'item'.$id);
        }
    }
    
    if(($node->name() == 'li') && ($node->attributes('id') == 41)) {
        if($node->attributes('class')) {
            $node->addAttribute('class', 'rsv-app-launcher '.$node->attributes('class'));
        }
    }
    if(isset($path) && $node->attributes('id') == $path[0]) {
        $node->addAttribute('id', 'current');
    } else{
        $node->removeAttribute('id');
    }
...
8. Save the file index.php
9. Upload it in the same path from where it was downloaded
10. Close ftp

...

Note

Este manual se ha movido a help.novohit.com → Base de Conocimientos