You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

自定义主题的Blueprints在Admin插件中完全无法被检测到

To set up a custom page blueprint for a gallery in your Grav theme, here's a step-by-step breakdown of what you've implemented:

  • Create the blueprint file: Navigate to your theme's blueprints directory (user/themes/MYTHEMENAME/blueprints) and create a file named video.yaml. (Pro tip: Since the blueprint's title is "Gallery", renaming the file to gallery.yaml later will help keep things consistent.)

  • Add the blueprint configuration: Here's your YAML content formatted properly, with a note to finish the incomplete select field:

title: Gallery
'@extends':
  type: default
  context: blueprints://pages
form:
  fields:
    tabs:
      type: tabs
      active: 1
      fields:
        gallery:
          type: tab
          title: Gallery
          fields:
            header.txf:
              type: text
              label: Add a number
              default: 5
              validate:
                required: true
                type: int
            header.sb:
              type: select
              label: Select one of the following
              # You'll need to complete this section! Example structure:
              # default: option_1
              # options:
              #   option_1: First Choice
              #   option_2: Second Choice

Key Details About This Setup:

  • The @extends directive pulls in all fields from Grav's default page blueprint, so you don't have to redefine basic settings like page title or content area.
  • The header.txf field is a required integer input with a default value of 5 – this lets editors input a number that gets stored in the page's header data.
  • The header.sb select field is partially complete; you'll need to add the default value and a list of options for editors to choose from (the comment above shows how to structure this).

Once you save this file, the new "Gallery" tab will appear in the Grav admin whenever you create or edit a page using this blueprint.

内容的提问来源于stack exchange,提问作者Alexander Kim

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.21 07:36:02