Battler45 / SierraMigrationToGitHub

Migration from unfuddle to GitHub
0 stars 0 forks source link

Create Blog Post Add / Edit Form #221

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

Vihang,

One more thought regarding item #10 in my last comment: it will actually be best to insert the new FCK Editor Textarea dynamically via Ajax without reloading the page if you can.

The reason is that in the Content Management section (and also in this Blog Post form, eventually) the user is going to have the ability to insert multiple content areas along with other widgets dynamically into a single page (this functionality already exists in the Content Management form on the current admin site).

So, working out this functionality now, at this point, will allow you to re-use this same code in a couple of future tickets. I believe this will require two steps:

1 -- Submitting the initial form via Ajax to a hidden page which will receive the data, submit it to the database, and then return the ID of the newly created page back to the form page via javascript / AJAX

2 -- Once the new page has been added to the database, insert the FCK Editor dynamically into the page (using javascript) and then add a Component ID for the text editor to the database using Ajax.

If you look at the Content Manager editor form in place on the current site and view source, you'll be able to see a lot of (ugly, uncommented) javascript code which performs this functionality. I am sure you won't want to re-use much of this code, but you should be able to locate and copy out the code which allows you to dynamically add FCK Editor windows into the page using a javascript function.

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

Battler45 commented 4 years ago

Ben,

I've incorporated changes for #8 and #9. Please review the changes and let me know your feedback.

Regarding "Site Config" file path, there was an issue in initializing fck-editor as the xml/css paths in js were referring to "includes" folder. So I have moved site_config files to "includes" folder.

Also, I did not get your point #2 (in #9) about saving component id in database. I believe it needs to be done in content manager form. Please confirm this.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

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

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

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,

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

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)

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

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,

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,

Thanks for clarifying. I do believe it would be best to proceed with #1 as proposed above, and make the Blog Management page consistent with the Content Management framework, as I do anticipate adding more features to the Blog page as we go along. Specifically, I expect that we will want to integrate some of the "Page Component" functionality with the Blog Posts in the same way that we are doing with the Content Pages (although not all of the components).

I do realize this will require a number of changes to the Blog table structure, etc., and that it will require some time to implement those changes when we get to them (to allow multiple page components for blog posts) but hopefully it will not present too much of a problem, and converting the blog functionality over to the same content framework should help with that process.

Thanks. (And it's fine, of course, to bill me for the time it takes to convert the blog to the content manager framework -- I consider that part of our learning curve and worth the time / money.) Posted by Peskoe Ben(unfuddle username: bpeskoe)

Battler45 commented 4 years ago

Ben,

I've started working on adding "Categories" tab on the "Blog Management" page. I've already implemented stored procedures and data access methods for the same. I am currently working on implementing UI part of it. However I'll need your inputs before proceeding on the same.

When the "Blog Management" page was implemented, we didn't have the existing client-side framework so all processing of this page is currently handled on server-side. This will make it a bit complex to add a new "Categories" tab in the sense that synchronization between two tabs will have to be managed on the server-side. Since this tab is only going to be used by the "admin" users for now, we can go ahead and implement it.

The other alternatives are:

1 -- to change the "Blog Management" page implementation such that all processing is handled by the client-side javascript framework. This will make it very similar to the "Content Management" page implementation and we can add as many features that require client-side processing. We should do this if this page is going to be having a few more such features in the future.

2 -- to implement a new page for "Category Management". This will make it a bit odd as you (administrator) will have to navigate between two pages but this will make it easier to synchronize changes when a new category is added/existing category is removed.

Please let me know your thoughts on this.

I've a query in workflow - when a category is deleted, do we need to validate if blog posts in other sites are referencing the category and send an email to admin? I guess it is not required in this case but just wanted to confirm.

Thanks Posted by Shah Vihang(unfuddle username: vihang)

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)