Craft-User-Manual icon indicating copy to clipboard operation
Craft-User-Manual copied to clipboard

Suggestion - remove the requirement of URLs

Open darylknight opened this issue 5 years ago • 10 comments

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?

darylknight avatar Apr 17 '19 11:04 darylknight

Hey @darylknight, wanted to confirm receipt on your suggestion. Lemme look into it over the next few days and see what we can come up with for using a section/structure with no URLs.

RobErskine avatar Apr 17 '19 18:04 RobErskine

Really appreciate the acknowledgement Rob! Thanks for looking into it.

darylknight avatar Apr 18 '19 07:04 darylknight

Any update on this? I would like this requirement to be removed as well. The User Guide is meant for CMS users, not website users. The User Guide pages should not be accessible from the front-end of the site.

missmatsuko avatar Sep 30 '19 21:09 missmatsuko

Hey @missmatsuko, apologies for the delay on this. Been busy with client work and haven't had time to work on open-source stuff.

I go back and forth on if user's who aren't logged in should see the documentation. It certainly depends on the type of documentation you write and what audience you are going for. You can remedy this for your use case by adding some twig to your user manual template:

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

{{entry.body}}

This will redirect users who aren't logged in to the homepage if they try to hit one of the user manual pages from the front-end.

RobErskine avatar Sep 30 '19 22:09 RobErskine

Thanks for the update Rob. I understand client work getting in the way (snowed under myself), although did want to chip in on this. I'd argue that documentation about how to use the CMS should only be available within the CMS. It's not public information that needs to be accessed by random users, and from the original issue - shouldn't be in the sitemap either.

darylknight avatar Oct 01 '19 06:10 darylknight

So I'm kind of confused when you would want to use this plugin for documentation that intentionally shows on the front-end. Why not just use Craft's entries with your own templates and just look at it from the front-end of the site (or in the entry preview)?

Also the redirect in template solution doesn't address the entries showing in the sitemap, as @darylknight said.

missmatsuko avatar Oct 03 '19 20:10 missmatsuko

We host sites where some documentation is available on the front-end and others where it's not. It depends on if it's customer-facing, if there is documentation that is needed for logged-out users, etc. User Manual is unopinionated about how you use your content.

Through various sitemap plugins, like SEOmatic, you can tell it to ignore certain sections or entries altogether. SEOmatic has a whole robots.txt configuration you can use to tell it not to appear in search results or in sitemaps.

We welcome PRs if you want to take a stab at implementing your intended solution.

RobErskine avatar Oct 03 '19 21:10 RobErskine

I agree with @darylknight and @missmatsuko on this one... I don't see myself using this plugin outside of the control panel. Craft provides a myriad of ways to get to Entry data, there are other avenues for people to wire their documentation up to the front-end.

I came here to ask for a toggle switch (#20), but this solution is way better IMO.

lindseydiloreto avatar Jun 01 '20 20:06 lindseydiloreto

Wondering if there is any update on this? I'm running into some SEO redirect issues because the slugs being used by my documentation are being displayed rather than the pages that are meant for front-end users.

laurabennett avatar Oct 27 '21 14:10 laurabennett

I just published a small PR that (I think) accomplishes this. By using entry IDs in the CP URL requests instead of slugs, the plugin works just fine when the entries section used for User Manual does not have public URLs.

Any thoughts?

daltonrooney avatar Jan 05 '23 05:01 daltonrooney