• Members 16 posts
    July 29, 2017, 12:10 a.m.

    Should i put the users folder in /theme if i want to customize the different forms and stuff?
    Or how would i go about editing the forms?

  • July 29, 2017, 1:28 a.m.
  • Members 16 posts
    July 29, 2017, 2 a.m.

    I was referring to changing the form fields in misago/users/profilefields/default.py in this case i want to remove the skypeID field

  • July 29, 2017, 2:16 a.m.

    Oh! Should've spelled it like that in first post ;)

    You are in luck, profile fields were designed to be customizable. If you want to get rid of this field, find MISAGO_PROFILE_FIELDS in your settings.py, somewhere in this setting you'll find this line: 'misago.users.profilefields.default.SkypeIdField',. Remove it and restart your app. Skype field will be gone from profiles :]

  • Members 16 posts
    July 29, 2017, 2:54 a.m.

    Yeah sorry bout that ;)
    How would i add a field for example steam name or something? How would i go about adding formatting to the bio field without going for something like content safe cus that's a bad idea, but in general some customization?

    Thanks in advance :D

  • July 29, 2017, 3:06 a.m.

    Misago has quite nice documentation complete with examples for those interest in implementing custom profile fields:

    rafalp.gitbooks.io/misago/ProfileFields.html

    Its possible to add custom bio field that supports extra formatting alike to posts, but its impossible without modifying javascript to make Misago display proper markup editor with buttons for inserting those formatings as its input. This may improve in future however, but it would require adding protections like checksums and preparsing for user profile fields for feature to be safe and scalable.

    Your bio field could extend misago's default BioField but redefine its get_value_display_data as its documented. In fact, docs have example on field return HTML for displaying its value, so you could just swap simple parser that just turns blocks of texts in paragraphs for one that handles markdown or bbcode:

    from misago.markup install common as common_markup
    from misago.users.profilefields.default import BioField
    
    class FormattedBioField(BioField):
        def get_value_display_data(self, request, user, value):
            return {
                'html': common_markup(request, user, value),
            }
    
  • arrow_forward
  • Members 16 posts
    July 29, 2017, 3:16 a.m.

    How would i go about adding a field exactly because i'm not quite clear on where to add the field exactly? Meaning in what directory and what file should i edit?

  • July 29, 2017, 3:31 a.m.

    Write custom python module defining this field's class and write path to it in your MISAGO_PROFILE_FIELDS like other fields.

    For starters it may be easy to just extend what is given to you when creating new Misago setup. When one starts new Misago site, one module (directory) is created for you using name you specify. Assuming that you've used myforum, your settings will be in myforum/settings.py and you may create file myforum/profilefields.py, put your custom profile fields in it, and make Misago load them via adding them to your MISAGO_PROFILE_FIELDS settings like this. Continuing example from previous post this setting may be edited to look like this:

    MISAGO_PROFILE_FIELDS = [
        {
            'name': _("Personal"),
            'fields': [
                'misago.users.profilefields.default.FullNameField',
                'misago.users.profilefields.default.GenderField',
                # Here I've replaced Misago's BioField with custom FormattedBioField I've created in previous post:
                'myforum.profilefields.FormattedBioField',
                'misago.users.profilefields.default.LocationField',
            ],
        },
        {
            'name': _("Contact"),
            'fields': [
                'misago.users.profilefields.default.TwitterHandleField',
                # I've commented out the skype ID field to disable it on forum
                # 'misago.users.profilefields.default.SkypeIdField',
                'misago.users.profilefields.default.WebsiteField',
            ],
        },
        {
            'name': _("IP address"),
            'fields': [
                'misago.users.profilefields.default.JoinIpField',
                'misago.users.profilefields.default.LastIpField',
            ],
        },
    ]
    
  • Members 16 posts
    July 29, 2017, 5:53 a.m.

    After and hour of work i finally got it working
    Mistake on my part was missing a comma in 'myforum.profilefields.SteamId', and writing it as 'myforum.profilefields.SteamId'

    (I'm blaming nano wasn't using a proper IDE)
    LOL

    Oh well got it working thank you for the help!