Getting the "name" value for an app and adding it to the Details tab

Not applicable

devportal.png

Good morning,

An enhancement request came in for me to add the "name" field from the Apigee Edge Developer App Details page to the Dev Portal App Detail Page. The field in question is in the attached image(circled in red) and would be used for troubleshooting in AAD.

I am editing our custom sub-theme php file devconnect_developer_apps_list.tpl.php to add this field. I added a placeholder so that's not a problem, but the $application array in that file does not contain this name field value, at least according to me looping through the array and echoing out all the values. There is an "entity" key in that array but when I try to echo its value it causes an error so I'm not sure what that is. It does not appear to be an array (tried is_array on it). I'm relatively new to php/Drupal so apologies if that's a rookie error.

Is there another way I can get this "name" value without making another web service call to retrieve that detail? Thank you for your time.

Solved Solved
1 2 81
1 ACCEPTED SOLUTION

@jprichard ,

It's an object, You can access same using below code,

<tr>
    <td class="key"><strong><?php print t('Application Machine Name'); ?></strong></td>
    <td><?php
        print check_plain($app['entity']->name);
        ?></td>
</tr>

4477-mchine-name.png

Developer Portal App Details tab,

4478-machine-dev.png

Hope it helps, Keep us posted if any.

View solution in original post

2 REPLIES 2

@jprichard ,

It's an object, You can access same using below code,

<tr>
    <td class="key"><strong><?php print t('Application Machine Name'); ?></strong></td>
    <td><?php
        print check_plain($app['entity']->name);
        ?></td>
</tr>

4477-mchine-name.png

Developer Portal App Details tab,

4478-machine-dev.png

Hope it helps, Keep us posted if any.

This is perfect, thank you! Now I will research what else I can do with the entity object. 🙂