Skip to content

Theme Settings

Theme template settings file is responsible for defining the theme template's own configuration items.

View FileDescription
functions.blade.phpTheme Function View Template

Variables

VariableDescription
$paramsFrom theme.json configuration file functionItems
$fileUrlsThe $params file type configuration item, processed as a URL value.
$langFrom theme.json configuration file functionLang
$appsFrom the list of installed applications (plugins and apps)
$languageStatusSystem language on status language_status
$languageMenusSystem language menu list language_menus
$defaultLanguageSystem default language tag default_language

Interface

MethodEndpoint PathRoute NameDescription
PUT/api/theme/{fskey}/functionsfresns.api.functionsUpdate Config Item Values
  • Request: multipart/form-data
  • Submit: ajax or form submit
php
route('fresns.api.functions', [
    'fskey' => '' // theme fskey
])

Form

html
<form action="{{ route('fresns.api.functions', ['fskey' => 'ThemeFrame']) }}" method="post" enctype="multipart/form-data">
    @csrf
    @method('put')

    <!-- input: item_key=fs_theme_name -->
    <input type="text" name="fs_theme_name" value="{{ $params['fs_theme_name'] }}">

    <!-- textarea: item_key=fs_theme_intro -->
    <textarea name="fs_theme_intro">{{ $params['fs_theme_intro'] }}</textarea>

    <!-- input file: item_key=fs_theme_logo -->
    <input type="file" name="fs_theme_logo" value="{{ $params['fs_theme_logo'] }}">
    <!-- or -->
    <input type="url" name="fs_theme_logo" value="{{ $params['fs_theme_logo'] }}">

    <!-- select: item_key=fs_theme_type -->
    <select name="fs_theme_type">
        <option value="" {{ $params['fs_theme_type'] == '' ? 'selected' : '' }}>Null</option>
        <option value="1" {{ $params['fs_theme_type'] == '1' ? 'selected' : '' }}>One</option>
        <option value="2" {{ $params['fs_theme_type'] == '2' ? 'selected' : '' }}>Two</option>
    </select>

    <!-- select multiple: item_key=fs_theme_types -->
    <select name="fs_theme_types" multiple>
        <option value="" {{ $params['fs_theme_type'] == '' ? 'selected' : '' }}>Null</option>
        <option value="1" {{ $params['fs_theme_type'] == '' ? 'selected' : '' }}>One</option>
        <option value="2" {{ $params['fs_theme_type'] == '' ? 'selected' : '' }}>Two</option>
    </select>

    <!-- plugin select multiple: item_key=fs_theme_plugins -->
    @foreach($params['fs_theme_plugins'] as $plugin)
        <input type="text" name="fs_theme_plugins[code][]" value="{{ $plugin['code'] }}">

        <input type="text" name="fs_theme_plugins[name][]" value="{{ json_encode($plugin['name']) }}">

        <select name="fs_theme_plugins[fskey][]">
            @foreach($apps as $app)
                <option value="{{ $app->fskey }}" {{ $app->fskey == $plugin['fskey'] ? 'selected' : '' }}>{{ $app->name }}</option>
            @endforeach
        </select>

        <input type="number" name="fs_theme_plugins[order][]">
    @endforeach

    <button type="submit">Save</button>
</form>

View

blade
@extends('ThemeFunctions::layout')

@section('body')
    {{-- form --}}
@endsection

@push('style')
    {{-- css --}}
@endpush

@push('script')
    {{-- js --}}
@endpush

Released under the Apache-2.0 License