Adding string field to blog

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
4/26/2008 11:45:16 AM
Gravatar
Total Posts 48

Adding string field to blog

Hi there,

I'm trying to add an extra field to the blog, that takes a string like the title field. I've added the code to the various sections of the blog and the field in the DB. I manually added some text in to the DB field. When i click on edit blog the field i've added is populated by the text from the DB, however, when i try to update the blog i get the following error:

"parameter's name doesn't match cached parameters"

Can anybody point me in the direction of what else i need to change to get this to work? Also is there an easier way to add a field to the blog using one of the codesmith templates? Not 100% on using them yet.

Thanks in advance for any help

4/26/2008 12:24:13 PM
Gravatar
Total Posts 550

Re: Adding string field to blog

Hi

You must change in the following points:

1- mp_Blog_Update stored procedure in your database and add a new parameter for your new field.

2-UpdateBlog method in dbBlog:

SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_Blog_Update", 14);
sph.DefineSqlParameter("@ItemID", SqlDbType.Int, ParameterDirection.Input, itemId);
.

.

.
add new line for your parameter.

 

Hope help you.

Asad Samarian
 

4/26/2008 12:50:07 PM
Gravatar
Total Posts 48

Re: Adding string field to blog

Hi A.Samarian,

Thanks for that! I had already added everything including modyfying the stored procedure, however, I had missed changing the following line for "13" to "14":

SqlParameterHelper sph = new SqlParameterHelper(GetConnectionString(), "mp_Blog_Update", 14);

Thanks for pointing that out, it's working now

4/26/2008 1:11:20 PM
Gravatar
Total Posts 18439

Re: Adding string field to blog

I think you would be better of creating your own clone of the blog as an external project and using a different prefix for the stored procs and tables. I've done this before when one of my customers needed a custom blog. It basically copy paste, edit namespace and tables scripts, use a new guid for the feature guid and put all the files into a new folder.

The problem is by modifying the existing one you are basically forking the code and making it difficult for yourself when you want to upgrade mojoportal later on.

Best,

Joe

You must sign in to post in the forums. This thread is closed to new posts.