Joomla.it Forum
Joomla! 2.5 (versione con supporto terminato) => Joomla! 1.6/1.7/2.5 => I Template di Joomla 1.6/1.7/2.5 => : Grig-o 28 Mar 2012, 12:49:45
-
Ciao a tutti.
Come da titolo avrei bisogno di modificare il modulo contatti ... cosa devo fare è abbastanza chiaro grazie al materiale di altri post e a questo utile articolo [size=78%]http://www.joomla.it/articoli-della-community/788-override-del-template-come-personalizzare-le-pagine-di-joomla.html (http://www.joomla.it/articoli-della-community/788-override-del-template-come-personalizzare-le-pagine-di-joomla.html)[/size]
Quello che mi manca però è il come ...
La mia esigenza è quella di visualizzare le due parti del modulo contatti (informazioni sul conttatto e modulo conttati) affiancate nella pagina ... e non una sopra l'altra come sono adesso ...
Qualcuno può aiutarmi :) ? grazie ... Sto utilizzando joomla 2.5
-
o aggiungi due div e uno lo fai flottare a lato dell'altro o fai una tabella 1 riga 2 colonne
M.
-
Ciao mau_develop e grazie per la risposta.
Qui sotto riporto i passaggi e le modifiche che ho fatto:
1. Per prima cosa, nella cartella html del mio template, ho creato le seguenti cartelle: com_contact/contact al cui interno ho incollato il file default.php preso da qui : /components/com_contact/views/contact/tmpl
2. all'interno del file , subito dopo l'apertura del div ho creato la tabella a due colonne ( td ) ... all'interno delle due colonne il codice l'ho diviso così (ovviamente abbreviato con i ".....")
<td>
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
. . . .
<?php if ($this->params->get('allow_vcard')) : ?>
<?php echo JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS');?>
<a href="<?php echo JRoute::_('index.php?option=com_contact&view=contact&id='.$this->contact->id . '&format=vcf'); ?>">
<?php echo JText::_('COM_CONTACT_VCARD');?></a>
<?php endif; ?>
</td>
<td>
<p></p>
<?php if ($this->params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) : ?>
.....
<?php if ($this->params->get('presentation_style')!='plain'){?>
<?php echo JHtml::_($this->params->get('presentation_style').'.end');} ?>
</td>
Niente di raffinato ma funziona :) ...
-
Ho fatto come hai spiegato, ma nulla, non si affianca.
Ecco tutto il codice:
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$cparams = JComponentHelper::getParams ('com_media');
?>
<div class="contact<?php echo $this->pageclass_sfx?>">
<td>
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->contact->name && $this->params->get('show_name')) : ?>
<h2>
<span class="contact-name"><?php echo $this->contact->name; ?></span>
</h2>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category') == 'show_no_link') : ?>
<h3>
<span class="contact-category"><?php echo $this->contact->category_title; ?></span>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category') == 'show_with_link') : ?>
<?php $contactLink = ContactHelperRoute::getCategoryRoute($this->contact->catid);?>
<h3>
<span class="contact-category"><a href="<?php echo $contactLink; ?>">
<?php echo $this->escape($this->contact->category_title); ?>[/url]
</span>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_contact_list') && count($this->contacts) > 1) : ?>
<form action="#" method="get" name="selectForm" id="selectForm">
<?php echo JText::_('COM_CONTACT_SELECT_CONTACT'); ?>
<?php echo JHtml::_('select.genericlist', $this->contacts, 'id', 'class="inputbox" onchange="document.location.href = this.value"', 'link', 'name', $this->contact->link);?>
</form>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')!='plain'){?>
<?php echo JHtml::_($this->params->get('presentation_style').'.start', 'contact-slider'); ?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_DETAILS'), 'basic-details'); } ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_DETAILS').'</h3>'; ?>
<?php endif; ?>
<?php if ($this->contact->image && $this->params->get('show_image')) : ?>
<div class="contact-image">
<?php echo JHtml::_('image', $this->contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle')); ?>
<>
<?php endif; ?>
<?php if ($this->contact->con_position && $this->params->get('show_position')) : ?>
<p class="contact-position"><?php echo $this->contact->con_position; ?></p>
<?php endif; ?>
<?php echo $this->loadTemplate('address'); ?>
<?php if ($this->params->get('allow_vcard')) : ?>
<?php echo JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS');?>
<a href="<?php echo JRoute::_('index.php?option=com_contact&view=contact&id='.$this->contact->id . '&format=vcf'); ?>">
<?php echo JText::_('COM_CONTACT_VCARD');?>[/url]
<?php endif; ?>
</td>
<td>
<p></p>
<?php if ($this->params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) : ?>
<?php if ($this->params->get('presentation_style')!='plain'):?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_EMAIL_FORM'), 'display-form'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
</td>
<?php echo '<h3>'. JText::_('COM_CONTACT_EMAIL_FORM').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('form'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_links')) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_articles') && $this->contact->user_id && $this->contact->articles) : ?>
<?php if ($this->params->get('presentation_style')!='plain'):?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('JGLOBAL_ARTICLES'), 'display-articles'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('JGLOBAL_ARTICLES').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('articles'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_profile') && $this->contact->user_id && JPluginHelper::isEnabled('user', 'profile')) : ?>
<?php if ($this->params->get('presentation_style')!='plain'):?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_PROFILE'), 'display-profile'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_PROFILE').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('profile'); ?>
<?php endif; ?>
<?php if ($this->contact->misc && $this->params->get('show_misc')) : ?>
<?php if ($this->params->get('presentation_style')!='plain'){?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_OTHER_INFORMATION'), 'display-misc');} ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_OTHER_INFORMATION').'</h3>'; ?>
<?php endif; ?>
<div class="contact-miscinfo">
<div class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_misc'); ?>
<>
<div class="contact-misc">
<?php echo $this->contact->misc; ?>
<>
<>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')!='plain'){?>
<?php echo JHtml::_($this->params->get('presentation_style').'.end');} ?>
<>
-
Ciao Ste_Goldberg
Forse ti sei confuso per via delle miei abbreviazioni del codice :) sorry.
Oltre che i <td> devi creare creare anche la tabella dopo il div.
Cmq per evitare confusione anche per altri utenti posto il codice completo :) .
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
* @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$cparams = JComponentHelper::getParams ('com_media');
?>
<div class="contact<?php echo $this->pageclass_sfx?>">
<table border="0" cellpadding="10" cellspacing="20">
<tbody>
<tr>
<td style="width: 35%;">
<?php if ($this->params->get('show_page_heading', 1)) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->contact->name && $this->params->get('show_name')) : ?>
<h2>
<span class="contact-name"><?php echo $this->contact->name; ?></span>
</h2>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category') == 'show_no_link') : ?>
<h3>
<span class="contact-category"><?php echo $this->contact->category_title; ?></span>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category') == 'show_with_link') : ?>
<?php $contactLink = ContactHelperRoute::getCategoryRoute($this->contact->catid);?>
<h3>
<span class="contact-category"><a href="<?php echo $contactLink; ?>">
<?php echo $this->escape($this->contact->category_title); ?>
</span>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_contact_list') && count($this->contacts) > 1) : ?>
<form action="#" method="get" name="selectForm" id="selectForm">
<?php echo JText::_('COM_CONTACT_SELECT_CONTACT'); ?>
<?php echo JHtml::_('select.genericlist', $this->contacts, 'id', 'class="inputbox" onchange="document.location.href = this.value"', 'link', 'name', $this->contact->link);?>
</form>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')!='plain'){?>
<?php echo JHtml::_($this->params->get('presentation_style').'.start', 'contact-slider'); ?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_DETAILS'), 'basic-details'); } ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_DETAILS').'</h3>'; ?>
<?php endif; ?>
<?php if ($this->contact->image && $this->params->get('show_image')) : ?>
<div class="contact-image">
<?php echo JHtml::_('image', $this->contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle')); ?>
<>
<?php endif; ?>
<?php if ($this->contact->con_position && $this->params->get('show_position')) : ?>
<p class="contact-position"><?php echo $this->contact->con_position; ?></p>
<?php endif; ?>
<?php echo $this->loadTemplate('address'); ?>
<?php if ($this->params->get('allow_vcard')) : ?>
<?php echo JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS');?>
<a href="<?php echo JRoute::_('index.php?option=com_contact&view=contact&id='.$this->contact->id . '&format=vcf'); ?>">
<?php echo JText::_('COM_CONTACT_VCARD');?>
<?php endif; ?>
</td>
<td style="width: 65%;">
<p></p>
<?php if ($this->params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) : ?>
<?php if ($this->params->get('presentation_style')!='plain'):?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_EMAIL_FORM'), 'display-form'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_EMAIL_FORM').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('form'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_links')) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_articles') && $this->contact->user_id && $this->contact->articles) : ?>
<?php if ($this->params->get('presentation_style')!='plain'):?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('JGLOBAL_ARTICLES'), 'display-articles'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('JGLOBAL_ARTICLES').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('articles'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_profile') && $this->contact->user_id && JPluginHelper::isEnabled('user', 'profile')) : ?>
<?php if ($this->params->get('presentation_style')!='plain'):?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_PROFILE'), 'display-profile'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_PROFILE').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('profile'); ?>
<?php endif; ?>
<?php if ($this->contact->misc && $this->params->get('show_misc')) : ?>
<?php if ($this->params->get('presentation_style')!='plain'){?>
<?php echo JHtml::_($this->params->get('presentation_style').'.panel', JText::_('COM_CONTACT_OTHER_INFORMATION'), 'display-misc');} ?>
<?php if ($this->params->get('presentation_style')=='plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_OTHER_INFORMATION').'</h3>'; ?>
<?php endif; ?>
<div class="contact-miscinfo">
<div class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_misc'); ?>
<>
<div class="contact-misc">
<?php echo $this->contact->misc; ?>
<>
<>
<?php endif; ?>
<?php if ($this->params->get('presentation_style')!='plain'){?>
<?php echo JHtml::_($this->params->get('presentation_style').'.end');} ?>
</td>
</tr>
</tbody>
</table>
<>
Non sò perchè ma l'editor toglie i <div> chiusi (quelli con la barra) ... quindi quando copi il codice dove c'è <> devi mettere <div> con la barra
-
Grazie mille, gentilissimo :)