1. REGISTRATION REQUIREMENTS:

    Register with your xenforo.com Username then start a conversation at xenforo.com w/Bob and provide the following:
    1. Your XenForo License Validation Token
    2. The Domain Name associated with the License
    NOTE: Your account will be validated once ALL requirements are verified/met. Thank you for your patience.

Custom User Field: Change value into picture

Discussion in 'Showcase Support' started by it_, Mar 31, 2014.

  1. it_

    it_ New Member Showcase

    Hello, I want to create a custom user drop down field with different options and want those automatically change into pictures.

    Under general settings I tried Conditional Statemens for the html output.
    For instance:

    <xen:if is="{$choice} == x">
    <img src="...">
    <xen:elseif is="{$choice} == y" />

    <img src="...">
    <xen:elseif is="{$choice} == z" />

    <img src="...">
    <xen:else />

    <img src="...">
    </xen:if>


    But then it always shows all the pictures.

    Help is highly appreciated.
    Best regards!
     
  2. Bob

    Bob Developer Staff Member

    Which version of showcase? Custom fields in SC 2.0.0 are A LOT different than previous versions.
     
  3. it_

    it_ New Member Showcase

    Dear @Bob B
    I updatet to 2.1.1. but it still shows each picture like it would just ignore the <xen> commands.
    I think actually it is ignoring the <xen> commands. For example if I want to output:
    Code:
    <xen:avatar user="$user" size="m" />
    It does show nothing. Are <xen> commands even supported or what am I doing wrong?
     
    Last edited: Aug 18, 2014
  4. Bob

    Bob Developer Staff Member

    You are going to have to be much more specific. What you want to do probably can't be handled via the output. Its not meant for doing stuff like that.
     
  5. it_

    it_ New Member Showcase

    Thank you I managed to work this out, my thoughts were to complicated before. I simply had to use this code:
    Code:
    <img src="url/{$choice}.png">
    Now it displays an image instead of the chosen value.

    Nevertheless I would like to know is it somehow possible to display the creators name of an item through Value Display HTML?
     
  6. Bob

    Bob Developer Staff Member

    You can TRY (not sure it will work) using {$item.username}
     
  7. it_

    it_ New Member Showcase

    Unfortunately it does not work. May there is any other method? If not I may request this for a future addon.
     
    Last edited: Aug 18, 2014
  8. Bob

    Bob Developer Staff Member

    What exactly are you trying to do? That HTML output is not designed for anything fancy. Its simply to change the basic output of the field itself.
     
  9. it_

    it_ New Member Showcase

    In this case the user can check a field and the template output would be:
    This is the original work of {username}.
     
  10. Bob

    Bob Developer Staff Member

    Ya, stuff like that is not what that is designed for. You really should use self place fields and do the customization in the template with xen syntax (where you can even use callbacks if needed).
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.