11.3 Custom Fields

By default (and by using dirset configuration), Kemana provides you with lots of selection of 'normal' fields, such as Title, URL, description, contact address, company logo, and more. But if you feel that's not enough, you can use Custom Fields (CF) to create your own fields.

Adding or modifying CF's is very easy. From ACP > Tools > Directory Sets > Custom Fields.

There you can create a new field with a selection of type. You can choose short text, long text, image upload, file upload, drop down select, multiple select, radio button, date, time, and many more. You can even define if the field accessible by regular link, premium link or sponsored link, or admin only. There are so many combination you can create, the possiblities are limitless.

After adding a new CF, the fields will appear in:

  1. Add/Edit link form, where your users submit their own link.
  2. Also in Add/Edit link form in ACP, under Custom Field tab.
  3. Some CF's also searchable, so they appear in Search Form.
  4. And of course in detail page.

Skinning

 

By default, CF displayed in detail.php designed in section.tpl, see <!-- BEGINSECTION detail_format -->. If you need a specific formatting for each CF, you have to do it manually.

CF ID

  • If you don't need to process CF's using any PHP script:
    1. Create some CF's in ACP, eg: Name
    2. Get the CF's ID, eg: cf_name
    3. Open detail.tpl, add {$cf_name}. You're done!
  • If you need further processing using a PHP script:
    1. Create some CF's in ACP, eg: Name
    2. Get the CF's ID, eg: cf_name
    3. Open detail.tpl, add {$cf_name}.
    4. Open detail.php, find: $row['custom_field'] = $custom['auto_design'];
    5. Below that line add: $row['cf_name'] = my_function ($custom['cf_name']);
    6. You're done.

Notes for Skinning

  • Please remember, that by following above steps, some CF's may be displayed more than once.
  • This is because, by default, Kemana keeps all CF's in {$custom_field} in detail.tpl.
  • If needed, you can remove {$custom_field}, but then you have to manually add all your CF's in detail.tpl.
  • But then, you may encounter empty fields still displayed, to hide empty CF's manually, you have to understand PHP, which is not covered in this manual, but you can use empty ($custom['cf_name']));
  • And to display CF's based on dirset (different dirset has different CF's), you can use <!-- BEGINIF $set == 'set_id' -->somehtml<!-- ENDIF -->

 


: @ 07:00am
Last Updated: @ 07:00am

Advertisement

Online Users

There are 28 users online.

Connect

Connect with us on Facebook

Newsletter

Subscribe to our newsletter for the latest updates and exciting promotions!