simplify
Total posts: 5
05 May 2015 06:22

How can i get value from my custom field in a record file?

I created a text field for address and need it on a separat place. I will have more then 10 such fields...

Tags Developer


klox7 VIP
Total posts: 914
05 May 2015 07:37

Hello,

please read this Click here to link...

In short you can create your own record template. Copy it with Admin->Cobalt->Templates->Article. You can see your record template in components/com_cobalt/views/record/tmpl

To display field label and field result use this

<?php
if(isset($item->fields_by_id[ID])): ?>
    <?php echo $item->fields_by_id[ID]->label; ?>
    <?php echo $item->fields_by_id[ID]->result; ?>
<?php endif; ?>

where ID is field id. You can also check existing templates to get the idea.

Regards

Powered by Cobalt