Google Docs content node type for the Neos CMS
Google Docs content node type for the Neos CMS.
This is a proof-of-concept implementation and therefore not yet perfect to be used for normal editors. To add content from Google Docs the editor needs to add the Google Docs FileID ( http://prntscr.com/hjdu82 ) manually in the backend. That file will render as HTML format.
You can install the plugin via composer.
composer require codeq/googledocs
Adopt this settings into your site package's Settings.yaml
CodeQ: GoogleDocs: authentication: # Google OAuth 2.0 client secret file # Place this JSON file in safe location and provide respective path here. # Path should be respective to the DOCUMENT_ROOT\Web folder clientSecretFilePath: ~ # This file will be generate automatically for storing the access token temporary # Please provide safe location with file name # Path should be respective to the DOCUMENT_ROOT\Web folder accessTokenFilePath: ~ # Google OAuth 2.0 App name appName : ~ # Google OAuth 2.0 Redirect URI redirectUri: ~
- Go to the Google API Console.
- Select a project.
- In the sidebar on the left, expand APIs & Auth and select APIs.
- In the displayed list of available APIs, click the link for the Drive API and click Enable API.
- Within the Drive API page, select the Drive UI Integration tab and begin configuring how your App will integrate with the Drive UI.
- Go To Credentials Section.
- Click on
Create CredentialsButton and select
OAuth Client IDfrom the dropdown.
Web applicationfrom given options.
- Add the name of the App (which will be also used in the Settings
Authorized redirect URIs(replace with your actual domain). This URL will also need to be placed into the settings in
- Save all details. It will redirect you to the dashboard.
- Select your entry from the OAuath Client IDs section (https://prnt.sc/hmvbnv).
- You will see the
Download JSONbutton on the top (https://prnt.sc/hmvc2q). Click and download that file.
- The download JSON file is the
clientSecretFileused in our settings. Put that file into the secure place and give the respective path in the settings.
Backend module is specially used for Authorizing the Google account for accessing the Google Docs File.
You will find the Backend Module
Google Drive Authentication.
- Go the module and Click on the
- You will redirect to the Google Consent Screen. Complete the authorization process and it will redirect you back to the module (if
redirectUrisetting is not properly set, it may give you error when trying to authorize account).
- Once you complete Authorization completely, you will find the
Sign outbutton. Click it if you want to de-authorize your account. De-authorizing will stop the file showing in the frontend.
Once all above things are setup successfully, You will find the new CE
Google Docs in your
content collection (if it is allowed from the
yaml configuration of the
Document NodeType) https://prnt.sc/hmvgd2.
Add that CE into content collection, you will find the Google File ID property. https://prnt.sc/hmvgsq You can find the Google File ID from its URL, here is the reference about how to find ID https://productforums.google.com/forum/#!category-topic/docs/no/3STOEukh1pU.
Add the Google Docs File ID into the field. Page will automatically reload and you will find the content of Google Docs as HTML format.