Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Current »

Multiple Languages Field (field_language)

Requires: phpFox version 4.6.0 or higher.

 

phpFox Template

{field_language phrase='name' label='name' field='name' format='val[name_' size=30 maxlength=100}

Generated HTML

<div class="form-group">
    <label for="name_en">Name in English (US)</label>
    <input id="name_en" class="form-control" type="text" name="val[name_en]" value="" size="30" maxlength="100">
    <p class="help-block"></p>
    <div class="clearfix collapse-placeholder open">
        <a role="button" data-cmd="core.toggle_placeholder">Name in other languages</a>
        <div class="inner">
            <p class="help-block">If the category is empty then its value will have the same value as default language.</p>
            <div class="form-group">
                <label for="name_es"><strong>Español (ES)</strong>:</label>
                <input class="form-control" type="text" id="name_es" name="val[name_es]" value="" size="30" maxlength="100">
            </div>
        </div>
    </div>
</div>

Result

!

Parameters

ID

Name

Default value

Description

1

field

name

2

phrase

sPhraseVarName

3

type

text

Type of field: text or textarea

4

size

30

Size of text input field (only available for type text)

5

rows

5

Number of rows of textarea field (only available for type textarea)

6

label

name

Label of language field

7

format

name_

Format for name of language field

8

required

false

The language field is required or not

9

help_phrase

if_the_category_is_empty_then_its_value_will_have_the_same_value_as_default_language

Var name of the phrase you want to show as field description

Price Field (field_price)

Requires: phpFox version 4.6.0 or higher.

 

phpFox Template

{field_price price_name='price' currency_name='currency_id'}

Generated HTML

<div class="form-inline">
    <select class="form-control" id="currency_id" name="val[currency_id]">
        <option value="USD">U.S. Dollars</option>
        <option value="EUR">Euros</option>
        <option selected="selected" value="GBP">Pounds Sterling</option>
    </select>
    <input class="form-control" type="text" name="val[price]" value="0.00" id="price" size="10" maxlength="100" onfocus="this.select();">
</div>

Result

!

Parameters

ID

Name

Default value

Description

1

currency_name

currency_id

Name for currency select

2

price_name

price

Name for price input

Checkboxes for Genders (checkbox_gender)

Requires: phpFox version 4.6.1 or higher.

 

phpFox Template

{checkbox_gender use_custom=true name='val[gender][]'}

Generated HTML

<div class="custom-checkbox-wrapper">
    <label><input type="checkbox" name="val[gender][]" value="1">Male</label>
</div>
<div class="custom-checkbox-wrapper">
    <label><input type="checkbox" name="val[gender][]" value="2">Female</label>
</div>

Parameters

ID

Name

Default value

Description

1

use_custom

false

Set true if you want to use custom style of checkbox

1

name

valgender[]

Name of checkboxes

  • No labels