Mise en forme des labels et champs de la fiche personnage séparément

Voir le sujet précédent Voir le sujet suivant Aller en bas

Résolu Mise en forme des labels et champs de la fiche personnage séparément

Message par Under the Moon Sam 5 Oct 2019 - 16:40

Détails techniques


Version du forum : phpBB2
Poste occupé : Fondateur
Navigateur(s) concerné(s) : Google Chrome
Personnes concernées par le problème : Moi uniquement
Lien du forum : http://moonlight-test.forumactif.com/

Description du problème

Rebonjour !

Je n'arrête plus les questions décidément :')
Alors voilà, m'étant attaquée au profil, j'aimerais désormais mettre en forme la fiche personnage. Le problème est que j'arrive effectivement à la mettre en forme, mais je n'arrive pas à séparer la mise en forme des labels et des champs en tant que tels.

Voici donc le template profile_view_body :
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<div class="PFIL"><div class="namePFIL colorPFIL">{USERNAME}</div>
  <script type="text/javascript">//<![CDATA[
$( document ).ready(function() {$('.colorPFIL').each(function(){var color = $(this).children().css("color");
$(this).closest('.namePFIL').css("background-color", color);});});//]]></script>
 
  <div class="firstbox">
    <div class="avPFIL">
      <div id="adminPFIL">
        <!-- BEGIN switch_auth_user -->
        <div><span>{L_ADMINISTRATE_USER} :</span><br/>{ADMINISTRATE_USER}{BAN_USER}</div>
        <!-- END switch_auth_user --><div>
        <!-- BEGIN switch_dhow_mp -->
        <span>{L_PRIVATE_MSG} :</span> {PRIVATE_MSG}
        <!-- END switch_dhow_mp --></div></div><span id="avatar_membre">{AVATAR_IMG}</span></div>
    <div class="lstPFIL"><span>{L_LAST_VISITED} :</span><br/> {LAST_VISIT_TIME}</div>
    <div class="infos-supp"></div>
  </div>
 
  <div class="boxPFIL">
    <div class="firstline"><a rel="nofollow" href="/sta/{PUSERNAME}"><div class="sbjPFIL">{L_TOPICS}</div></a>
      <a rel="nofollow" href="/spa/{PUSERNAME}"><div class="sbjPFIL">{L_POSTS}</div></a>
    <a rel="nofollow" href="/privmsg?mode=post&u={CUR_USER_ID}"><div class="sbjPFIL">Envoyer un MP</div></a></div>
    <div class="boxprofil"><div class="abtPFIL"><div class="titreprofil">Blablabla</div>
      <!-- BEGIN profile_field --><div class="infos-posteur"><div id="field_id{profile_field.ID}"><div>
      <span class="gen">{profile_field.LABEL}</span> <br/>{profile_field.CONTENT}</div></div></div>
      <!-- END profile_field --></div>
     
   
     
      <div id="ktactPFIL"><div class="titreprofil">Blablabla</div><br/>
      <!-- BEGIN switch_rpg --> <!-- BEGIN rpg_fields -->
        {switch_rpg.rpg_fields.F_NAME}<br/> <span class="contenuerp">{switch_rpg.rpg_fields.F_VALUE_NEW}</span><br/><br/>
 <!-- END rpg_fields --> <!-- END switch_rpg -->
     
    </div>
   
      <div class="contactprofil">        <div class="titreprofil">Blablabla</div>
    <!-- BEGIN contact_field -->
      <div class="ktactPFIL">{contact_field.CONTENT}</div><!-- END contact_field -->
   
  </div>
   
    </div> </div>
  <!-- BEGIN switch_rpg -->
  <div class="boxRPG"><div style="text-align:center">{RPG_IMAGE}</div><br/>
 {U_ADMIN_RPG}
 </div>
 <!-- END switch_rpg -->
<!-- BEGIN switch_admin_user_comment_active --><span class="gen">{L_COMMENTS} :</span><br /><span class="gensmall">{L_MODS_AND_ADMINS}</span> {ADMIN_USER_COMMENT}<!-- END switch_admin_user_comment_active -->
</div>
</table>
<br />
<script src="{JS_DIR}jquery/json/jquery.json-1.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
 $(document).ready(function(){
 $('[id^=field_id]').each(function(){
 if ( $(this).find('.field_editable').is('span, div') )
 {
 $(this).hover(function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().addClass('ajax-profil_hover').parent().addClass('ajax-profil_parent').append('<div class="ajax-profil_edit"><img src="{AJAX_EDIT_IMG}" /></div>');
 $(this).find('.ajax-profil_edit').attr({
 alt: "{L_FIELD_EDIT_VALUE}",
 title: "{L_FIELD_EDIT_VALUE}"
 }).click(function(){
 $(this).prev().prev().removeClass('ajax-profil_hover').addClass('invisible').next().removeClass('invisible').append('<img src="{AJAX_VALID_IMG}" class="ajax-profil_valid" />').find('input,select');
 $(this).prev().find('.ajax-profil_valid').attr({
 alt: "{L_VALIDATE}",
 title: "{L_VALIDATE}"
 }).click(function(){
 var content = new Array();
 $(this).parent().find('[name]').each(function(){
 var type_special = $(this).is('input[type=radio],input[type=checkbox]');
 if ( (type_special && $(this).is(':checked')) || !type_special )
 {
 content.push(new Array($(this).attr('name'), $(this).attr('value')));
 }
 });
 var id_name = $(this).parents('[id^=field_id]').attr('id');
 var id = id_name.substring(8, id_name.length);
 $.post(
 "{U_AJAX_PROFILE}",
 {id:id,user:"{CUR_USER_ID}",active:"{CUR_USER_ACTIVE}",content:$.toJSON(content),tid:"{TID}"},
 function(data){
 $.each(data, function(i, item){
 $('[id=field_id' + i + ']').find('.field_uneditable').html(item).end().find('.ajax-profil_valid').remove().end().find('.field_editable').addClass('invisible').end().find('.field_uneditable').removeClass('invisible');
 });
 },
 "json"
 );
 });
 $(this).remove();
 });
 }
 },function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().removeClass('ajax-profil_hover');
 $(this).find('.ajax-profil_edit').remove();
 }
 });
 }
 });
 });
//]]>
</script>
    <script type="text/javascript">
  $(function(){
$('.boxprofil').find('.infos-posteur').each(function(){
var id=$(this).find('div:first').attr('id');
$(this).addClass(id);
  });});
  </script>

<script type="text/javascript">$(function(){
    $('span.label').each(function(){
 $(this).html($(this).html().replace(":", ''));
    });
  });</script>

J'ai bien essayé de rajouter une class à chacune des deux variables mais rien y fait, cela ne change rien :/

Merci à celui/celle qui saura quoi faire Very Happy
Under the Moon

Under the Moon
**

Messages : 62
Inscrit(e) le : 13/08/2019

https://testalohomora.forumactif.com/
Under the Moon a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Mise en forme des labels et champs de la fiche personnage séparément

Message par Under the Moon Lun 7 Oct 2019 - 14:12

Un tiot up ? ^^
Under the Moon

Under the Moon
**

Messages : 62
Inscrit(e) le : 13/08/2019

https://testalohomora.forumactif.com/
Under the Moon a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Mise en forme des labels et champs de la fiche personnage séparément

Message par Under the Moon Mar 8 Oct 2019 - 15:15

Up ?
Under the Moon

Under the Moon
**

Messages : 62
Inscrit(e) le : 13/08/2019

https://testalohomora.forumactif.com/
Under the Moon a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Mise en forme des labels et champs de la fiche personnage séparément

Message par Invité Mar 8 Oct 2019 - 16:20

Hello Under the Moon,


pour la partie RPG:

Tu renseignes ceci:

Code:
<div id="ktactPFIL"><div class="titreprofil">Blablabla</div><br/>
      <!-- BEGIN switch_rpg --> <!-- BEGIN rpg_fields -->
        {switch_rpg.rpg_fields.F_NAME}<br/> <span class="contenuerp">{switch_rpg.rpg_fields.F_VALUE_NEW}</span><br/><br/>
 <!-- END rpg_fields --> <!-- END switch_rpg -->
      
    </div>

Les divs doivent se trouver à l'intérieure des commentaires afin de prendre en compte toutes les fiches:

Code:

      <!-- BEGIN switch_rpg --> <!-- BEGIN rpg_fields -->
<div id="ktactPFIL"><div class="titreprofil">Blablabla</div><br/>
        {switch_rpg.rpg_fields.F_NAME}<br/> <span class="contenuerp">{switch_rpg.rpg_fields.F_VALUE_NEW}</span><br/><br/>
      
    </div>
 <!-- END rpg_fields --> <!-- END switch_rpg -->


Concernant la div receveuse:
Code:
<div id="ktactPFIL">

Je lui ai ajouté une class:
Code:
   <div id="ktactPFIL" class="M14_rpg">

Puis le script(ajouté dans ton template):
Code:
<script>$(function(){$( ".M14_rpg ").attr( "class", function(div) {
return "Number_" +div;})});</script>


qui va rechercher toutes les class présentes et va les modifier en:
Pour la première:
Code:
Number_0
Pour la deuxième:
Code:
Number_1

Tu auras alors l'id plus la class (pour la première):
Code:
#ktactPFIL.Number_0{TA CSS}


ton template modifié:
Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<div class="PFIL"><div class="namePFIL colorPFIL">{USERNAME}</div>
  <script type="text/javascript">//<![CDATA[
$( document ).ready(function() {$('.colorPFIL').each(function(){var color = $(this).children().css("color");
$(this).closest('.namePFIL').css("background-color", color);});});//]]></script>
  
  <div class="firstbox">
    <div class="avPFIL">
      <div id="adminPFIL">
        <!-- BEGIN switch_auth_user -->
        <div><span>{L_ADMINISTRATE_USER} :</span><br/>{ADMINISTRATE_USER}{BAN_USER}</div>
        <!-- END switch_auth_user --><div>
        <!-- BEGIN switch_dhow_mp -->
        <span>{L_PRIVATE_MSG} :</span> {PRIVATE_MSG}
        <!-- END switch_dhow_mp --></div></div><span id="avatar_membre">{AVATAR_IMG}</span></div>
    <div class="lstPFIL"><span>{L_LAST_VISITED} :</span><br/> {LAST_VISIT_TIME}</div>
    <div class="infos-supp"></div>
  </div>
  
  <div class="boxPFIL">
    <div class="firstline"><a rel="nofollow" href="/sta/{PUSERNAME}"><div class="sbjPFIL">{L_TOPICS}</div></a>
      <a rel="nofollow" href="/spa/{PUSERNAME}"><div class="sbjPFIL">{L_POSTS}</div></a>
    <a rel="nofollow" href="/privmsg?mode=post&u={CUR_USER_ID}"><div class="sbjPFIL">Envoyer un MP</div></a></div>
    <div class="boxprofil"><div class="abtPFIL"><div class="titreprofil">Blablabla</div>
      <!-- BEGIN profile_field --><div class="infos-posteur"><div id="field_id{profile_field.ID}"><div>
      <span class="gen">{profile_field.LABEL}</span> <br/>{profile_field.CONTENT}</div></div></div>
      <!-- END profile_field --></div>
      
    
      
    
      <!-- BEGIN switch_rpg --> <!-- BEGIN rpg_fields -->
       <div id="ktactPFIL" class="M14_rpg"><div class="titreprofil">Blablabla</div><br/>
        {switch_rpg.rpg_fields.F_NAME}
        <br/> <span class="contenuerp">{switch_rpg.rpg_fields.F_VALUE_NEW}</span><br/><br/>
            </div>
 <!-- END rpg_fields --> <!-- END switch_rpg -->
<script>$(function(){$( ".M14_rpg ").attr( "class", function(div) {
return "Number_" +div;})});</script>
 
    
      <div class="contactprofil">         <div class="titreprofil">Blablabla</div>
    <!-- BEGIN contact_field -->
      <div class="ktactPFIL">{contact_field.CONTENT}</div><!-- END contact_field -->
    
   </div>
    
    </div> </div>
  <!-- BEGIN switch_rpg -->
  <div class="boxRPG"><div style="text-align:center">{RPG_IMAGE}</div><br/>
 {U_ADMIN_RPG}
 </div>
 <!-- END switch_rpg -->
<!-- BEGIN switch_admin_user_comment_active --><span class="gen">{L_COMMENTS} :</span><br />
  <span class="gensmall">{L_MODS_AND_ADMINS}</span> {ADMIN_USER_COMMENT}<!-- END switch_admin_user_comment_active -->
</div>
</table>
<br />
<script src="{JS_DIR}jquery/json/jquery.json-1.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
 $(document).ready(function(){
 $('[id^=field_id]').each(function(){
 if ( $(this).find('.field_editable').is('span, div') )
 {
 $(this).hover(function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().addClass('ajax-profil_hover').parent().addClass('ajax-profil_parent').append('<div class="ajax-profil_edit"><img src="{AJAX_EDIT_IMG}" /></div>');
 $(this).find('.ajax-profil_edit').attr({
 alt: "{L_FIELD_EDIT_VALUE}",
 title: "{L_FIELD_EDIT_VALUE}"
 }).click(function(){
 $(this).prev().prev().removeClass('ajax-profil_hover').addClass('invisible').next().removeClass('invisible').append('<img src="{AJAX_VALID_IMG}" class="ajax-profil_valid" />').find('input,select');
 $(this).prev().find('.ajax-profil_valid').attr({
 alt: "{L_VALIDATE}",
 title: "{L_VALIDATE}"
 }).click(function(){
 var content = new Array();
 $(this).parent().find('[name]').each(function(){
 var type_special = $(this).is('input[type=radio],input[type=checkbox]');
 if ( (type_special && $(this).is(':checked')) || !type_special )
 {
 content.push(new Array($(this).attr('name'), $(this).attr('value')));
 }
 });
 var id_name = $(this).parents('[id^=field_id]').attr('id');
 var id = id_name.substring(8, id_name.length);
 $.post(
 "{U_AJAX_PROFILE}",
 {id:id,user:"{CUR_USER_ID}",active:"{CUR_USER_ACTIVE}",content:$.toJSON(content),tid:"{TID}"},
 function(data){
 $.each(data, function(i, item){
 $('[id=field_id' + i + ']').find('.field_uneditable').html(item).end().find('.ajax-profil_valid').remove().end().find('.field_editable').addClass('invisible').end().find('.field_uneditable').removeClass('invisible');
 });
 },
 "json"
 );
 });
 $(this).remove();
 });
 }
 },function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().removeClass('ajax-profil_hover');
 $(this).find('.ajax-profil_edit').remove();
 }
 });
 }
 });
 });
//]]>
</script>
    <script type="text/javascript">
  $(function(){
$('.boxprofil').find('.infos-posteur').each(function(){
var id=$(this).find('div:first').attr('id');
$(this).addClass(id);
   });});
  </script>
 
<script type="text/javascript">$(function(){
    $('span.label').each(function(){
 $(this).html($(this).html().replace(":", ''));
    });
  });</script>



Wink

a++
Anonymous

Invité
Invité


Invité a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Mise en forme des labels et champs de la fiche personnage séparément

Message par Under the Moon Mar 8 Oct 2019 - 21:32

Hey! Merci pour ta réponse Very Happy

J'ai donc fait comme décrit, mais c'est toute la colonne id ktactPFIL qui prend la class Number_0
Tous les span titre de la fiche de personnage (donc "Description du personnage" ou "motif de notoriété" et les autres) sont toujours aussi intouchables :/

J'ai modifié mon template, je le remet donc là ^^

Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<div class="PFIL"><div class="namePFIL colorPFIL">{USERNAME}</div>
  <script type="text/javascript">//<![CDATA[
$( document ).ready(function() {$('.colorPFIL').each(function(){var color = $(this).children().css("color");
$(this).closest('.namePFIL').css("background-color", color);});});//]]></script>
 
  <div class="firstbox">
    <div class="avPFIL">
      <div id="adminPFIL">
        <!-- BEGIN switch_auth_user -->
        <div><span>{L_ADMINISTRATE_USER} :</span><br/>{ADMINISTRATE_USER}{BAN_USER}</div>
        <!-- END switch_auth_user --><div>
        <!-- BEGIN switch_dhow_mp -->
        <span>{L_PRIVATE_MSG} :</span> {PRIVATE_MSG}
        <!-- END switch_dhow_mp --></div></div><span id="avatar_membre">{AVATAR_IMG}</span></div>
    <div class="lstPFIL"><span>{L_LAST_VISITED} :</span><br/> {LAST_VISIT_TIME}</div>
    <div class="infos-supp"></div>
  </div>
 
  <div class="boxPFIL">
    <div class="firstline"><a rel="nofollow" href="/sta/{PUSERNAME}"><div class="sbjPFIL">{L_TOPICS}</div></a>
      <a rel="nofollow" href="/spa/{PUSERNAME}"><div class="sbjPFIL">{L_POSTS}</div></a>
    <a rel="nofollow" href="/privmsg?mode=post&u={CUR_USER_ID}"><div class="sbjPFIL">Envoyer un MP</div></a></div>
    <div class="boxprofil"><div class="abtPFIL"><div class="titreprofil">Blablabla</div>
      <!-- BEGIN profile_field --><div class="infos-posteur"><div id="field_id{profile_field.ID}"><div>
      <span class="gen">{profile_field.LABEL}</span> <br/>{profile_field.CONTENT}</div></div></div>
      <!-- END profile_field --></div>
     
   
     
      <div id="ktactPFIL" class="M14_rpg"><div class="titreprofil">Blablabla</div><br/>
      <!-- BEGIN switch_rpg --> <!-- BEGIN rpg_fields -->
        {switch_rpg.rpg_fields.F_NAME}<br/> <span class="contenuerp">{switch_rpg.rpg_fields.F_VALUE_NEW}</span><br/><br/>
 <!-- END rpg_fields --> <!-- END switch_rpg -->
     
    </div>
   
      <div class="contactprofil">        <div class="titreprofil">Blablabla</div>
    <!-- BEGIN contact_field -->
      <div class="ktactPFIL">{contact_field.CONTENT}</div><!-- END contact_field -->
   
  </div>
   
    </div> </div>
  <!-- BEGIN switch_rpg -->
  <div class="boxRPG"><div style="text-align:center">{RPG_IMAGE}</div><br/>
 {U_ADMIN_RPG}
 </div>
 <!-- END switch_rpg -->
<!-- BEGIN switch_admin_user_comment_active --><span class="gen">{L_COMMENTS} :</span><br /><span class="gensmall">{L_MODS_AND_ADMINS}</span> {ADMIN_USER_COMMENT}<!-- END switch_admin_user_comment_active -->
</div>
</table>
<br />
<script src="{JS_DIR}jquery/json/jquery.json-1.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
 $(document).ready(function(){
 $('[id^=field_id]').each(function(){
 if ( $(this).find('.field_editable').is('span, div') )
 {
 $(this).hover(function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().addClass('ajax-profil_hover').parent().addClass('ajax-profil_parent').append('<div class="ajax-profil_edit"><img src="{AJAX_EDIT_IMG}" /></div>');
 $(this).find('.ajax-profil_edit').attr({
 alt: "{L_FIELD_EDIT_VALUE}",
 title: "{L_FIELD_EDIT_VALUE}"
 }).click(function(){
 $(this).prev().prev().removeClass('ajax-profil_hover').addClass('invisible').next().removeClass('invisible').append('<img src="{AJAX_VALID_IMG}" class="ajax-profil_valid" />').find('input,select');
 $(this).prev().find('.ajax-profil_valid').attr({
 alt: "{L_VALIDATE}",
 title: "{L_VALIDATE}"
 }).click(function(){
 var content = new Array();
 $(this).parent().find('[name]').each(function(){
 var type_special = $(this).is('input[type=radio],input[type=checkbox]');
 if ( (type_special && $(this).is(':checked')) || !type_special )
 {
 content.push(new Array($(this).attr('name'), $(this).attr('value')));
 }
 });
 var id_name = $(this).parents('[id^=field_id]').attr('id');
 var id = id_name.substring(8, id_name.length);
 $.post(
 "{U_AJAX_PROFILE}",
 {id:id,user:"{CUR_USER_ID}",active:"{CUR_USER_ACTIVE}",content:$.toJSON(content),tid:"{TID}"},
 function(data){
 $.each(data, function(i, item){
 $('[id=field_id' + i + ']').find('.field_uneditable').html(item).end().find('.ajax-profil_valid').remove().end().find('.field_editable').addClass('invisible').end().find('.field_uneditable').removeClass('invisible');
 });
 },
 "json"
 );
 });
 $(this).remove();
 });
 }
 },function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().removeClass('ajax-profil_hover');
 $(this).find('.ajax-profil_edit').remove();
 }
 });
 }
 });
 });
//]]>
</script>
    <script type="text/javascript">
  $(function(){
$('.boxprofil').find('.infos-posteur').each(function(){
var id=$(this).find('div:first').attr('id');
$(this).addClass(id);
  });});
  </script>

<script type="text/javascript">$(function(){
    $('span.label').each(function(){
 $(this).html($(this).html().replace(":", ''));
    });
  });</script>

<script>$(function(){$( ".M14_rpg ").attr( "class", function(div) {
return "Number_" +div;})});</script>
Under the Moon

Under the Moon
**

Messages : 62
Inscrit(e) le : 13/08/2019

https://testalohomora.forumactif.com/
Under the Moon a été remercié(e) par l'auteur de ce sujet.

Résolu Re: Mise en forme des labels et champs de la fiche personnage séparément

Message par Invité Mer 9 Oct 2019 - 18:34

Hello Under the Moon,

alors on va changer le script et la position de la div contenant chaque feuille de personnage:
Code:
<div  class="M14_rpg">    {switch_rpg.rpg_fields.F_NAME}

Ton template modifié:

Code:
<table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<div class="PFIL"><div class="namePFIL colorPFIL">{USERNAME}</div>
  <script type="text/javascript">//<![CDATA[
$( document ).ready(function() {$('.colorPFIL').each(function(){var color = $(this).children().css("color");
$(this).closest('.namePFIL').css("background-color", color);});});//]]></script>
 
  <div class="firstbox">
    <div class="avPFIL">
      <div id="adminPFIL">
        <!-- BEGIN switch_auth_user -->
        <div><span>{L_ADMINISTRATE_USER} :</span><br/>{ADMINISTRATE_USER}{BAN_USER}</div>
        <!-- END switch_auth_user --><div>
        <!-- BEGIN switch_dhow_mp -->
        <span>{L_PRIVATE_MSG} :</span> {PRIVATE_MSG}
        <!-- END switch_dhow_mp --></div></div><span id="avatar_membre">{AVATAR_IMG}</span></div>
    <div class="lstPFIL"><span>{L_LAST_VISITED} :</span><br/> {LAST_VISIT_TIME}</div>
    <div class="infos-supp"></div>
  </div>
 
  <div class="boxPFIL">
    <div class="firstline"><a rel="nofollow" href="/sta/{PUSERNAME}"><div class="sbjPFIL">{L_TOPICS}</div></a>
      <a rel="nofollow" href="/spa/{PUSERNAME}"><div class="sbjPFIL">{L_POSTS}</div></a>
    <a rel="nofollow" href="/privmsg?mode=post&u={CUR_USER_ID}"><div class="sbjPFIL">Envoyer un MP</div></a></div>
    <div class="boxprofil"><div class="abtPFIL"><div class="titreprofil">Blablabla</div>
      <!-- BEGIN profile_field --><div class="infos-posteur"><div id="field_id{profile_field.ID}"><div>
      <span class="gen">{profile_field.LABEL}</span> <br/>{profile_field.CONTENT}</div></div></div>
      <!-- END profile_field --></div>
   
 
   
      <div id="ktactPFIL"><div class="titreprofil">Blablabla</div><br/>
     
      <!-- BEGIN switch_rpg --> <!-- BEGIN rpg_fields -->
    <div  class="M14_rpg">    {switch_rpg.rpg_fields.F_NAME}<br/> <span class="contenuerp">{switch_rpg.rpg_fields.F_VALUE_NEW}</span><br/><br/></div>
       
 <!-- END rpg_fields --> <!-- END switch_rpg -->
   
    </div>
 
      <div class="contactprofil">        <div class="titreprofil">Blablabla</div>
    <!-- BEGIN contact_field -->
      <div class="ktactPFIL">{contact_field.CONTENT}</div><!-- END contact_field -->
 
  </div>
 
    </div> </div>
  <!-- BEGIN switch_rpg -->
  <div class="boxRPG"><div style="text-align:center">{RPG_IMAGE}</div><br/>
 {U_ADMIN_RPG}
 </div>
 <!-- END switch_rpg -->
<!-- BEGIN switch_admin_user_comment_active --><span class="gen">{L_COMMENTS} :</span><br /><span class="gensmall">{L_MODS_AND_ADMINS}</span> {ADMIN_USER_COMMENT}<!-- END switch_admin_user_comment_active -->
</div>
</table>
<br />
<script src="{JS_DIR}jquery/json/jquery.json-1.3.min.js" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
 $(document).ready(function(){
 $('[id^=field_id]').each(function(){
 if ( $(this).find('.field_editable').is('span, div') )
 {
 $(this).hover(function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().addClass('ajax-profil_hover').parent().addClass('ajax-profil_parent').append('<div class="ajax-profil_edit"><img src="{AJAX_EDIT_IMG}" /></div>');
 $(this).find('.ajax-profil_edit').attr({
 alt: "{L_FIELD_EDIT_VALUE}",
 title: "{L_FIELD_EDIT_VALUE}"
 }).click(function(){
 $(this).prev().prev().removeClass('ajax-profil_hover').addClass('invisible').next().removeClass('invisible').append('<img src="{AJAX_VALID_IMG}" class="ajax-profil_valid" />').find('input,select');
 $(this).prev().find('.ajax-profil_valid').attr({
 alt: "{L_VALIDATE}",
 title: "{L_VALIDATE}"
 }).click(function(){
 var content = new Array();
 $(this).parent().find('[name]').each(function(){
 var type_special = $(this).is('input[type=radio],input[type=checkbox]');
 if ( (type_special && $(this).is(':checked')) || !type_special )
 {
 content.push(new Array($(this).attr('name'), $(this).attr('value')));
 }
 });
 var id_name = $(this).parents('[id^=field_id]').attr('id');
 var id = id_name.substring(8, id_name.length);
 $.post(
 "{U_AJAX_PROFILE}",
 {id:id,user:"{CUR_USER_ID}",active:"{CUR_USER_ACTIVE}",content:$.toJSON(content),tid:"{TID}"},
 function(data){
 $.each(data, function(i, item){
 $('[id=field_id' + i + ']').find('.field_uneditable').html(item).end().find('.ajax-profil_valid').remove().end().find('.field_editable').addClass('invisible').end().find('.field_uneditable').removeClass('invisible');
 });
 },
 "json"
 );
 });
 $(this).remove();
 });
 }
 },function()
 {
 if( $(this).find('.field_editable.invisible').is('span, div') )
 {
 $(this).find('.field_editable').prev().removeClass('ajax-profil_hover');
 $(this).find('.ajax-profil_edit').remove();
 }
 });
 }
 });
 });
//]]>
</script>
    <script type="text/javascript">
  $(function(){
$('.boxprofil').find('.infos-posteur').each(function(){
var id=$(this).find('div:first').attr('id');
$(this).addClass(id);
  });});
  </script>

<script type="text/javascript">$(function(){
    $('span.label').each(function(){
 $(this).html($(this).html().replace(":", ''));
    });
  });</script>

<script>$(function() {
  for (var field = $('.M14_rpg'), i = 0, j = field.length; i < j; i++) {
    field[i].className += ' field_' + $('.gen', field[i]).text().toLowerCase().replace(/ : /, '').replace(/[^a-z0-9]/g, function(s) {
        var c = s.charCodeAt(0);
        if (c == 32) return '-';
        return '__' + ('000' + c.toString(16)).slice(-4);
    });
  }
});
</script>


Tu devrais avoir ce genre de class:
Pour la première feuille de personnage:
Code:
M14_rpg field_titre-1
Pour la deuxième feuille de personnage:
Code:
M14_rpg field_titre-2

a++
Anonymous

Invité
Invité


Invité a été remercié(e) par l'auteur de ce sujet.
  • 0

Résolu Re: Mise en forme des labels et champs de la fiche personnage séparément

Message par Under the Moon Ven 11 Oct 2019 - 14:46

C'est exactement ce qu'il me fallait Very Happy Encore une fois merci !
Under the Moon

Under the Moon
**

Messages : 62
Inscrit(e) le : 13/08/2019

https://testalohomora.forumactif.com/
Under the Moon a été remercié(e) par l'auteur de ce sujet.

Voir le sujet précédent Voir le sujet suivant Revenir en haut

- Sujets similaires

Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum