Battler45 / SierraMigrationToGitHub

Migration from unfuddle to GitHub
0 stars 0 forks source link

Create Blog Post Add / Edit Form #182

Closed Battler45 closed 4 years ago

Battler45 commented 4 years ago

Vihang,

I've prepared a mockup of the form that you can use to implement the Add / Edit Blog Post functionality on the site:

http://client.sierrainteractivedev.com/blog-post-form.htm

Some of the features of this form will be straightforward, but there are a number of details that will need to be taken into account. In implementing this functionality, you may want to review the functionality of the blog post editor on the current admin site. Go to:

http://client.sierrainteractive.com

And login using:

Sitename: joehaydenrealtor.com Username: joe Password: g0ldr3c0rd

Please bear in mind that this grants access to a live site, and so please refrain from making any changes to content (or, at least, undo them once they are done). To get to the Blog manager, click the Manage Blog link. If you need to add a new post to review the functionality, that is fine, as long as you remove it within 5-10 minutes after creating it. There are some differences between the functionality of the old system and what you will be implementing, but there are also quite a few similarities.

1 -- The Post Title field corresponds to the PostTitle field of the SICM_BlogPosts table

2 -- The Post Filename field corresponds to the PostFilename field of the SICM_BlogPosts table

3 -- The Category drop-down pulls from the SICM_BlogCategories link. When you click this drop-down, you'll notice a "New Category..." option. When selected, this should pop-up an overlay window (as on the current site) which prompts the user for the name of the new category and also for the filename.

On tab, the programming should automatically convert the users category name into a filename by stripping out all spaces and special characters, transforming all characters to lowercase, and replacing spaces with hyphens. The user will still have the ability to edit the filename, but when focus is removed from the field, the programming should automatically validate the user's input to the above standard.

The filename is used as part of the URL on the front-end blog when viewing posts from that particular category, so the filename should also be validated against other filenames from that blog to ensure that there are no exact duplicates (on submit). On successful submission of the New Category form, the new category name should dynamically be added to the Category drop-down and selected.

4 -- The Tags drop-down pulls from the SICM_BlogTags table. When the user selects the "New Tag..." option, an overlay should appear with the title "New Tag" requesting the name of the new tag (as on the current site). On submit, the user's input should be validated to make sure it is not a duplicate. On success, the modal dialog should close, and the tag should be linked to the post and displayed as in the example in the mockup. This functionality resembles the "Label" functionality in GMail, where you can assign multiple labels to a single email message.

When the user clicks an X next to any assigned tag, the tag disappears and the database relationship between the tag and blog post are removed.

It's important to note that when the user initially arrives at this page to add a new blog post, the Tags drop-down should be disabled. This is because the new post will not yet have a database ID, and so it would not yet be possible to associate tags with the post.

It is only after the user enters a post title and filename, and selects a category, and (optionally) enters meta-tags for the post, that the Tags drop-down should become enabled. (And, of course, it is always enabled in cases where the user is editing an existing post.)

5 -- The Meta-Tags textareas pull from the SICM_BlogMetaTags table.

6 -- You'll notice that in the right column there are two separate gray boxes with the title "Post Overview." The top box is an example of what the user should see when editing a post; the bottom box is an example of what the user should see when adding a new post (on initial page load). So, of course, there would only be one of these boxes visible in the finished page.

I would like the gray box to follow the user down the page as he scrolls down, so that it always remains visible and well-positioned for the user throughout the editing process. This means that the Save and Cancel buttons will be available at any time. I know there are some jQuery plugins / scripts which create an animated effect for accomplishing this, and if you can find one that is easy to implement, that's great. Otherwise, using CSS and fixed-positioning would also be fine if that will work.

For new posts, please default the Status to On-Hold, and the date and time to the current date and time. Clicking the date or the arrow next to it should bring up the same date / time picker that Vihar has already implemented on the task functionality on the Lead Detail page.

7 -- For new posts, when the user completes Title, Filename, and Category and clicks the Save button, a "slide down" message should appear from the top of the screen indicating that the post has been created successfully (blue text on white background as Vihar has implemented on other pages on the site), and the user should be scrolled down to the bottom of the form, where a text-editor window should dynamically be made to appear.

To get a sense of how this should work, please do go ahead and try adding a new post on the above website.

On the current admin area, I have been using the open source FCK editor to provide the editor functionality, and I think we should stick with that. They have a new version (the CK Editor) but in testing, I have not been happy with the way it automatically rewrited HTML entered into the editor window, and so I would prefer to stick with version 2.6.4 as on the current site (or a newer one in that line, if available).

If you view source on the Edit Blog Post page on the current admin area, you'll see quite a bit of javascript included in-line with the page. It is not pretty and not well-documented, but it should give you a basic idea of how to go about implementing this functionality. The FCK editor does include methods for dynamically creating and inserting editor windows on the fly. I've zipped up and attached the fckeditor files from the current site for you to use on the new site if you want to do that, but feel free to adapt or change as necessary.

You will definitely need to make some modifications to the Image Browser functionality, as it is currently configured to use the Classic ASP uploader plugin, and you will want to change this to the .NET uploader plugin (see http://ckeditor.com/download -- it looks like for FCK editor 2.6.4 there is an ASP.Net control which should simplify the implementation for you.)

8 -- In the right-column Post Overview box for editing (the top one) you'll also notice that there is an "Auto-Saved..." message. If you can figure out how to implement this type of functionality without too much trouble, please do so, but please don't take too much time for that if it proves to be very difficult. At this point it is more important to me to keep moving forward as quickly as we can than to get snagged on something like that if it ends up taking quite a bit of time.

I think that's it for now -- I'm sure you'll have questions. Please let me know if you do.

Thanks.

Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Ben,

This is to update you on current work progress. I have implemented most of the requirements. I am working on integrating FCKEditor in blog post page.

There is one query regarding "Post Date" control. My understanding is to implement control similar to control on site-analytics page. Please note that that control only supports date selection. If time part is also to be captured than I will need to modify that control. Please let me know your thoughts on this.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

Battler45 commented 4 years ago

Vihang,

Regarding the time control, there is already one implemented on the lead-detail.aspx page that allows for specification of both date and time -- it is related to the "Tasks" which can be assigned to Users. I'm sure Vihar will be able to point you to the necessary code.

Regarding FCKEditor, I know it can be complicated, so if you have any questions, please let me know.

One important point which I neglected to mention earlier: on the current production server, each site has a unique set of files which apply to the FCK Editor CSS capability -- meaning that, for each site, when FCK Editor loads, it pulls a set of CSS styles that are specified as related to the given site.

On the production server, the path to this file is always defined as:

/res/includes/siteconfig/site[SITE ID].xml /res/includes/siteconfig/site[SITE ID].css /res/includes/siteconfig/site[SITE ID].js

When configuring the FCK Editor in the page, it is possible to set a "Custom Configurations Path" like this:

oEditor.Config["CustomConfigurationsPath"] = "/res/includes/siteconfig/site[SITE ID].js" ;

The javascript file then contains references to both the XML and CSS files. The purpose of this is to allow text rendered in the Editor window to match as closely as possible to what will be rendered on the actual site.

If you think it's wise, I can copy all of these configuration files down into any directory you specify on the local site (or another location on the development server). Just let me know. (I set these three files up on the production server each time a new site is added.) Or, if you have a suggestion for an alternate approach, please let me know. This same set of files would also be used in the Content Manager page editor. Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Vihang,

1 -- Thanks -- that's a good point about the "Created" date. Yes, please do add a column for that. My original intention was to use the DatePosted field for that purpose, but I realize now that, being an editable field, we do need an additional field which will hold strictly the datetime at which a post was added to the database.

2 -- Yes, good point. Please remove the "required" asterisk from MetaTitle

3 -- Any user having permissions to manage the blog can edit any blog post.

4 -- Very good points / questions about auto-save. Thinking it through more fully, let's not implement auto-save at this time. We may revisit this decision later and decide to add it, but for now, please do not implement this feature.

Thanks. Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Vihang,

One clarification -- in the current implementation, there is an underscore between "site" and "[SITE ID]" -- for some reason, Unfuddle stripped this out when the comment was posted. Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Vihang,

Everything is working very well, thank you. One small point (and this is different than my original request) -- can you default the Post Status to Active rather than On Hold?

Also, regarding your question about point 2 in comment 9 -- you are correct. I was confusing this with the Content Manager functionality, which will be slightly different due to the user's ability to add multiple text areas and other types of components into those pages.

In the case of the Content Manager, when a text area is added to the page, in the current site I am at the same time adding a row to the SICM_PagesContent table and a row to the SICM_PagesComponentsLink table. But we can discuss that further in the Content Manager ticket.

Eventually we are going to port similar functionality over to this Blog Manager section, but not until we have first completed it for the Content Manager.

Thanks again -- great job. Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Ben,

I have updated "Blog Management" page implementation as per the client-side javascript framework. I have also implemented "Categories Tab".

Please test this and let me know your feedback.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

Battler45 commented 4 years ago

Ben,

I've few queries/points to confirm:

1-- The SICM_BlogPost table doesn't have corresponding column to display "Created" in Post Overview. Please let me know if I should add a new column for the same, as we did for SICM_Pages table.

2-- Having gone through the requirements and looking at SICM_BlogPostMetaTags table I deduce that "Meta Title" is not a required field. Please confirm this.

3-- Can any user having permissions to manage blog, edit the blog post. Or only the creator of the blog post is allowed to edit?

4-- My understanding regarding auto-save feature is that it would be to ensure that user's edits are not lost due to some unknown error. I think it would be a bit complex to enable auto-save feature on all fields. So my suggestion is to keep this to actual contents only. The main reason to not enable this on all fields is that it would require a complex workflow that will involve initially storing data in temporary storage (new table/file), providing user an option to load temporary data in case of any failure and so on...

After user has created a new blog post by entering and saving data in required fields, record would be created in the database. User can then work on adding actual blog contents. This is the stage where we can enable auto-saving of actual contents. Once user starts adding/editing contents, the javascript in the background would periodically auto-save content changes.

Pls note that once the changes are auto-saved, they won't be rolled-back if user "cancels" the changes, closes his browser, loses connection due to any unknown reason.

Please let me know your thoughts on this.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

Battler45 commented 4 years ago

Vihang,

One more note -- when adding a post, when the user clicks the Save button, the Post Status should automatically change from On Hold to Active. Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Ben,

I have implemented blog-post-form page and uploaded the latest changes on development server. You can access the page via "Manage Blog Posts" page. Please note that there is some issue on server while adding new blog post. I am looking into it and will update you on the same.

Please run the attached script to add new column "DateCreated" in SICM_BlogPosts table on Production DB. The Development DB is updated for the same.

Regarding FCKEditor:

1-- Please note that I have set "CustomConfigurationsPath" config parameter of FCKeditor as you had described. When you get time please upload the "Site Config" files for couple of sites on development server for testing.

2-- In fckconfig.js there are several values for "ToolbarSets". Please let me know if this config parameter needs to be set based on Site-ID. For now I've configured FCKeditor to use "MyToolbar".

3-- In current implementation the Image/File upload functionality is disabled as the instructions on config page suggested to perform some sort of validation. I'll work on this tomorrow and upload the changes. Also, there is a config parameter to set User file path. I believe this needs to be configured based on Site-ID as well. Please confirm this.

Regarding Postdate display. The plugin requires to have input controls. So, I'll need to spend some time to implement it as per the requirments.

Please review the page and let me know your feedback.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

Battler45 commented 4 years ago

Ben,

Regarding #9, Yes, It would be better to load FCKEditor via Ajax. I'll update the code for the same. Please note that this will require a few changes in the current implementation. I'll also incorporate changes for #8, and provide you updated functionality by this weekend.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

Battler45 commented 4 years ago

Ben,

I've fixed the category tab issue and updated the live site for the same. Please note that these changes are not published on development site for now. I'll update the development site along with other changes.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

Battler45 commented 4 years ago

Ben,

There is a bug in the code that saves the category-name as the file-name. If it isn't urgent I'll publish this fix along with the other changes.

Thanks.

Posted by Shah Vihang(unfuddle username: vihang)

Battler45 commented 4 years ago

Vihang,

I realized today (much to my chagrin) that in porting over the blog post functionality from the old admin area, I neglected to include the "Blog Post Comment" functionality. To get a sense of what this is and how it works, take a look at the blog here:

http://www.schulerbuilthomes.com/blog/

You'll see that the first post ("Raving Fans!") has 5 comments. If you click, "View Post Detail" you'll see the comments listed in the Discussion section. It's pretty straightforward.

Now, if you will log in to the old admin area at:

http://client.sierrainteractive.com

Using:

schulerbuilthomes.com schulerbuilder delta100

And then go to Manage Blog, you'll see the admin view for those same posts. If you click the "5 Comments" link beneath the "Raving Fans" title, you'll see a page where all of the comments are listed and there is an Edit icon to the right of each one. If you click the Edit link, it uses AJAX to slide in an Edit form where the user can update the comment and / or change its status (Approve, Edit, Delete).

Deleted comments are (obviously) deleted. Approved comments are allowed to appear on the front-end website. On-Hold comments are visible in the admin area but not on the front-end website.

So, your mission (should you choose to accept it) would be to replicate this functionality with a few slight differences.

In the new admin area, I think we should include a new fieldset on the blog-post-form.aspx page below "Post Contents" called "Post Contents". This fieldset would list the blog post comments in a similar format to what you see on the old admin area website, with an edit link next to each one.

However, for simplicity's sake, rather than sliding the content into the page using AJAX, I think it would probably be simpler to display the comment form in an overlay with the appropriate buttons. The Textarea field for the post comment does not need to be an FCK Editor window -- a standard Text Area is fine.

Also, the "Post a Comment" functionality needs to be enabled as on the old admin site (you'll see it below the comments). This allows the blog owner to post comments in reply to comments / queries from site visitors. When clicked the post a comment link should launch an overlay with the comment form, and such comments should automatically have status "Approved" by default.

If you will return to the old admin area for a moment and click the "HOLD" button beneath a comment (after having clicked its edit button), you'll see that a Yellow "Comment Is On Hold" label appears next to the comment title -- please replicate this functionality if you can.

If you click the Edit button again for the same comment, you'll now see that the available buttons are DELETE and APPROVE (HOLD is not an option because the comment is already at that status). So, I think you get the picture. (SUBMIT retains the current status, whatever it may be.)

The table you'll be dealing with in the database for all of this is SICM_BlogPostComments. There are also a number of stored procedures which you may be able to use in porting over the functionality:

SICM_spInsertBlogPostComment

SICM_spUpdateBlogPostComment

SICM_spUpdateBlogPostCommentStatus

I know I've covered a lot of ground here -- I'm sure you'll have questions. Please let me know.

Thanks. Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Vihang,

I've encountered one more small bug with the new categories functionality. In the database, I created a new blog for Site ID 293, KietHomes.com. I then logged in to the admin area with the intention of creating categories for the blog. However, when I went to the blog section, selected KietHomes.com, and then clicked over to the Categories tab, I get an "Unexpected error" message sliding down from the top.

When I then went into the database and added a new category manually and reloaded the Categories tab in the admin area, it worked fine. So it appears to be related to attempting to load the Categories tab for a blog for which no categories have yet been created.

Thanks.

Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Vihang,

Excellent -- I've tested the Categories feature in the Blog and it looks good. One small change request -- can you change "# Pages" to "# Posts"?

Thanks. Posted by Peskoe Ben(unfuddle username: bpeskoe)