此包的最新版本(0.0.2)没有可用的许可证信息。

这是Foundation的主题包

0.0.2 2022-12-23 03:08 UTC

This package is auto-updated.

Last update: 2024-09-23 06:53:44 UTC


README

这是一个为foundation提供的主题包


## Adding Themes

When installed, this package will look inside of the `resources/views/themes` folder for any folder containing a `.json` file with the same name as the folder. Example: `resources/views/themes/cool-beans/cool-beans.json` 

> If you wish to change the theme folder location, you can do so in the config

As an example if you have a folder called **cool-beans** and inside that folder you have another file called **cool-beans.json** with the following contents:

{ "name": "Cool Beans", "version": "1.0" }


This new theme will now be detected and available to use in your application. You can also include a sample screenshot of your theme, which would be **cool-beans.jpg** *(800x500px) for best results*

You can checkout a sample-theme repo here: [https://github.com/thedevdojo/sample-theme](https://github.com/thedevdojo/sample-theme)

The theme inside of the `themes` table with `active` set to 1 will the the active theme. You can then specify the theme view like the following:

return view('theme::welcome')


This will then look in the current active theme folder for a new view called `welcome.blade.php` :D

## Theme Configs

You may choose to publish a config to your project by running:

php artisan vendor:publish


You will want to publish the `voyager-themes-config`, and you will now see a new config located at `config/themes.php`, which will look like the following:

resource_path('views/themes'), 'publish_assets' => true ]; ``` 现在,你可以选择将主题文件夹放在另一个位置。默认情况下,它将被放在`resources/views`文件夹中;然而,你可以将其更改为你想要的任何位置。此外,你可以将**publish_assets**设置为*true*或*false*,如果设置为*true*,则每次扫描主题目录时,都会将主题中的`assets`文件夹发布到新的`themes`文件夹中的公共文件夹内。将其设置为*false*,则不会发生这种情况。## 主题选项 你也可以通过在主题文件夹中包含另一个名为`options.blade.php`的文件,轻松添加许多选项。 ![Voyager主题选项页面](https://i.imgur.com/eAoNt0W.png) 在`options.blade.php`文件中,你现在可以像这样添加一个新字段: ``` {!! theme_field('text', 'title') !!} ``` 这将添加一个新的**文本字段**,并使用**key**为*title*存储它。所以,现在如果你想在主题文件中的任何地方引用这个值,你可以简单地像这样echo它出来: ``` {{ theme('title') }} ``` 这真是太简单了!请参阅以下对`theme_field`函数的所有解释。### theme_field()函数 The `theme_field()`函数可用于在主题选项页中显示字段。请参阅以下定义、示例、说明和字段类型:**定义**:theme_field( $type, $key, $title = '', $content = '', $details = '', $placeholder = '', $required = 1) **示例**:要求标题的文本框:``` {!! theme_field( 'text', 'headline', 'My Aweseome Headline', '{}', 'Add your Headline here', 0) !!} ``` 只需前两个参数是必需的:``` theme_field('text', 'headline') ``` **说明**:$type 这是你想要显示的字段类型,你可以查看以下“字段类型”部分中的所有字段。$key 你想要创建的键,用于在主题中引用字段。$title 字段的标题或上面的标签 $content 字段的当前内容或值,如果字段已经在数据库中创建,则使用数据库中的值 $details 字段的详细信息,以JSON格式。你可以从以下URL中找到更多关于详细信息的信息:https://voyager.readme.io/docs/additional-field-options$placeholder 字段的占位符值 $required 此字段是否必需 **字段类型**:checkbox, color, date, file, image, multiple_images, number, password, radio_btn, rich_text_box, code_editor, markdown_editor, select_dropdown, select_multiple, text, text_area, timestamp, hidden, coordinates ---