-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Calling individual extrafields do not work #41
Comments
share you code please so we can take a look, this API has not been changed. |
Thanks so much!
In the meantime I discovered another way of calling individual extra
fields. Here is my code:
<?php if ($this->item->params->get('itemExtraFields') &&
isset($this->item->extra_fields) && count($this->item->extra_fields)): ?>
<!-- Item extra fields -->
<ul>
<?php foreach ($this->item->extra_fields as $key =>
$extraField): ?>
<?php if ($extraField->value != ''): ?>
<?php if ($extraField->name == 'MyExtraFieldName'): ?>
<li class="list-inline-item"><?php echo $extraField->value; ?></li>
<?php endif; ?>
...
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
It works perfectly, Please close this issue and enormous thank you for your
contribution!
…On Fri, 12 Jan 2024 at 09:14, eworkers ***@***.***> wrote:
share you code please so we can take a look, this API has not been changed.
note that to get the extra-field name:
$this->item->extraFields->EXTRAFIELD_ALIAS->name;
note this *EXTRAFIELD_ALIAS*, it is not *YourExtraFirldName*, it is your
*YourExtraFieldAlias*
and to get the the value of it:
$this->item->extraFields->EXTRAFIELD_ALIAS->value;
—
Reply to this email directly, view it on GitHub
<#41 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BEE5GULRYETMOBUGY376AOTYODPEHAVCNFSM6AAAAABA4PSDMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOBYGU2DOMZSGQ>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In K2 / J3 it was possible to call individual extra-fields by name or alias, like:
item->extraFields->MyExtraFirldName->name): ?> item->extraFields->MyExtraFirldName->value; ?>.This functionality seems not working in J4 or there is a new way for the call?
The text was updated successfully, but these errors were encountered: