Après avoir tester différent module, je pense opter pour le dernier : CompanyDirectory.
Par contre j'ai une petite question : j'ai ajouté des champs supplémentaires pour présenter les différentes structures. J'ai utilisé le code suivant {CompanyDirectory action="fe_edit"} pour permettre aux utilisateurs de crée leur structure.
Mais car il y en a un, mes champs "perso" n'apparaisse pas dans le formulaire.
Pourtant que je vais voir dans le fichier "orig_frontendform_template.tpl" :
Code :
[== HTML ==]
{if $companyid > 1}
<h4>{$mod->Lang('editcompany')}</h4>
{else}
<h4>{$mod->Lang('addcompany')}</h4>
{/if}
{cgerror}{$message}{/cgerror}
{$startform}
<div class="pagerow">
<div class="rowtext">{$nametext}</div>
<div class="rowinput">{$inputname}</div>
</div>
{if isset($inputstatus)}
<div class="pagerow">
<div class="rowtext">{$mod->Lang('status')}</div>
<div class="rowinput">{$inputstatus}</div>
</div>
{/if}
<div class="pagerow">
<div class="rowtext">{$addresstext}</div>
<div class="rowinput">{$inputaddress}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$mod->Lang('latitude')}</div>
<div class="rowinput">{$inputlatitude}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$mod->Lang('longitude')}</div>
<div class="rowinput">{$inputlongitude}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$telephonetext}</div>
<div class="rowinput">{$inputtelephone}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$faxtext}</div>
<div class="rowinput">{$inputfax}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$emailtext}</div>
<div class="rowinput">{$inputemail}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$websitetext}</div>
<div class="rowinput">{$inputwebsite}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$detailstext}</div>
<div class="rowinput">{$inputdetails}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$imagetext}</div>
<div class="rowinput">{$imagecurrent}{$imagecurrenthidden}{$imageupload}{$deletetext}{$imagecurrentdelete}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$logotext}</div>
<div class="rowinput">{$logocurrent}{$logocurrenthidden}{$logoupload}{$deletetext}{$logocurrentdelete}</div>
</div>
{if $customfieldscount gt 0}
{foreach from=$customfields item=customfield}
<div class="pagerow">
<p class="rowtext">{$customfield->name}:</p>
<p class="rowinput">{$customfield->input_box}</p>
{if isset($customfield->thumb_url)}
<a class="fancybox" href="{$customfield->image_url}"><img src="{$customfield->thumb_url}"></a>
{/if}
</div>
{/foreach}
{/if}
<div class="pagerow">
<div class="rowtext">{$mod->Lang('hierarchy')}:</div>
<div class="rowinput">{$inputhier}</div>
</div>
{if $categoriescount gt 0}
<div class="pagerow">
<p class="rowtext">{$mod->Lang('categories')}:</p>
<p class="rowinput">
<select name="{$actionid}cd_categories[]" multiple="multiple" size="5">
{html_options options=$catnames selected=$sel_categories"}
</select>
</p>
</div>
{/if}
<div class="pagerow">
<p class="rowtext"> </p>
<p class="rowinput">{$submit}</p>
</div>
{$endform}
Il y a bien la variable custumfield.
Apres dans le gabarit du module pour la page d'édition j'ai bien ceci :
Code :
[== HTML ==]
{if $companyid > 1}
<h4>{$mod->Lang('editcompany')}</h4>
{else}
<h4>{$mod->Lang('addcompany')}</h4>
{/if}
{cgerror}{$message}{/cgerror}
{$startform}
<div class="pagerow">
<div class="rowtext">{$nametext}</div>
<div class="rowinput">{$inputname}</div>
</div>
{if isset($inputstatus)}
<div class="pagerow">
<div class="rowtext">{$mod->Lang('status')}</div>
<div class="rowinput">{$inputstatus}</div>
</div>
{/if}
<div class="pagerow">
<div class="rowtext">{$addresstext}</div>
<div class="rowinput">{$inputaddress}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$telephonetext}</div>
<div class="rowinput">{$inputtelephone}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$faxtext}</div>
<div class="rowinput">{$inputfax}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$emailtext}</div>
<div class="rowinput">{$inputemail}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$websitetext}</div>
<div class="rowinput">{$inputwebsite}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$detailstext}</div>
<div class="rowinput">{$inputdetails}</div>
</div>
<div class="pagerow">
<div class="rowtext">nbabobpdb</div>
<div class="rowinput">{$inputdetails}</div>
</div>
<div class="pagerow">
<div class="rowtext">{$logotext}</div>
<div class="rowinput">{$logocurrent}{$logocurrenthidden}{$logoupload}{$deletetext}{$logocurrentdelete}</div>
</div>
{if $customfieldscount gt 0}
{foreach from=$customfields item=customfield}
<div class="pagerow">
<p class="rowtext">{$customfield->name}:</p>
<p class="rowinput">{$customfield->input_box}</p>
{if isset($customfield->thumb_url)}
<a class="fancybox" href="{$customfield->image_url}"><img src="{$customfield->thumb_url}"></a>
{/if}
</div>
{/foreach}
{/if}
<div class="pagerow">
<div class="rowtext">{$mod->Lang('hierarchy')}:</div>
<div class="rowinput">{$inputhier}</div>
</div>
{if $categoriescount gt 0}
<div class="pagerow">
<p class="rowtext">{$mod->Lang('categories')}:</p>
<p class="rowinput">
<select name="{$actionid}cd_categories[]" multiple="multiple" size="5">
{html_options options=$catnames selected=$sel_categories"}
</select>
</p>
</div>
{/if}
<div class="pagerow">
<p class="rowtext"> </p>
<p class="rowinput">{$submit}</p>
</div>
{$endform}
Normal jusqu'ici sauf que mes champs perso ne sont pas visible... (je précise qu'ils apparaissent bien quand je les crée à partir de panneau admin).