Im very happy to report these two plugins work very well together! Tx to @bleutzinn for incredibly useful work here Im using both without any functional issues but Id like ideas on a couple of things. I know @pmoreno uses the add-page-by-form plugin so am tagging them in case.
Context: A logged in user creates a new note. All notes have front matter page config that allows SImpleMDE to make the content field editable. The plugin examples dont include metadata fields as editable. Form fields for each note (atm) are title, date (with picker), tags, and content. This is based on the simple example in the add-page-by-form plugin readme.
Id like to display the username’s full name rather that their username. Eg not display ‘starchild’ - their username, but display ‘stan’ - their full name. I dont know how to capture this in the add-page-by-form form fields. The username is captured by include_username: true in the page config, but trying include_fullname doesnt work (nothing is visible using page.header.fullname in the twig).
Id like to add or edit tags via the SimpleMDE plugin content field. Is this even possible, any ideas how I could do it? Currently tags are in the metadata, which is not editable. The content field is where SimpleMDE textarea kicks in.
Id like more control of the creation date time - its defaulting to 12.00, but would be much more useful if the actual time was shown. The date is captured as shown below, so time is generated by the system, not the form field.
name: date
label: enter date
validate.min: "2014-01-01"
validate.max: "2018-12-31"
type: date
Ideally Id like to display modified date and time too (as separate info), but thats for later.
Hope its ok to post a few questions just in case it sparks an idea in someone’s more knowledgeable brain than mine
Create date: I checked out the add-page-by-form plugin and it is not configured at all to provide a create date. So, I added a timestamp process to the form at the bottom, to generate a timestamp to each new note, and removed the date field in the form. I then display the timestamp as the create date.
form addition:
process:
-
timestamp:
name: timestamp
displaying the timestamp in the template simply needs {{ page.header.timestamp }}.
To display a fullname, its difficult as the add-page-by-form makes no provision for including a fullname of the user who generated the page. I edited the blueprint to test etc but to no avail. Currently Ive added the fullname as part of the new page front matter in the add page form. Its not ideal but its better than displaying the username. I cant yet think of how to make this dynamic.
Still working on how to make tags editable or to add new ones from the front end.
Hey, about displaying the fullname of users. I don’t know exactly how your users are stored, but if they are stored somewhere let’s say in a yaml file that looks like this:
someuser.yml
username: someuser
fullname: My Long Full Name
...
It’s probably not so complicated to retrieve that file and get the fullname field in it.
In a theme I created I used the following technique to store any info I wanted on users and also display a public profile page for these users:
I created a folder called authors with the following structure
@squeak thanks for the time you took to provide this info. This might do it. Thank you.
The app will only be used by a specific person or small group of people because it is a personal information app, not intended for public use. But having a way of generating the fullname for a note made if several people share the app for a specific reason or project would be very useful. Generating the fullname on the fly when a new page is created is difficult, but matching it to existing user accounts in the way you describe could be the solution.