Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
  • Sign Up
Sign in to follow this  

How to use custom fields in the character mod
   (0 reviews)

Morrigan
  • The basic information on coding for the IPS Character Mod using Custom fields to be able to make custom mini-profiles and profiles.

    Software: Invision Power Services (IPS) 166,164

This is actually going to be a pretty short article as there really isn't a lot too it. In order to pull items from the character mod you just have to use the code {$character->fields('custom_key')} if you want it to format use {$character->fields('custom_key')|raw} and it will format HTML.

 

Unfortunately, since IPS auto formats a lot of things (like images and links for example) you will have to pull the url out if you want to custom format it in a way that's not default. For example, for an image:

{{if $character->fields('custom_image')}}
              	{{$string = ''.$character->fields('custom_image').'';}}
				{{$customImage = explode('"',strstr($string,'https://'))[0];}}
              <img src="{$customImage}" alt="{$character->name}">
                          {{endif}}

For links:

{{if $character->fields('custom_link')}}
            	{{$string = ''.$character->fields('custom_link').'';}}
				{{$custom_link = explode('"',strstr($string,'https://'))[0];}}
              <li><strong>Custom Link</strong> <a href='{$custom_link}'>Click Here</a></li>
              {{endif}}

Note that these both have https and must be changed if you are not using https.

Edited by Morrigan


Sign in to follow this  

Related Guides



User Feedback

Create an account or sign in to leave a review

You need to be a member in order to leave a review

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

There are no reviews to display.


×

Important Information

By using this site, you agree to our Terms of Use, Guidelines and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.