Store
Community Documentation

v3 Knowledgebase

How to add new genders?

Notice: This feature requires phpFox v2.0.5dev2 or higher installed.

We have had several requests from the community to add the ability to add other genders. This can be done from your AdminCP by going to:


Settings >> System Settings >> Manage Settings >> Core

Look for the setting:


Genders

Notice where we have:


Add a New Value

This is where you will be adding a new value for your new gender. Adding a gender requires adding a value that is split up with a pipe "|" (without quotes). It requires 3 values with the 4th being optional. As an example lets look at the value we use for the Female gender:


2|core.her|profile.female|female

Notice how we split up each value with the pipe "|". The first value:


2

is the unique numerical value of this gender. We provide 2 default genders (Male & Female) and these use ID numbers 1 & 2. When adding new genders its best to go up so the next ID would be 3. Next, we have:


core.her

This is the language phrase that identifies the gender, which in this case would output:


her

We will go over how to add a language phrase and attain the variable to use with our genders later in this article. The 3rd value we have:


profile.female

This is the language phrase that identifies the gender itself, which in this case would output:


female

The 4th value is optional and controls the "noimage" image, which is the image we use to display if a user hasn't uploaded a photo. In this example we have:


female

On your server where you have phpFox installed if you check the folder:


theme/frontend/THEME-NAME/style/STYLE-NAME/image/noimage

You will notice the image:


female_profile.png

Notice where we have:


female

This is how you can create a custom image for your new gender. When adding a new image be sure to add all the thumbnails. Just look at all the images that start with "female_" as an example and your new gender should have the same amount of images.

Once you have added your values in the input:


Add a New Value

and click the "Add" button be sure to scroll to the bottom of the page and click on the "Submit" button to save your changes.

Now lets go over how we actually get the phrase:


core.her

or


profile.female

In phpFox we consider these to be variables. They hold the real value depending on the language package being used. So to add a phrase log into your AdminCP and go to:


Extensions >> Language >> Add Phrase

For the field:


Module

Select:


Core

Next, for the field:


Varname

Just leave that blank.
For the field:


Text

Add how you will identify this gender, which using our example we use:


her

After you submit the form it will add the phrase and then give you examples on how to use the phrase. We will be using the "Text" method.