Forum

Thread tagged as: Problem

Multiple values from dataselect

I have a multiple item region with a template like this:

<perch:content id="link_url" type="text" label="URL" required="true" />
<perch:content id="link_text" type="text" label="Text" required="true" title="true" />

And I'm trying to use dataselect to grab both the link_url and link_text values at once with one dropdown, like this:

<ul class="navL">
    <li><a href="<perch:content id="link1" type="dataselect" label="Link 1" page="*" region="Nav Links" options="link_text" values="link_url" />"><span><perch:content id="link1" type="dataselect" label="Link 1" page="*" region="Nav Links" options="link_text" values="link_text" /></span></a></li>
    <li><a href="<perch:content id="link2" type="dataselect" label="Link 2" page="*" region="Nav Links" options="link_text" values="link_url" />"><span><perch:content id="link2" type="dataselect" label="Link 2" page="*" region="Nav Links" options="link_text" values="link_text" /></span></a></li>
    <li><a href="<perch:content id="link3" type="dataselect" label="Link 3" page="*" region="Nav Links" options="link_text" values="link_url" />"><span><perch:content id="link3" type="dataselect" label="Link 3" page="*" region="Nav Links" options="link_text" values="link_text" /></span></a></li>
</ul>
<ul class="navR">
    <li><a href="<perch:content id="link4" type="dataselect" label="Link 4" page="*" region="Nav Links" options="link_text" values="link_url" />"><span><perch:content id="link4" type="dataselect" label="Link 4" page="*" region="Nav Links" options="link_text" values="link_text" /></span></a></li>
    <li><a href="<perch:content id="link5" type="dataselect" label="Link 5" page="*" region="Nav Links" options="link_text" values="link_url" />"><span><perch:content id="link5" type="dataselect" label="Link 5" page="*" region="Nav Links" options="link_text" values="link_text" /></span></a></li>
    <li><a href="<perch:content id="link6" type="dataselect" label="Link 6" page="*" region="Nav Links" options="link_text" values="link_url" />"><span><perch:content id="link6" type="dataselect" label="Link 6" page="*" region="Nav Links" options="link_text" values="link_text" /></span></a></li>
</ul>

This correctly displays one dropdown per link in Perch, however only the link_url is output for both the href and inner text, as if the "values" for both were link_url. Am I doing this wrong, or does dataselect just not work like this? If it doesn't, is there any other way to do this other than a bunch of perch_content_customs?

Diagnostics:

SUMMARY INFORMATION

Perch: 2.8.26, PHP: 5.6.14-1+deb.sury.org~trusty+1, MySQL: mysqlnd 5.0.11-dev - 20120503 - $Id: 3c688b6bbc30d36af3ac34fdd4b7b5b787fe5555 $, with PDO
Server OS: Linux, apache2handler
Installed apps: content (2.8.26), assets (2.8.26), categories (2.8.26)
App runtimes: <?php $apps_list = array( 'content', 'categories', );
PERCH_LOGINPATH: /tb-admin
PERCH_PATH: /var/www/public/typoboutique.dev/tb-admin
PERCH_CORE: /var/www/public/typoboutique.dev/tb-admin/core
PERCH_RESFILEPATH: /var/www/public/typoboutique.dev/tb-admin/resources
Image manipulation: GD Imagick
PHP limits: Max upload 100M, Max POST 100M, Memory: 128M, Total max file upload: 100M
F1: 2edba60ed1f613d6dd804feb202456a2
Resource folder writeable: Yes
HTTP_HOST: typoboutique.dev
DOCUMENT_ROOT: /var/www/public/typoboutique.dev
REQUEST_URI: /tb-admin/core/settings/diagnostics/
SCRIPT_NAME: /tb-admin/core/settings/diagnostics/index.php
Shane Lenzen

Shane Lenzen 18 points

  • 5 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

That's where you need Relationships and Runway.