Files
intotheeast-com-content/pages/02.post/post-form.md
T
m038 6b24215190 fix: rewire add-page-by-form so posts actually get created
Two root-cause bugs:
1. Wrong action name: 'add-page-by-form' is not handled by the plugin;
   the plugin only matches 'addpage' or 'add_page'. Using the wrong name
   meant the action silently no-oped while 'message' still fired, showing
   'Entry posted successfully!' for a post that was never written.
2. Config in wrong place: parent/slug/template must be in 'pageconfig' and
   'pagefrontmatter' frontmatter blocks on the form page — the plugin reads
   from page->header(), not from the process block params.

Fix: move config to pageconfig/pagefrontmatter, change action to 'add_page'.
Slug is built from date+title fields (e.g. 2026-06-18-1430-my-title).
Photos destination changed to '@self' so the plugin copies from flash to
the new entry folder correctly.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-18 19:51:58 +02:00

102 lines
1.9 KiB
Markdown

---
title: 'New Entry'
template: post-form
access:
site.login: true
pageconfig:
parent: '/tracker'
slug_field: 'date,title'
overwrite_mode: false
pagefrontmatter:
template: entry
published: true
form:
name: new-entry
action: /post
enctype: multipart/form-data
fields:
-
name: title
label: Title
type: text
autofocus: true
validate:
required: true
-
name: date
label: Date & Time
type: datetime
default: now
format: 'Y-m-d H:i'
validate:
required: true
-
name: content
label: "What happened today?"
type: textarea
rows: 10
validate:
required: true
-
name: photos
label: Photos (max 4)
type: file
multiple: true
destination: '@self'
limit: 4
accept:
- 'image/*'
-
name: lat
label: Latitude
type: text
placeholder: 'tap "Get Location" below'
-
name: lng
label: Longitude
type: text
placeholder: ''
-
name: location_city
label: City
type: text
placeholder: 'e.g. Kyoto'
-
name: location_country
label: Country
type: text
placeholder: 'e.g. Japan'
-
name: weather_temp_c
type: hidden
-
name: weather_desc
type: hidden
buttons:
-
type: submit
value: Post Entry
classes: btn-post
process:
-
add_page: true
-
message: 'Entry posted successfully!'
-
reset: true
---