Trouble editing the notes template

I am currently testing out Kirby to see if I have the right skillset to use it as a learning platform as I build my website.

I was working on the note and notes template and I was able to add my first one (ignore the styling) yet every subsequent note has come up blank at:


<?= $page->text()->kt() ?>

Then checking my txt file in each of the notes every file has the text field empty
here is my template: https://github.com/jgmac1106/starterkit/blob/master/site/templates/note.php

Here is a link to the one working note I published: http://testkirby.jgregorymcverry.com/notes/test

And here is a link to a consecutive note: (oops can’t add more than two)

Even when I revert back my changes all my consecutive notes miss the “text” in note.txt

Any clues as to what I did wrong?

Not quite sure if I’m getting what the problem is. There are about 12 “test” notes now and only one renders text.

How do you edit your notes, via the Panel or manually? Did you add text content to each note and save?

Apart from that and not related to your problem, your note template has a problem which leads to an error on some pages:

<?php if($author = $page->author()->toUser()): ?>
  <h2 class="p-name"><?= $author->name() ?></h2>
             <?php endif ?>
          <?php if($avatar = $author->avatar()): ?>
           <figure>
              <img class="u-photo" src="<?= $avatar->url() ?>">
            </figure>
        <?php endif ?>

The first if statement should be around the complete block, otherwise if the first condition is not true, $author in the second will not be defined:

<?php if($author = $page->author()->toUser()): ?>
  <h2 class="p-name"><?= $author->name() ?></h2>
  <?php if($avatar = $author->avatar()): ?>
    <figure>
      <img class="u-photo" src="<?= $avatar->url() ?>">
    </figure>
  <?php endif ?>
<?php endif ?>

First thank you for the prompt reply. I have been testing Kirby in my free time over the last few weeks to see if I can use it to build my website and also learn PHP.

Mainly because I have rarely seen anyone with better documentation. The environment, docs, and community are all very well designed. So I am quite a newbie here and am grateful for the help.

Notes
I am using the panel to save my notes currently. When I then check the files that is where I note the “Text Field” is blank. I did keep the title in the blueprint but delete it from the template. Note sure if they need to match.

author block
Thank you for the catch. I was honestly guessing where to to add endif after an initial error (amazing debugger…another plus for Kirby) and then I began just moving it around to see if that fixed my issue.

Hm, unfortunately I can’t tell from here why the text fields in your notes stay empty, or rather, why that one note did save correctly but the others don’t.

Since they are all showing the avatar on the frontend, they seem to be using the correct template which in turn means they all have the correct filenames. I couldn’t tell from your repo because it doesn’t contain the test notes.

You have corrected the notes template, so the original Starterkit notes now get rendered without errors (e.g. http://testkirby.jgregorymcverry.com/notes/chasing-waterfalls) and they render with text.

Doesn’t seem to be a problem with permissions, otherwise you wouldn’t be able to create new notes either. And the date does render as expected.

The blueprint doesn’t have a title field, anyway. And no, you don’t have to render the title in the template if you don’t want to.

Thank you for the help. I will push the files to Git Hub and then try again.

Okay here is a new repo I synced with my text editor: https://github.com/jgmac1106/gregkirbyv3

If I do edit or create a note manually it works. I did this in note two: http://testkirby.jgregorymcverry.com/notes/test-two

Yet when I use the panel the text field comes up blank.

Hm, I downloaded your repo and it works alright in my local dev environment. I can both save stuff and it loads in the Panel. So the general setup works.

Again: All these test notes were created via the Panel, right? And you edited the dates via the Panel and saved ok as well?

What is your environment and PHP version?

All the notes are created in the panel, but notes created in the panel except the first note will always have “Text:” blank in note.txt

I tried editing and resaving notes in panel but fields stay blank.

when I then go and manually add it in my text editor it works.

…Which is probably fine…I will be publishing more from a text editor than the panel.

I am using 7.3, but I wonder if there is something in my shared hosting that is blocking the writing of the text files??? Just so strange that the other fields populate but not the text field

I currently have no idea what might be interfering. Can’t remember having seen this issue before.

So can you actually modify the date or tags fields via the Panel? Or change the title?

Is there anything in your browser console?

Yes I can modify the date and the title and the tags but the text stays blank and then if I edit a note and push it to my server the text does display.

I then tried and create an entire note from my text editor and pushed that which worked (which is how I will write)

I just made a new note the only console error is for a missing javscript file that I had used for collapsible nav

The script from “http://testkirby.jgregorymcverry.com/script.js” was loaded even though its MIME type (“text/html”) is not a valid JavaScript MIME type.

test-sixteen

Loading failed for the with source “http://testkirby.jgregorymcverry.com/script.js”.

Happy to add anyone as an admin account but I am not a paying customer yet and you have already provided me a ton of help.

If you create an admin account for me, I’ll take a look. You can send me a PM with the credentials.

As an FYI for folks who come across this post I was not hitting save before I hit publish. If you publish without saving only the title, tags, and galleries save

The check mark next to the word SAVE is not an indicator of a saved state but rather a button that must be hit to save.

You will see it on the bottom left hand color in a “pinkish” (color blind) overlay

Editing files in a texteditor is perfectly fine, we do not use the Panel to edit the getkirby.com website at all. Everything is written in an editor, then pushed to GitHub and auto published from there.

You can disable the Panel in the config.php file if you don’t use it to add an extra layer of security.