Coder Social home page Coder Social logo

craft-user-manual's Introduction

Craft User Manual plugin for Craft CMS 4.x and Craft CMS 5.x

Craft User Manual allows developers (or even content editors) to provide CMS documentation using Craft's built-in sections (singles, channels, or structures) to create a "User Manual" or "Help" section directly in the control panel.

Screenshot

Requirements

This plugin requires Craft CMS 4.0.0 or later.

Installation

Craft 4 and Craft 5

To install the plugin in your Craft 4 project, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require hillholliday/craft-user-manual
    

Wondering why it says hillholliday and not roberskine as the org? This package was originally submitted as hillholliday, and to preserve the artifacts on Packagist we have kept it as hillholliday.

  1. In the Control Panel, go to Settings β†’ Plugins and click the β€œInstall” button for usermanual.

  2. Select the section the plugin should use as the User Manual page in the CP.

    • (Optional) - Replace the plugin's name to something your user's will understand.
    • (Optional) - Use more than the default body fieldhandle by setting up custom template overrides.
  3. Click the User Manual link in the CP nav.

Craft 3

To install the plugin in your Craft 3 project, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
    
  2. Then tell Composer to load the plugin:

     composer require hillholliday/craft-user-manual:2.1.2
    
  3. In the Control Panel, go to Settings β†’ Plugins and click the β€œInstall” button for usermanual.

  4. Select the section the plugin should use as the User Manual page in the CP.

    • (Optional) - Replace the plugin's name to something your user's will understand.
    • (Optional) - Use more than the default body fieldhandle by setting up custom template overrides.
  5. Click the User Manual link in the CP nav.

Configuration

  • All settings may be optionally configured using a config file. The values, contained in config.php, are described below:

pluginNameOverride

Intuitive, human-readable plugin name for the end user.

templateOverride

For more control over the output, you may optionally override the default template.

Path is relative to ../craft/templates/.

section

Entries in this section must have associated urls.

enabledSideBar

Enables the sidebar on the manual page

Defaults to true.

Some notes

  • The plugin currently only pulls in the body field from each entry in the selected section, unless you're using a template override.
  • While the User Manual section works best with Structures, you can certainly get away with using a one-off Single.
  • If you're running Craft Client or Craft Pro make sure your content editors don't have permission to edit whatever section you've selected to use as your User Manual
  • Only sections with entry URLs may be used as your User Manual section.

Thanks

This plugin was inspired by the team over at 70kft for their work on Craft-Help. While their plugin is definitely more flexible in terms of writing custom markdown in separate files, we wanted to create something that would make it easier for anyone to edit documentation without making any changes to the server. This works particularly well for larger projects where more than one person (especially non-devs) are writing documentation for how to use the CMS.

Releases

We hope this plugin is useful, and we'd love to hear any suggestions or issues you may have. @erskinerob.

Brought to you by Rob Erskine.

craft-user-manual's People

Contributors

aaronbushnell avatar brandonkelly avatar johnfmorton avatar jorgeanzola avatar mcclaskiem avatar mgburns avatar michaelrwalton avatar roberskine avatar sameerast avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

craft-user-manual's Issues

Failed to instantiate component or class UserManualAsset

Craft 3 install, using the project.yaml setup. On local my UserManual works great, but on both development and production servers, I get the following error when trying to visit the UserManual to view the pages - editing them works as expected.

Failed to instantiate component or class "hillholliday\usermanual\assetbundles\usermanual\UserManualAsset".

Screen Shot 2019-10-28 at 9 31 07 AM

Clearing cache doesn't trigger anything. Any ideas on a fix?

Craft 4 Update Versioning Issue in the Read Me

Appreciate all of your work! Pretty minor lil issue, but saw in a recent change that you updated it to hillholliday/craft-user-manual: 2.1.2 but I believe it should actually be hillholliday/craft-user-manual: 4.0.0 so the composer.json file shows "hillholliday/craft-user-manual": "^4.0.0",

Update readme on how to setup Section

Hello,

I'm having trouble with setting up the section propery. What URL does it expect? First entry is displayed correctly, but in the navigation, any other link throws a 404 page no matter what level I move it to.

Port to Craft 4

Creating a ticket to prepare this plugin for Craft 4.

Going to try to work on this the week of 2022-05-02.

Craft 4 Install fail

I saw that user manual is now ready for Craft 4 so I attempted to install it however after running the composer command from the readme and also tried from the Craft plugin store

composer require roberskine/craft-user-manual

composer require roberskine/craft-user-manual && php craft plugin/install usermanual

It fails with this error message in red:

  [InvalidArgumentException]                                                 
  Could not find a matching version of package roberskine/craft-user-manua   
  l. Check the package spelling, your version constraint and that the pack   
  age is available in a stability which matches your minimum-stability (be   
  ta).  

User Manual Entries not accessible if administrative changes disabled

Hi

We currently use the 'allowAdminChanges' => false, option in general.php in our Staging and Production environments. However when we try to access the User manual entries (admin/usermanual), it seems to redirect to admin/settings/plugins/usermanual instead and give a 'administrative changes are not allowed in this environment' error.

The user manual entries are still accessible on dev environments.

Many thanks for your help

Installation Error

I'm getting a Composer was unable to install the updates due to a dependency conflict. when trying to install your plugin.

`Composer output: Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

Problem 1

  • The requested package hillholliday/craft-user-manual could not be found in any version, there may be a typo in the package name.

Potential causes:

  • A typo in the package name
  • The package is not available in a stable-enough version according to your minimum-stability setting
    see for more details.
  • It's a private package and you forgot to add a custom repository to find it

Read for further common problems.
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.`

New version not available in Updates

I have version 2.0.0 and would like to update to 2.0.1 to remove the deprecation errors but it doesn't show up as an update in Craft plugins. Do I have to do it through composer?

Toggle to disable front-end visibility of docs

First let me say, fantastic plugin! I've been using it for years and it's very reliable.

I actually came here to file this FR, and stumbled across a related thread that hit a lot of the same topics. In fact, this comment sums it all up...

The User Guide pages should not be accessible from the front-end of the site.

I guess it's cool that the data is accessible from the front-end, but I personally don't think I'd ever use it that way. If there was just a simple way to switch off the front-end visibility, that would be great.

I know we can add this snippet to our templates...

{%  if not currentUser %}
  {% redirect '/' %}
{% endif %}

... but that just feels like unnecessary clutter for something that should be handled automatically.

If you have to choose between #15 and this ticket, I would much rather you fix that ticket the way Daryl proposed. Like I said, I personally don't think I'd ever need to use this plugin to manage documentation on the front-end... there's no need for a toggle if you just kill off front-end access entirely.

Thanks for all your hard work! πŸ™‚

Deprecation warnings

Thanks for porting it to Craft 3! There are several deprecation warnings showing in the CP for this plugin.

image

Users Can't Scroll Down

I have checked in Chrome, Firefox, & Safari on a Mac. I can't scroll down to view long guide pages. We are using the default template and just have the one rich text variable called "body." We can scroll down on when editing the guide pages but can't scroll down when viewing them as the content editors would be doing.

Plugin causes "Twig instantiated before Craft is fully initialized" warning

When I enable this plugin in Craft CMS v4.2.0.2 I get to see warnings telling me that Twig is instantiated too early (in the ./storage/logs/ directory or on the commandline when CRAFT_STREAM_LOG is active):

2022-08-03 11:32:08 [console.WARNING] [craft\web\View::createTwig] Twig instantiated before Craft is fully initialized. {"memory":22820336}

This seemed to be caused by the _addTwigExtensions() function that is called from the init-function in UserManual.php. This uses Craft::$app->view->twig->addExtension(new UserManualTwigExtension);, but according to https://craftcms.com/docs/4.x/extend/extending-twig.html#register-a-twig-extension should be Craft::$app->view->registerTwigExtension(new UserManualTwigExtension);

Would it be possible to fix this warning?

Is it possible to change admin url?

I have changed the working title of user manual to Admin Guide. Wondering if it is possible to change /admin/usermanual/{slug} to admin/admin-guide/{slug}
Thanks!

Suggestion - remove the requirement of URLs

To get a section to be usable for the User Manual, it must have URLs enabled. There are two downsides to this:

  • http://domain.test/user-manual/entries resolves to the home page, because Craft resolves the template in Site Settings
  • SEOmatic registers it as a section which needs Content SEO set up on it, which is irrelevant because it shouldn't be viewable on the front end.

Any chance of letting it somehow use a section which doesn't have URLs?

⚠️ Please read: existing trouble, January 2022

Hey there,

I originally launched this plugin as open-source and I intend to keep it that way. Unfortunately I left my role at my previous job where I released this project. I am working with Pixel & Tonic to resolve the namespace issues across ID management and desire to provide continued support long-term. If there are any hiccups or issues you encounter implementing this plugin please let me know.

Thanks,
Rob

Cannot install

When trying to install from the plugin store it results in a server timeout. When attempting from the command line it shows this error (Craft CMS 4.3.5):

In PackageDiscoveryTrait.php line 375:                                                                                                 
  Could not find a matching version of package roberskine/craft-user-manual. Check the package spelling, your version constraint and that the package is available in  
   a stability which matches your minimum-stability (stable).   

Deprecation errors

Following deprecation errors are occuring:

Looping through element queries directly has been deprecated. Use the all() function to fetch the query results before looping over them.
/Users/…/vendor/hillholliday/craft-user-manual/src/templates/index.twig:15

craft.request.getLastSegment() has been deprecated. Use craft.app.request.segments|last instead.
/Users/…/vendor/hillholliday/craft-user-manual/src/templates/index.twig:16

craft.config.get() has been deprecated. Use craft.app.config.general.setting instead.
/Users/…/vendor/hillholliday/craft-user-manual/src/templates/settings.twig:26

craft.config.get() has been deprecated. Use craft.app.config.general.setting instead.
/Users/…/vendor/hillholliday/craft-user-manual/src/templates/settings.twig:41

craft.config.get() has been deprecated. Use craft.app.config.general.setting instead.
/Users/…/vendor/hillholliday/craft-user-manual/src/templates/settings.twig:60

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.