Grav-plugin-admin: 쑰건뢀 ν•„λ“œ - 쑰건을 λ‹€λ₯Έ/ν˜•μ œ ν•„λ“œλ‘œ μ„€μ •

에 λ§Œλ“  2018λ…„ 08μ›” 24일  Β·  5μ½”λ©˜νŠΈ  Β·  좜처: getgrav/grav-plugin-admin

ν…œν”Œλ¦Ώμ˜ 청사진 νŒŒμΌμ—μ„œ 반볡 λ ˆμ΄μ•„μ›ƒ/λͺ©λ‘ ν•„λ“œλ₯Ό μ‚¬μš©ν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€.
μ˜΅μ…˜μ΄ μžˆλŠ” 선택 ν•„λ“œκ°€ μžˆλŠ”
및 그에 따라 ν•„λ“œλ₯Ό ν‘œμ‹œν•˜κΈ° μœ„ν•΄ μ‚¬μš©μžκ°€ μ„ νƒν•œ 선택을 ν‰κ°€ν•˜λŠ” 쑰건뢀 ν•„λ“œ.

μ‚¬μš©μžκ°€ λ‹€λ₯Έ μœ ν˜•μ˜ ꡬ성 μš”μ†Œλ₯Ό μΆ”κ°€/μ „ν™˜ν•  수 μžˆλŠ” κΈ΄ 기사에 이것을 μ‚¬μš©ν•˜κ³  μ‹ΆμŠ΅λ‹ˆλ‹€.

선택 ν•„λ“œμ˜ 값에 쑰건을 μ–΄λ–»κ²Œ μ„€μ •ν•©λ‹ˆκΉŒ(반볡)?
μ½”λ“œκ°€ ν˜„μž¬μ™€ 같이 μ„ νƒλ§Œ ν‘œμ‹œλ˜κ³  쑰건문은 영ν–₯을 λ―ΈμΉ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

        header.field.selection:
          type: list
          style: vertical
          label: Repeater/list with conditional field selection
          fields:
            .select: # this select sets the boolean for the conditional fields
              type: select
              size: long
              classes: fancy
              label: Select the type of field you would like to add
              options:
                tinymce: Textarea
                slideshow: Slideshow
                testimonial: Testimonial
                video: Video
            .tinymce:
              type: conditional # if Textarea was selected render the tinymce fields
              condition: "header.field.selection.select is same as('tinymce') ? 'true' : 'false'"
              fields: 
                .fieldName:
                  type: text
                  label: Tinymce
            .slideshow:
              type: conditional # if slideshow was selected render the slideshow fields
              condition: "header.field.selection.select is same as('slideshow') ? 'true' : 'false'"
              fields: 
                .fieldName2:
                  type: text
                  label: Slideshow
            .testimonial:
              type: conditional # if testimonial was selected render the testimonial fields
              condition: "header.field.selection.select is same as('testimonial') ? 'true' : 'false'"
              fields: 
                .fieldName3:
                  type: text
                  label: Testimonial
            .video:
              type: conditional # if video was selected render the video fields
              condition: "header.field.selection.select is same as('video') ? 'true' : 'false'"
              fields: 
                .fieldName4:
                  type: text
                  label: Video
question

λͺ¨λ“  5 λŒ“κΈ€

쑰건뢀 ν•„λ“œλŠ” λ‹€λ₯Έ ν•„λ“œλ₯Ό 기반으둜 '라이브' μž‘λ™ν•˜λŠ” 것이 μ•„λ‹ˆλΌ μ„œλΉ„μŠ€λ₯Ό 받을 λ•Œ PHP κΈ°λŠ₯을 μ‹€ν–‰ν•˜κ³  결정을 내릴 수 μžˆμŠ΅λ‹ˆλ‹€. λ‹€λ₯Έ λͺ¨λ“  것은 μžλ°”μŠ€ν¬λ¦½νŠΈλ₯Ό μ‹€ν–‰ν•΄μ•Ό ν•©λ‹ˆλ‹€.

κ°μ‚¬ν•©λ‹ˆλ‹€.

Wordpress의 κ³ κΈ‰ μ‚¬μš©μž μ •μ˜ ν•„λ“œμ™€ 같은 'μœ μ—°ν•œ μ½˜ν…μΈ  ν•„λ“œ'**λ₯Ό λ§Œλ“€ 수 μžˆμ—ˆμŠ΅λ‹ˆλ‹€. 당신은 μ—¬κΈ° μ—μ„œ μ½”λ“œλ₯Ό λ³Ό 수 μžˆμŠ΅λ‹ˆλ‹€

** ν•˜μœ„ ν•„λ“œ(λ ˆμ΄μ•„μ›ƒ) 그룹을 μ •μ˜ν•˜κ³  이λ₯Ό μΆ”κ°€, νŽΈμ§‘ 및 μž¬μ •λ ¬ν•˜μ—¬ κ³ λ„λ‘œ λ§žμΆ€ν™”λœ μ½˜ν…μΈ λ₯Ό λ§Œλ“­λ‹ˆλ‹€!

Form ν”ŒλŸ¬κ·ΈμΈμ—μ„œ 이와 같은 핡심 ν•„λ“œλ₯Ό 보고 μ‹ΆμŠ΅λ‹ˆλ‹€ :) PR μ•„λ§ˆλ„??

@rhukster
'feature/flexible-form-field' λΈŒλžœμΉ˜μ— λŒ€ν•œ pull μš”μ²­μ΄ μ΄λ£¨μ–΄μ‘ŒμŠ΅λ‹ˆλ‹€.
μƒνƒœ:

  • ν•„λ“œ 선택 ν…œν”Œλ¦Ώμ„ μ‚¬μš©ν•  수 μžˆμŠ΅λ‹ˆλ‹€. μΆ”κ°€λœ ν•„λ“œκ°€ μ˜¬λ°”λ₯΄κ²Œ μ €μž₯되고 λ‘œλ“œλ©λ‹ˆλ‹€.
  • Js & CssλŠ” 아직 μΆ”κ°€ν•΄μ•Ό ν•©λ‹ˆλ‹€.
  • example-fieldselection.yaml이 μΆ”κ°€λ˜μ—ˆμŠ΅λ‹ˆλ‹€.

λ‹€μŒμ— λŒ€ν•œ 도움이 ν•„μš”ν•©λ‹ˆλ‹€.

  • ν•„λ“œ 정렬이 frontmatter에 μ €μž₯λ˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€.

tnx

(μ €λŠ” slack μ±„λ„μ—μ„œ 'genenenenaam'으둜 μ‚¬μš© μ€‘μž…λ‹ˆλ‹€)

@rhukster

'λͺ©λ‘ ν•­λͺ© μ •λ ¬'κ³Ό ν•„λ“œ ν…œν”Œλ¦Ώ 'list.html.twig'의 이름에 λŒ€ν•œ 쒅속성이 μžˆμŠ΅λ‹ˆκΉŒ?

λ‚˜λŠ” ν…ŒμŠ€νŠΈλ₯Όν–ˆκ³  그것은 보인닀 :

  • 'list' 폴더가 μžˆλŠ” λ™μΌν•œ λ ˆλ²¨μ— 'fieldselection' 폴더λ₯Ό μƒˆλ‘œ λ§Œλ“€λ©΄.
  • 'list.html.twig' νŒŒμΌμ„ λ³΅μ œν•˜κ³  'fieldselection.html.twig'둜 이름을 λ³€κ²½ν•˜κ³  'fieldselection' 폴더 μ•ˆμ— λ„£μŠ΅λ‹ˆλ‹€.
  • 이제 'λͺ©λ‘' ν•„λ“œ μœ ν˜•μ„ μ‚¬μš©ν•˜λŠ” 청사진을 λ§Œλ“€κ³  'ν•„λ“œ 선택' μœ ν˜•μ„ μ œκ³΅ν•˜λŠ” 경우.
    (차이가 μ—†μ–΄μ•Όν•˜λ―€λ‘œ 두 μœ ν˜•μ˜ μ½”λ“œ λ‚΄μš©μ΄ 동일함)
  • μž¬μ •λ ¬μ€ 'fieldselection' μœ ν˜•μ—μ„œλŠ” μž‘λ™ν•˜μ§€ μ•Šμ§€λ§Œ 'list' μœ ν˜•μ—μ„œλŠ” μž‘λ™ν•©λ‹ˆλ‹€.
    (ν•­λͺ© μ‚­μ œμ™€ 동일)

이에 λŒ€ν•œ 닡변이 μƒˆ κΈ°λŠ₯의 ν˜„μž¬ μƒνƒœμ— λŒ€ν•œ 문제λ₯Ό ν•΄κ²°ν•  수 μžˆλ‹€κ³  μƒκ°ν•©λ‹ˆλ‹€.

이 νŽ˜μ΄μ§€κ°€ 도움이 λ˜μ—ˆλ‚˜μš”?
0 / 5 - 0 λ“±κΈ‰