Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • conforturis Friend
    #197817

    Hi
    I want to create some read-only field with just a link of some documentation for users can read before fill others fields below.
    Please see exemple

    How can I do this?


    1. sc
    Thanh Nguyen Viet Friend
    #535383

    In your case, you need to create new form field type SEPERATOR for Job form with settings as in attached image below. (Please execute rebuilding database step to get the field dipslayed on form.)

    And edit code in the file “components/com_jajobboard/asset/rendfield.php” to get it done. Find code snippet (on the top of the file):

    [PHP]function rendfieldlabel($field) {
    return (isset($field->label_ml) && !empty($field->label_ml)) ? $field->label_ml : $field->label;
    }[/PHP]

    And replace it with:

    [PHP]function rendfieldlabel($field) {
    $r = (isset($field->label_ml) && !empty($field->label_ml)) ? $field->label_ml : $field->label;

    if($field->field_type == ‘SEPERATOR’) {
    if(!empty($field->field_init)) {
    $r = sprintf(‘<a href=”%s” title=”%s” target=”_blank”>%s</a>’, $field->field_init, addslashes($r), $r);
    }
    }
    return $r;
    }[/PHP]

    Once done, you should get the field as follows:


    1. link
    2. use-Separator-field-as-link
    conforturis Friend
    #535441

    Is there a way to apply css code in that particular field?

    Thanh Nguyen Viet Friend
    #535601

    In the “form field customization” form, you can see the field named “Class name” where you can define extra css class for that field, and you can add custom css code for this class to style for that field then.

    Please have a look at our documentation here to learn more how to customize form field.

    conforturis Friend
    #535716

    We fill this field with class name some classe name of my template and nothing happens.

    And why this class field only accepts ten characters?

    Thanh Nguyen Viet Friend
    #535789

    <blockquote>We fill this field with class name some classe name of my template and nothing happens.</blockquote>
    To solve this issue, please follow steps below:

    – Open the file
    components/com_jajobboard/views/jajobs/tmpl/jaform.php

    -Find the code snippet below:
    [PHP]<tr class=”sectiontableheader”>
    <td colspan=”2″>
    <?php echo rendfieldlabel($field);?>
    </td>
    </tr>[/PHP]

    – And replace it with:
    [PHP]<tr class=”sectiontableheader <?php echo @$field->field_class; ?>”>
    <td colspan=”2″>
    <?php echo rendfieldlabel($field);?>
    </td>
    </tr>[/PHP]

    – Do the same steps for the file:
    components/com_jajobboard/views/jajobs/tmpl/japremiumform.php

    <blockquote>And why this class field only accepts ten characters?</blockquote>
    To sort this out, steps below should help:

    – Open the file: administrator/components/com_jajobboard/views/jamanagefields/tmpl/form.php
    – Find the code line:
    [PHP]<input class=”inputbox” type=”text” name=”field_class” size=”60″ maxlength=”10″ value=”<?php echo $this->item->field_class; ?>” />[/PHP]
    – And replace it with:
    [PHP]<input class=”inputbox” type=”text” name=”field_class” size=”60″ value=”<?php echo $this->item->field_class; ?>” />[/PHP]

Viewing 6 posts - 1 through 6 (of 6 total)

This topic contains 6 replies, has 2 voices, and was last updated by  Thanh Nguyen Viet 10 years, 6 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum