How to login local CMS?

Hi,

I can see login page at http://localhost:8000/admin/#/ but don’t know how to obtain login info. Tried my netlify id, but as expected it didn’t work. Any tips?

static/admin/index.html looks like this:

<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Content Manager</title>
</head>
<body>
  <!-- Include the script that builds the page and powers Netlify CMS -->
  <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
</body>
</html>

Can you share your config.yml file? If you’re using git-gateway, you have to register through Netlify Identity.

Sure:

backend:
  name: git-gateway
  local_backend: true
  branch: master
  commit_messages:
    create: 'Create {{collection}} “{{slug}}”'
    update: 'Update {{collection}} “{{slug}}”'
    delete: 'Delete {{collection}} “{{slug}}”'
    uploadMedia: '[skip ci] Upload “{{path}}”'
    deleteMedia: '[skip ci] Delete “{{path}}”'

media_folder: static/img
public_folder: /img

collections:
  - name: config
    label: Site Configuration
    files:
      - name: config
        label: Site Configuration
        file: site-metadata.json
        fields:
          - widget: string
            name: title
            label: Title
            required: true
          - widget: string
            name: description
            label: Description
            required: true
          - widget: select
            name: palette
            label: Color Palette
            required: true
            hint: The color palette used for the website.
            options:
              - Blue
              - Green
              - Black & White
  - name: people
    label: Our Team
    folder: /src/team/
    create: true
    extension: md
    slug: '{{slug}}'
    identifier_field: personname
    fields:
      - widget: string
        name: personname
        label: Name
        required: true
      - widget: string
        name: email
        label: Email Address 
        required: false
      - widget: string
        name: phone
        label: Phone Number of the person
        required: false
        hint: "E.g.: 999.555.9999"
      - widget: image
        name: personimage
        label: Image
        required: false
      - widget: markdown
        name: personprofile
        label: Person Profile
        required: false
      - widget: hidden
        name: template
        label: Template
        required: true
        default: page
    filter:
      field: template
      value: page

  - name: pages
    label: Pages
    files:
      - name: about
        label: About
        file: /src/about/index.md
        fields:
          - widget: string
            name: title
            label: Title
            required: true
          - widget: string
            name: subtitle
            label: Subtitle
            required: false
            hint: The text shown below the page title
          - widget: image
            name: image
            label: Image
            required: false
            hint: The image shown below the page title
          - widget: hidden
            name: template
            label: Template
            required: true
            default: page
          - widget: markdown
            name: body
            label: Content
            required: false
            hint: Page content

      - name: testimonials
        label: Testimonials
        file: /src/testimonials/index.md
        widget: list
        fields:
          - widget: string
            name: quote
            label: Quote
            required: true
            hint: Client's testimonial
          - widget: string
            name: author
            label: Author
            required: false
            hint: Client's name
      - name: contact
        label: Contact Information
        file: /src/contact/index.md
        widget: object
        fields:
          - widget: string
            name: location
            label: Location name
            required: false
          - widget: string
            name: address
            label: Address
            required: true
          - widget: string
            name: email
            label: Email Address
            required: false
          - widget: string
            name: phone
            label: Phone
            required: false
          - widget: string
            name: fax
            label: Fax Number
            required: false

Have you followed these steps?

2 Likes

Hi @abdu, you should include the identity widget if you’re using Netlify identity:

<!doctype html>
<html>
<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  <title>Content Manager</title>
  <script type="text/javascript" src="https://identity.netlify.com/v1/netlify-identity-widget.js"></script>
</head>
<body>
  <!-- Include the script that builds the page and powers Netlify CMS -->
  <script src="https://unpkg.com/netlify-cms@^2.0.0/dist/netlify-cms.js"></script>
</body>
</html>
1 Like

Hi @tomrutgers, @erez.

I didn’t add identity script. The index.html is same as shown in the first message in this topic.

I don’t exactly remember , but I think it was an issue with netlify identity settings. I enabled identity, reconnected github repo, and now it works. When connecting to /admin in local, it first asks netlify address. So, everything is fine. Thanks for your reply.

Now I have to figure out how to show content created in CMS in the actual pages. :slight_smile: The starter I used didn’t have Netlify CMS integration, so I edited js files (like about.js for /about page). I’m guessing I have to have a template and use graphql to bring data from CMS file. Any tips or resource recommendations are highly appreciated.

Thanks as always, cheers.

2 Likes

Glad you got things worked!

1 Like