Getting started with the CMS module of Bright Content
Initial set-up
For now unfortunately you need to install a few separate packages. BCMS will soon be rolled into the main BC package. Install BC and prerequisites, e.g. following examples at Bright_Content/Sample_setups.
Then install BCMS. For example:
hg clone http://hg.4suite.org/zepheira/elarson-stc bcmsprototype cd bcmsprototype cd OpenIDClient python setup.py develop cd ../bcms python setup.py develop cd ..
Then launch the server
paster serve --reload development.ini
There are no pages at first, so go to the admin interface to add one:
http://127.0.0.1:5001/admin/
You'll be prompted for your OpenID. You can control what OpenIDs are allowed to admin your site by editing cms_app/openid_users.txt. Upon successful authentication you'll be redirected to the admin page. Ignore the "Core Data" and "Comment Moderation" links for now. Click on Pages ( http://127.0.0.1:5001/admin/pages/list/ ). Click "New".
You'll be prompted for a URL and a template. Pick a URL, e.g. "bcms". Use the template cms_app/tests/new_page_template.xslt. Set "Draft" to "no".
You'll see the new pages listed at http://127.0.0.1:5001/admin/pages/list/ . You can click directly on the entry link to see it rendered.
Ongoing page management
A page is defined by its content, URL and status (draft or production) generally built from a data set and an XSLT template (other template systems will be supported in future), generally part of a theme. Each page then is the result of the template stylesheet applied to the core data file.
Create a template
You can use the demo frame template cms_app/templates/cms/demo/frame.xslt, and the sample page template cms_app/tests/new_page_template.xslt for example.
Create a URL and Add a Page
To create a page, you can copy the above example and place it in a file for editing. After you have added any HTML you wanted to the "maincontent", you can add the page to the site. To add a page go to the administration area (http://semantic-conference.com/admin) and click the "Pages" link. There you will see a listing of the current pages that have been created. If there no pages currently, nothing will be listed. Clicking the "new" link will show forms for adding a page. [Note: You must have an OpenID account and be authenticated in order to access this area. To obtain an OpenID, visit --> https://www.myopenid.com/. Instructions on how to add, update or delete OpenIDs for site users can be found in the “Administration” section of this document.] The forms contain three fields:
- Page URL: Enter the URL you have chosen for this page.
- A file upload for a Template: Choose the template file you have created for upload.
- The Draft status: The draft status represents whether the page is visible on the live version of the
site. If the "draft" is set to "yes", then it is considered a draft and it not publicly available. If the draft is set to "no", the page is considered "published" and will be made available on the site. Once you have filled in content for all three fields, hit the “create” button. At the top of the page you will see “Created!” once the operation has successfully completed.
Creating your own site setup
What you'll need
- Presentation templates in XSLT (this is usually easy to create from a static XHTML page template)
- Identify all the documents, records sets and content feeds
Why do I need all that?
Well, in truth you don't. This is a quick start, and if you prefer to use different content or rendering technologies.
Old notes
...file that can be edited and added to via the /admin/core/ UI. The second is a
Also, there were some small updates to the Zepheira branch of BC for updates, so make sure you have the latest from /var/local/hg/zepheira/brightcontent/ and that you reinstall via setup.py if you are using install. If you use develop, you should be fine by simply pulling and updating.
There are two example templates to use in the tests directory of the repo that give a basic example of adding a template. The test flow is as follows:
- Start the server and go to /admin/pages/list/
- Click the "new" link, which takes you to /admin/pages/new/
- Enter in the URL text input "battle" and upload the "new_page_template.xslt" from the tests directory, Submit
- Verify that the "Created" message appears and go back to /admin/pages/list/
- Verify the new page was created and the draft status is "yes"
- Visit the page by clicking the URL column link
- Click the edit link and change the file to be "update_page_template.xslt", Submit
- Go back to the /admin/pages/list/ and click the URL column link to see the updated message
- Go back to the /admin/pages/list/ and click the "publish" link
- Verify the link changed to "draft" and the draft value changed to "no"
- Click the "draft" link and verify the link changed to "publish" and the value changed to "yes"
