Difference between revisions of "PT Blog Version 2.0 Install"
(→Import Custom Elements) |
(→Subsites) |
||
Line 47: | Line 47: | ||
=== Lightbox === | === Lightbox === | ||
+ | '''DELETE START''' | ||
# Create a new subsite under the site root called ''lightbox''. | # Create a new subsite under the site root called ''lightbox''. | ||
# Create a new subsite under ''lightbox'' called ''blogs''. | # Create a new subsite under ''lightbox'' called ''blogs''. | ||
+ | '''DELETE END''' | ||
=== Blogs === | === Blogs === |
Revision as of 16:30, 21 October 2011
Contents
Download
Download the Blog Application from the Community Site Project or from the SVN Repository.
Extract the zip files into the following directory: /ADF/apps/pt_blog/
Site Configuration
- Make sure the ADF is setup and running on the site. If the ADF is not setup, then follow the instructions for ADF Installation.
- Open the sites 'ADF.cfc' ( See Site Configuration (ADF.cfc) for more info) file in a text editor. Locate the Load the ADF Application into application space comment in the file. Add the following command under the comment section:
loadApp("ptBlog2");
- Reset the ADF for the server and site.
Import Custom Elements
Create a "PT Blog Elements" category and import all portions of each component in the order listed.
Import Custom Element:
- Blog2 (Blog2-Custom-Element.zip)
- Posts2 (Posts2-Custom-Element.zip)
- Comments2 (Comments2-Custom-Element.zip)
- PTBlog2 Configuration (PTBlog2-Configuration-Custom-Element.zip)
Import Metadata:
- Blogs (Blogs-Metadata-Form.zip)
Verify Imports
The imported components' render handlers and custom field types must be verified. During the import process, the render handler and custom field types paths may have been changed to reflect the current site's path.
Review and update these paths to reference the ADF path. In most cases, this will just require to be unlocked and a change in the path from the site name to 'ADF'. Check the paths for the custom field types that were imported with the custom elements by unlocking them and fixing the explicit paths to point to "/ADF/extensions/".
If the custom elements that are imported contain custom field types that are already in the site, the naming convention for the custom field type will be unique. To resolve this, unlock the field types and elements, and reassign the element field type to the pre-existing field type.
Subsites
It is highly recommended this Blog Web Admin subsite for administrators and a Blog Lightbox subsite for the lightbox pages. This allows security to be setup for the subsite to allow only administrators access for the webadmin and the CS toolbar turned off for the lightbox pages.
Your site may already have a webadmin and/or lightbox subsite. The steps below will add a blogs subsite into the webadmin and lightbox subsites.
Web Admin
- Create a new subsite under the site root called webadmin.
- Create a new subsite under webadmin called blogs.
- Configure the /webadmin/blogs/ subsite Content Security to give 'No Rights' to 'Anonymous Users' and 'Authenticated Users'.
- Configure the /webadmin/blogs/ subsite Content Security to give permissions to the group of administrators who will manage the Blogs.
Lightbox
DELETE START
- Create a new subsite under the site root called lightbox.
- Create a new subsite under lightbox called blogs.
DELETE END
Blogs
The subsite for the blog pages must be created manually. This subsite is custom to your implementation and can be any subsite within the site. If you don't have a specific subsite then create a Blogs subsite under the site root.
Templates
Lightbox Template
The Lightbox template will be used to render pages within a lightbox. The Lightbox template may already exist on your site if you have installed another ADF application. Check your sites templates before following the steps below to create the template.
- Create a new page named Lightbox Template from the Blank Layout Template in the Lightbox subsite.
- Submit and activate the page.
- Save the page as a template.
- Submit the template for public use.
Blog Post Template
The Blog Post Template is the template that all the blog post pages are created from. To construct your Blog Post Template complete the following steps.
- Create a CommonSpot page called 'Blog Post' from the Base Plus One template. (The subsite for this is not critical but it is a good idea to create this page in a subsite that has been created for the Blogs.
- Place the Posts2 Custom Element on this page.
- Click Render Mode in the element interface.
- Select Display existing element data (content reuse) on the Rendering Mode tab.
- Select the Filter tab.
- Select Filter Type to Show subset of records.
- Select the field drop-down as the PostID field.
- Select the operator as Equals.
- Click the '...' button to open the ColdFusion expression window.
- Enter the text request.page.metadata.blogs.postID as the expression and check the force cache checkbox. Click OK and then check the box to Ignore ColdFusion error, then click OK.
- Click OK on the render mode window.
- Click More in the element interface. Then the Custom Render Handlers menu option, and choose the Main Display Render Handler. (You may see an error on this page with the Render Handler. That is OK at this point.)
- Submit Page and then Save as Template.
- Remember to submit the template for public use.
- Go to the CommonSpot Site Administration and bind the Blogs metadata form to this new Blog Post Template.
CCAPI Configuration
The Blog Application uses the ADF CCAPI to populate blog post records. This needs to be configured for the site and blog app.
Follow the steps to setup the CCAPI Config file for the site if this is not done. Once this is completed, follow the steps below to setup the CCAPI config for the Blog App. Make sure to update the wsVars section with the correct URL's and username/password.
- Create a new page called 'ccapiBlog'. Recommend creating this page in the /webadmin/blogs/ subsite.
- Add the 'Posts2' element to the page.
- Select the 'Posts2' element indicator and go to 'more...'. Select 'Name' from the menu.
- In the Element Name field, enter the text 'ccapiPosts2Element'.
- Add the 'Comments2' element to the page.
- Select the 'Comments2' element indicator and go to 'more...'. Select 'Name' from the menu.
- In the Element Name field, enter the text 'ccapiComments2Element'.
- Publish this page and put in read mode.
- Edit the 'ccapi.xml' file for the site and add the following xml block into the <elements> section:
<BlogPost>
<pageID>#####</pageID>
<subsiteID>##</subsiteID>
<elementType>custom</elementType>
<controlName>ccapiPosts2Element</controlName>
</BlogPost>
<Comments>
<pageID>#####</pageID>
<subsiteID>##</subsiteID>
<elementType>custom</elementType>
<controlName>ccapiComments2Element</controlName>
</Comments>
- To populate the <pageID> and <subsiteID> tags, view the source code for the 'ccapiBlog' page that was just created.
- Identify the following line in the source code and enter this numeric value into the <subsiteID> tag:
var jsSubSiteID = ##;
- Identify the following line in the source code and enter this numeric value into the <pageID> tag:
var jsPageID = ####;
Reset the ADF for the server and site.
Create Add Blog Post Page
This page will be used to create new Blog Posts in the Blog Administrator. Each Blog will share this Add page.
- Create a new page from the Lightbox template called "Add Blog" in the /lightbox/blogs/ subsite.
- In the main content of the page, add a Custom Script element.
- Select the "/ADF/apps/pt_blog/customcf/handle_blog_post_create.cfm" script (Note: after page reloads a Simple Form Element will Appear)
- Choose "Select Form" from the Simple Form Element Interface
- Choose option 2 (Select Simple Form/Custom Element)
- Select the "Posts2" Custom Element
- For the Form Action: choose Display Textblock on Submission option and add 'Blog Post Successfully Created!' text in the RTE.
- Publish Page
Create Blog Dashboard Page
This page will be used to manage the blog post and comments for each blog. Each Blog will share this Dashboard Page.
- Create page from the Base Plus One template called "Blog Dashboard" in the /webadmin/blogs/ subsite.
- Place Custom Script on the page
- Select the "/ADF/apps/pt_blog/customcf/blog_dashboard.cfm" script (after page reloads 2 tabs and links to datasheets will appear)
Configure Posts Tab
- Click the "Posts" tab
- Define a View for the Datasheet Element in this Tab - call it "All Blog Posts"
- Leave the View Source as the Default: Form Result/Custom Element Sheet
- Select the "Posts2" Custom Element and select the following columns: PostID, PostPageID, Title, Created By, and Date Posted.
- On the Datasheet, click on the "Filter" and apply the following filter: Field = BlogID; Operator = "equals"; Value = "request.params.blogID" (note: use the UDE button)
- Edit the datasheet columns.
- Edit the PostID column, change the render handler to: /ADF/apps/pt_blog/datasheet-modules/lightbox_edit_delete_post.cfm
- Edit the PostPageID column, change the render handler to: /ADF/apps/pt_blog/datasheet-modules/post_page_url.cfm
- Clear the header text for the 2 fields.
- Edit the datasheet layout
- Uncheck "Allow JavaScript data sorting"
- Click "Save"
Configure Comments Tab
- Click the "Comments" tab
- Define a View for the Datasheet Element in this Tab - call it "All Blog Comments"
- Leave the View Source as the Default: Form Result/Custom Element Sheet
- Select the "Comments2" Custom Element and select the following columns: CommentID, Name, Created By, and Date Created.
- On the Datasheet, click on the "Filter" and apply the following filter: Field = Comments2.blogID; Operator = "equals"; Value = "request.params.blogID" (note: use the UDE button)
- Edit the datasheet columns.
- Edit the CommentID column, change the render handler to: /ADF/apps/pt_blog/datasheet-modules/lightbox_edit_delete_comment.cfm
- Edit the datasheet layout
- Uncheck "Allow JavaScript data sorting"
- Click "Save"
- Publish the Blog Dashboard page.
Create Blogs Management Page
This page will be used to manage the blogs for the site.
- Create page from the Base Plus One template called "Blogs Manager" in the /webadmin/blogs/ subsite.
- Place Custom Script on the page
- Select the "/ADF/apps/pt_blog/customcf/all_blogs_manager.cfm" script.
- Define a View for the Datasheet Element for this page - call it "All Blogs"
- Leave the View Source as the Default: Form Result/Custom Element Sheet
- Select the "Blog2" Custom Element and select the following columns: blogID, blogTemplate, Name, Subsite, DateCreated, and Active.
- Edit the datasheet columns.
- Edit the blogID column, change the render handler to: /ADF/apps/pt_blog/datasheet-modules/blog_dashboard_link.cfm
- Edit the blogTemplate column, change the render handler to: /ADF/extensions/datasheet-modules/lightbox_edit_delete.cfm
- Clear the header text for the 2 fields.
- Edit the datasheet layout
- Uncheck "Allow JavaScript data sorting"
- Click "Save"
- Publish the Blogs Management page.
Create Blog Configuration Record
We are creating a single Blog Configuration element record to be used within the application.
Go to the Blogs Management Page and select the Edit App Configuration link. In the form, select the CommonSpot pages that were created in the previous steps.
Reset the ADF for the server and site.
Blog Listing Page
This page will be used to list the Blog Posts.
- Create a new page from the Base Plus One template with page name "index" and title "Blogs" in the /blogs/ subsite.
- In the main content of the page, add "Posts2" element.
- Select the "Home Page Display" render handler.
- Open the elements "Render Mode" and select "Display existing element data (content reuse)" and "Render results dynamically based on a filter, or display all records.".
- Select the "Show all records" option and set the sort order to "Date Posted" is "Descending".
- Publish Page