Altering 'Gender' text in profile Hitskin_logo Hitskin.com

This is a Hitskin.com skin preview
Install the skinReturn to the skin page

The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.
4 posters

    Altering 'Gender' text in profile

    Nemesis Prime
    Nemesis Prime
    New Member


    Female Posts : 15
    Reputation : 1
    Language : English
    Location : Dark eFfectX

    Solved Altering 'Gender' text in profile

    Post by Nemesis Prime January 2nd 2023, 8:09 pm

    Technical Details


    Forum version : #phpBB3
    Position : Founder
    Concerned browser(s) : Mozilla Firefox
    Screenshot of problem : https://i.servimg.com/u/f93/09/03/24/30/gndr-t10.png
    Who the problem concerns : All members
    Forum link : https://darkfx.darkbb.com

    Description of problem

    hello.. i'm attempting to alter the profile template on my board as so the Gender options for 'Male' & 'Female' are replaced with 'Predacon' & 'Starseeker'.

    There is no specific option in the default template so i am attempting to write an override:

    Code:

        <!-- BEGIN switch_gender -->
                        <dl>
                          <dt><label>{L_GENDER}&nbsp;: {MUST_GENDER}</label></dt>
                          <dd>
                              <label><input type="radio" name="profile_field_16_-7" value="1" {GENDER_MALE_CHECKED} /><span class="cont">{L_GENDER_MALE}</span></label>
                              <label><input type="radio" name="profile_field_16_-7" value="2" {GENDER_FEMALE_CHECKED} /><span class="cont">{L_GENDER_FEMALE}</span></label>
                              </dd>
                        </dl>
                        <!-- END switch_gender -->

    What i cannot seem to figure out is how to get the display text to change. i've attempted to insert the desired display text in various areas of the code but i'm not quite sure where i am going wrong. (examples below)

    Code:

        <!-- BEGIN switch_gender -->
                        <dl>
                          <dt><label>{L_GENDER}&nbsp;: {MUST_GENDER}</label></dt>
                          <dd>
                              <label><input type="radio" name="profile_field_16_-7" value="1" text="Predacon" {GENDER_MALE_CHECKED} /><span class="cont">{L_GENDER_MALE}</span></label>
                              <label><input type="radio" name="profile_field_16_-7" value="2" text="Starseeker" {GENDER_FEMALE_CHECKED} /><span class="cont">{L_GENDER_FEMALE}</span></label>
                              </dd>
                        </dl>
                        <!-- END switch_gender -->

    or

    Code:

        <!-- BEGIN switch_gender -->
                        <dl>
                          <dt><label>{L_GENDER}&nbsp;: {MUST_GENDER}</label></dt>
                          <dd>
                              <label><input type="radio" name="profile_field_16_-7" value="1" {GENDER_MALE_CHECKED} /><span class="cont">{Predacon}</span></label>
                              <label><input type="radio" name="profile_field_16_-7" value="2" {GENDER_FEMALE_CHECKED} /><span class="cont">{Starseeker}</span></label>
                              </dd>
                        </dl>
                        <!-- END switch_gender -->

    just looking for a little advice/assistance. thanks Smile

    ~ nem
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    Solved Re: Altering 'Gender' text in profile

    Post by skouliki January 2nd 2023, 8:41 pm

    hello

    why not create a new profile field with options and just hide the default male female field

    Nemesis Prime likes this post

    Nemesis Prime
    Nemesis Prime
    New Member


    Female Posts : 15
    Reputation : 1
    Language : English
    Location : Dark eFfectX

    Solved Re: Altering 'Gender' text in profile

    Post by Nemesis Prime January 2nd 2023, 8:54 pm

    skouliki wrote:hello

    why not create a new profile field with options and just hide the default male female field

    i was trying not to have to introduce a new field, was rather hoping to modify an existing so that old/historical members did not need to redo their entries/profiles. guess i can do that. still bugs me as an admin/founder i cannot edit the text field through the admin panel or the templates.

    thanks.
    SirLaplace
    SirLaplace
    Forumember


    Male Posts : 50
    Reputation : 4
    Language : Turkish, English

    Solved Re: Altering 'Gender' text in profile

    Post by SirLaplace January 2nd 2023, 9:29 pm

    Hello there,

    I haven't check the code you paste here and I can't see the user profile page without logging in to your forum to see it myself.

    I agree that the solution @skouliki suggested is far cleaner and easier in a long run.

    But, if only thing you need to do is to change a text display into something else, I can suggest a JS code something like that;

    Code:
    jQuery(document).ready(function(){
     
        var gender = $('#CONTAINERID');
     
      gender.html(gender.html().replace('TEXT1', 'TEXT2'));
      gender.html(gender.html().replace('TEXT3', 'TEXT4'));
    });

    You can place this code in either JavaScript pages or directly into your main code between <script> tags.

    In this code, you will need to customize the uppercase parts. For the CONTAINERID, you need to give an ID to something that contains whatever you are about to change so that code can find it there. For instance, in the beginning of your code you have a <dl> that contains everything we want to change, so; <dl id="customgender"> should suffice. Then you can replace #CONTAINERID with #customgender. Or whatever you write as an ID. (if giving id to dl doesn't work, you can always create a new div container to include everything in that specific section)

    Then, for the TEXT parts, if you see Male in the profile, you should replace TEXT1 with Male, and TEXT2 with Predacon for instance. Same thing goes with TEXT3 & 4. But you have to be precise, capital letters etc., whatever you are seeing.

    I'm using something like this in my forum currently so it should work.
    Hope it helps.

    Nemesis Prime likes this post

    Nemesis Prime
    Nemesis Prime
    New Member


    Female Posts : 15
    Reputation : 1
    Language : English
    Location : Dark eFfectX

    Solved Re: Altering 'Gender' text in profile

    Post by Nemesis Prime January 2nd 2023, 9:39 pm

    i've created a new field as @skouliki suggested. while it looks like exactly what i was looking for when viewing a user's profile and post, I was hoping to just override an existing profile field rather than create an additional (override/replace the gender option all together instead of having it there unused & suppressed).

    @SirLaplace appreciate the advice and code snippet.

    i'll noodle on what i think works best overall lmao, its not like my members are saying anything lollol. Thanks! both of y'all ^^

    this can be considered resolved
    كونان2000
    كونان2000
    Forumember


    Male Posts : 284
    Reputation : 120
    Language : Arabic

    Solved Re: Altering 'Gender' text in profile

    Post by كونان2000 January 2nd 2023, 9:43 pm

    hi

    Altering 'Gender' text in profile Ocia_a61
    add this code to your css
    Code:
    #profile_field_16_-7 > li:nth-child(2) > label:after {
        content: "Predacon";
        font-size: 15px;
    }

    #profile_field_16_-7 > li:nth-child(2) > label {
        font-size: 0;
    }

    #profile_field_16_-7 > li:nth-child(1) > label:after {
        content: "Starseeker";
        font-size: 15px;
    }

    #profile_field_16_-7 > li:nth-child(1) > label {
        font-size: 0;
    }

    SirLaplace and Nemesis Prime like this post

    Nemesis Prime
    Nemesis Prime
    New Member


    Female Posts : 15
    Reputation : 1
    Language : English
    Location : Dark eFfectX

    Solved Re: Altering 'Gender' text in profile

    Post by Nemesis Prime January 2nd 2023, 10:33 pm

    كونان2000 wrote:hi
    add this code to your css

    so i tried to do just a direct CSS replace of the code and a modification using what @skouliki suggested. i cannot get the 1st option to display the Text:

    Altering 'Gender' text in profile Gndr-t11

    Code:

            #profile_field_8_1 > li:nth-child(3) > label:after {
                content: " Starseeker";
                font-size: 10px;
            }
             
            #profile_field_8_1 > li:nth-child(3) > label {
                font-size: 0;
            }
            #profile_field_8_1 > li:nth-child(2) > label:after {
                content: " N.A.I.L. (Non-Aligned Indigenous Life-forms)";
                font-size: 10px;
            }
             
            #profile_field_8_1 > li:nth-child(2) > label {
                font-size: 0;
            }
             
            #profile_field_8_1 > li:nth-child(1) > label:after {
                content: " Predacon";
                font-size: 10px;
            }
             
            #profile_field_8_1 > li:nth-child(1) > label {
                font-size: 0;
            }
    Nemesis Prime
    Nemesis Prime
    New Member


    Female Posts : 15
    Reputation : 1
    Language : English
    Location : Dark eFfectX

    Solved Re: Altering 'Gender' text in profile

    Post by Nemesis Prime January 2nd 2023, 10:51 pm

    ok, so it was my poor typing/copy & paste. we're all set. this can be closed/resolved Smile Smile Smile
    skouliki
    skouliki
    Manager
    Manager


    Female Posts : 15391
    Reputation : 1709
    Language : English,Greek
    Location : Greece

    Solved Re: Altering 'Gender' text in profile

    Post by skouliki January 2nd 2023, 11:13 pm

    Thanks all for helping

    Problem solved & topic archived.
    Please read our forum rules: ESF General Rules