1

I recently upgraded from 2.5.5 to 2.7 and I am doing a number of fixes to make my code up compatible with the new version.

I have a channel field called foo which is of the Relationships fieldtype.

When I tried outputting {foo} it outputs 0

{exp:channel:form
   channel="a_channel"
}
...
{foo} <-- outputs 0
{/exp:channel:form}

My problem is, how do I get the value/id of the currently chosen foo value?

I haven't seen any documentation about this. This is a generic, common to do so I thought they have something for it.

UPDATE:

I tried this as per documentation

 {exp:channel:form
       channel="a_channel"
    }
    ...
    {selected_option:foo}
 {/exp:channel:form}

But it did not work also

It is also important to note that this is a custom field

1

I believe based on the EE Relationship documentation (http://ellislab.com/expressionengine/user-guide/modules/channel/relationships.html) you would do the following:

{foo}
     {foo:entry_id}
{/foo}
| improve this answer | |
  • I think the problem here is that it loops through all the options. I just want to get 1 entry_id, the one that is chosen by the user. – developarvin Sep 13 '13 at 1:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.