Announcement

Collapse
No announcement yet.

Conditional for custom profile fields.......

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Conditional for custom profile fields.......

    I'm pretty sure this one requires hacking, but I might as well ask.....

    I have several things in mind (for custom profile fields) that require conditionals. For example, a gender field. I would want to have 3 options....... Male, Female, and Not Specified. If it is Not Specified, it currently shows up in postbit as 'Not Specified'. I was wondering if you could use a conditional for this.

    <if condition="$post[fieldx] == 'Male'">Male</if>
    <if condition="$post[fieldx] == 'Female'">Female</if>

    Anyone have any advice? Thanks

  • #2
    Originally posted by Buczilla
    I'm pretty sure this one requires hacking, but I might as well ask.....

    I have several things in mind (for custom profile fields) that require conditionals. For example, a gender field. I would want to have 3 options....... Male, Female, and Not Specified. If it is Not Specified, it currently shows up in postbit as 'Not Specified'. I was wondering if you could use a conditional for this.

    <if condition="$post[fieldx] == 'Male'">Male</if>
    <if condition="$post[fieldx] == 'Female'">Female</if>

    Anyone have any advice? Thanks
    Try the following:

    <if condition="$post[fieldx]">$post[fieldx]</if>

    That'll only show if it's set or not, otherwise it won't show at all.
    To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson

    Comment


    • #3
      Yes, I've got that down....it's just, the Gender thing is a radio group........so there is always a value for it.

      Sorry for not being clear, and thanks for the help

      Comment


      • #4
        What you posted in your first post would work.

        Comment


        • #5
          Originally posted by Freddie
          What you posted in your first post would work.
          Hmmmmmm........I had tried it earlier, and it did not work. Let me double check. Maybe I forgot a quote or something.

          Edit: Sure enough, I forgot a quote......instead of:

          <if condition="$post[fieldx] == 'Male'">Male</if>

          It should be:

          <if condition="$post['fieldx'] == 'Male'">Male</if>


          Thanks Freddie
          Last edited by Buczilla; Sat 13 Dec '03, 7:58pm.

          Comment

          Loading...
          Working...
          X