Blog Summary Module

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/29/2008 12:25:16 PM
Gravatar
Total Posts 48

Blog Summary Module

Hi there,

I'm in the process of writing a Blog Summary module. This will be used in my case to display the top X titles and/or excerpts from a blog, along with an associated image. I've extended the blog to allow for the image url to be entered and saved with the particular blog post.

Obviously there could be a number of blogs on a site and each could have it's own Summary on the home page... Currently I mouse over any blog post title and look at the bowser status bar to give me the ModuleID "mid=34" of that particular blog, which is then entered in to the blog summary settings and is used in the sql query.

I have two questions about the above i was hoping somebody could help out with:

1. Is there a quick way of grabbing all the mid's of a particuar feature built in to mojoportal already, which i can use in the settings? e.g. a dropdownlist

2. The Excerpts that are stored in the blog by default grab X number of characters from the Description string including html markup... I know from past experience that this can lead to open tags with no closing tags, and also partially formed tags, both of which can cause layouts to fall apart.  I just wanted to know if there was a reason for storing the markup? I've had to use a regExp to strip out the markup to avoid the above problem.

Thanks in advance for any help

4/30/2008 12:25:45 PM
Gravatar
Total Posts 18439

Re: Blog Summary Module

Hi,

1. Nothing already built for that. I would select from mp_Modules by FeatureGuid column, passing in the guid for your custom blog.

2. Yeah the excerpts thing was not well implemented and not sure its even used anywhere. There is a helper function you can use to remove the markup when creating the excerpt, mojoPortal.Web.Framework.SecurtyHelper.RemoveMarkup. Then you still will want to make sure it doesn't truncate in the middle of a word.

Hope it helps,

Joe

5/1/2008 11:25:52 AM
Gravatar
Total Posts 48

Re: Blog Summary Module

Hi Joe,

1. I'll look in to using the guid, not 100% why one would use it over the ModuleID? "34" is easier to use than "c285fc1f-0118-40c0-945c-900d85f78850" lol

2. Thanks fot the RemoveMarkup tip! Worked a treat! It got rid of the regular expression and tidied up the code.

I'm not bothered about it truncating in the middle of a word as the module allows for X number of chars then adds an ellipsis on to the end of the string if it exceeds X chars, signifying that there is more text available.

Thanks again,

Reiss

5/1/2008 11:39:55 AM
Gravatar
Total Posts 18439

Re: Blog Summary Module

Hi Reiss,

The alternative to featureGuid is ModuleDefID not ModuleID.

The reason you should use the featureGuid is that it will be the same across installations whereas ModuleDefID will vary. So hard coding a moduledefid will be a problem but hard coding a featureGuid will not.

The guid must be defined in the /Setup/applications/applicationname/FeatureDefinitions/whatever.config file that is used to install the feature. You shoud make sure it is unique (ie not copied from another feature).

The ModuleDefID is just an id incremented by the db so it may vary according to the order in which features are installed.

Best,

Joe

5/1/2008 12:44:54 PM
Gravatar
Total Posts 48

Re: Blog Summary Module

Hi Joe,

As far as I am aware you can't just link to a blog post like:

http://www.mojoportal.com/BlogView.aspx?ItemID=358&mid=19

So is it ok to always use page 1 when generating the link e.g.

Actual link:

http://www.mojoportal.com/BlogView.aspx?pageid=2&ItemID=358&mid=19

Generated link to post:

http://www.mojoportal.com/BlogView.aspx?pageid=1&ItemID=358&mid=19

Hope that makes sense lol

Thanks,

Reiss

 

5/1/2008 3:47:10 PM
Gravatar
Total Posts 18439

Re: Blog Summary Module

You "should" pass the correct pageid.

Actually the best solution would be to implement friendly urls in the blog that map to the real url with query string params. I plan to implement this in the mojo blog when I get a chance but you could do it in your custom one.

There are already code examples for creating friendly urls as in PageSettings so that part is easy enough. It would require adding a field to the blog table for the url so it can be used in the blog's internal links. So the url could be the title of the blog with spaces replaced by dashes and then removing any non alpha chars besides the dashes. I'd probably lower case it to so it might be like /3rd-skin-of-10-completed.aspx which would map to a real url like /BlogView.aspx?pageid=2&ItemID=358&mid=19

This would make it easier to get the correct url in your blog summary feature as well without having to worry about pageids.

Hope it helps,

Joe

6/13/2011 10:00:44 PM
Gravatar
Total Posts 192

Re: Blog Summary Module

hi atwork8, can I have the extended blog, and the summary module?

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