Hola a todos, en este tutorial les enseñare como agregar mas botones al menu.
Primero vamos a nuestra carpeta Sources y abrimos el archivo Subs.php :
Buscamos :
// All the buttons we can possible want and then some, try pulling the final list of buttons from cache first.
Apartir de esta linea estan los botones del menu, como inicio, ayuda, busca, etc.
Tomaremos como ejemplo del boton Home, veremos la estructura del boton para hacer el nuestro.
'home' => array(
'title' => $txt['home'],
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
),
'is_last' => $context['right_to_left'],
),
'home' => array( : Key por el cual reconocemos el boton )
'title' => $txt['home'], : Titulo del boton ( Puede ser Blog, Chat, etc.)
'href' => $scripturl, : el enlace del boton (Puede ser '
http://www.tuforo.com' )
'show' => true, : Key para indicar si se va a mostrar el boton o no.
- true (Mostrar)
- false (no mostrar)
- $context['allow_admin'], (Solo mostrar para Administradores)
- $user_info['is_guest'], (Mostrar Para visitantes)
- !$user_info['is_guest'], (Mostrar Para Usuarios)
- array_intersect($user_info['groups'], array(1,2,3,4) (Para ciertos grupos, poner id de cada grupo separado por coma.
'sub_buttons' => array( : Esta sirve para agregar sub-menus.)
Devemos agregar justo debajo de este linea en 'sub_buttons'
'Blog' => array(
'title' => $txt['Blog'],
'href' => 'http://tuforo/blog
'show' => true,
'sub_buttons' => array(
'is_last' => $context['right_to_left'], : agrega la clase last, a los botones
Con eso nuestro boton quedaria algo asi :
'boton' => array(
'title' => $txt['boton'],
'href' => 'http://tuforo.com',
'show' => true,
'sub_buttons' => array(
'Blog' => array(
'title' => $txt['Blog'],
'href' => 'http://tuforo.com/blog
'show' => true,
'sub_buttons' => array(
),
ahora solo falta agregar al index.spanish(latin,es,ect).php las variables que usamos :
$txt['boton'] = 'tuForo';
$txt['blog'] = 'tuBlog';
espero les sirva
Gracias a Zutzu
Fuente :
Skinmod