Using another channel within {exp:safecracker channel=”” }
Posted: 13 November 2010 01:37 AM   [ Ignore ]
Has a Great Personality
Rank
Total Posts:  41
Joined  2010-11-08

My SAEF form has

{exp:safecracker channel="fixtures" 
    
return="fixtures/thanks_row" 
    
datepicker="no"

I am trying to create a select statement that gets its data from another channel

<select name="fixture_home_team[]>
        {exp:channel:entries disable="
member_data|pagination" channel="teams" dynamic="no" orderby="title" sort="asc" category="13" }
            <option value="
{cat_id}">{title}</option>
        {/exp:channel:entries}
        </select> 

But because it is within the exp safecracker tags it displays the title from this rather than the teams channel.

Profile
 
 
Posted: 13 November 2010 03:37 AM   [ Ignore ]   [ # 1 ]
Teen Scream
Avatar
RankRankRank
Total Posts:  3541
Joined  2009-05-29

Try sticking the select into an embed

{exp:safecracker channel="fixtures" 
    
return="fixtures/thanks_row" 
    
datepicker="no"
}
    {embed
=fixtures/home_team} 
<select name="fixture_home_team[]>
        {exp:channel:entries disable="
member_data|pagination" channel="teams" dynamic="no" orderby="title" sort="asc" category="13" }
            <option value="
{cat_id}">{title}</option>
        {/exp:channel:entries}
        </select> 
Profile
 
 
Posted: 13 November 2010 04:00 AM   [ Ignore ]   [ # 2 ]
Has a Great Personality
Rank
Total Posts:  41
Joined  2010-11-08

That works but it actually won’t help me I am trying to add a new entry and that field is a relationship so its not going to work for me

I assume you can’t have another channel entries like that for future reference.

Profile