question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Content Management

See original GitHub issue

It would be great to be able to define a data structure for storing content, where pages would be a single representation instead of a collection.

The structure would be defined in a similar syntax to models:

keystone.set(‘content', {
    home: {
        title: String,
        headerImage: Types.CloudinaryImage,
        intro: { Types.Html, wysiwyg: true }
    },
    about: {
        title: { type: String, default: 'About' },
        content: { Types.Html, wysiwyg: true }
    }
});

… then there would be an easy way to retrieve content for a particular page, something like this:

keystone.getContent(‘about’, callback);

Page content would be stored on a page-per-document basis, in a collection called app_content.

Issue Analytics

  • State:closed
  • Created 10 years ago
  • Comments:35 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
charleslouiscommented, Dec 1, 2015

Based on @Mentioum solution, here is how we are handleling this at the moment : Disclaimer : this solution is not advanced/better, but the code example might help some people.

1 - We’ve duplicated Post.js model to create a Page.js model

2- created a dropdown with templates template: { type: Types.Select, options: 'page, about, team, contact, portfolio', default: 'page'},

3- display someField if the selected template is ‘about’ someField: { type: String, dependsOn: { template: 'about' } },

and it works 😃

Now, I’d like to have an OR operator in dependsOn: { template: 'about' }, so that I can do something like dependsOn: { template: 'about' OR 'legal' } or dependsOn: { template: 'about || legal' }

Any idea on how to make this happen ?

Thanks !

Full code example for Page.js here : https://gist.github.com/charleslouis/ff5cc15ce7d2f3aee59d

0reactions
mxstbrcommented, Apr 29, 2016

We’re closing all feature requests to keep the issue tracker unpolluted. From now on submit feature requests on productpains.com!

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is content management (CM)? | Definition from TechTarget
Content management (CM) is the process for collection, delivery, retrieval, governance and overall management of information in any format.
Read more >
Content management system - Wikipedia
A content management system (CMS) is computer software used to manage the creation and modification of digital content (content management).
Read more >
What is a Content Management System (CMS) - Oracle
A content management system helps you create, manage, and publish content on the web. It also helps keep content organized and accessible so...
Read more >
Chapter 1. What Content Management Is (and Isn't)
A content management system (CMS) is a software package that provides some level of automation for the tasks required to effectively manage content....
Read more >
Content management system (CMS) - Optimizely
A content management system (CMS) is an application that is used to manage content, allowing multiple contributors to create, edit and publish. Content...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found