omz13 / kirby3-wellknown

Kirby3 plugin to provide wellknown files (/robots.txt, .well-known/, etc)
12 stars 0 forks source link

Unable to enter 'robots.txt' via panel field #5

Open luxlogica opened 5 years ago

luxlogica commented 5 years ago

DESCRIPTION

According to the readme, we are supposed to be able to change the contents of 'robots.txt' via either a config option - in 'config.php' - or by using an appropriately-named field in the 'site.yml' blueprint. Using the config option works, but using the field doesn't - the plugin simply ignores the field's content, and just outputs the auto-generated content.

STEPS TO REPRODUCE

  1. start a brand new project using Kirby's plainkit
  2. install the WellKnown plugin
  3. add the fields included in the plugin's standard blueprint to 'site.yml'
  4. log into the Panel, and enter some content into the 'robots.txt' field, and save
  5. access the site's 'robots.txt' page

You will see only the auto-generated content, and all content saved within the panel field will be ignored.

luxlogica commented 5 years ago

The culprit seems to be line 125 of src/wellknown.php.

It is...:

      $x = kirby()->site()->content()->get( 'wkRobots' );

...and it seems it should be:

      $x = kirby()->site()->content()->get( 'WellKnownRobots' );

The actual name of the field seems to be needed in order to get the data - I can't see anywhere where the field name 'WellKnownRobots' might be converted to 'wkRobots'...