Forum

Thread tagged as: Question, Problem, Field-Types

Printing dataselect option.

The dataselect field type will create a select box which draws one option from the content of another region in perch.

I do not want to create select box in admin panel. i just want to echo that option value in template. how can i do that in perch?

Damian McCracken

Damian McCracken 0 points

  • 4 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You need to create a relationship to do that.

https://docs.grabaperch.com/runway/relationships/

It can work on perch also? i am using perch, not perch runway.

Drew McLellan

Drew McLellan 2638 points
Perch Support

No, only Runway.

Do you just want to output the entire region? If so you can do that to a variable and then pass it into the second template.

yes, i want to output the entire region. how can i get this region in a variable. Please help me for that.

Drew McLellan

Drew McLellan 2638 points
Perch Support

$html = perch_content('My region', true);
PerchSystem::set_var('my_region', $html);

In your template

<perch:content id="my_region" encode="false" />

Be sure to show the second region using perch_content_custom().