Modifying/Extending the Links 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.
7/9/2009 2:10:04 PM
Gravatar
Total Posts 3

Modifying/Extending the Links module

I have just started playing with mojoPortal in the last couple of days. I like it a lot, though i have A LOT to learn yet.

One thing i would like to do is modify the Links Module to use Peter Bromberg's WebSiteThumbnailControl (http://www.eggheadcafe.com/tutorials/aspnet/b7cce396-e2b3-42d7-9571-cdc4eb38f3c1/build-a-selfcaching-asp.aspx) instead of WebSnapr. If i were building this on my own, i'd simply modify the CreateLink method in the CodeBehind to something like this:

protected string CreateLink(
string title,
string url,
string description,
string target)
{
string img = "GetSiteThumbnail.aspx?su="
+ GetLinkUrl(url)
+ "&sw=1024&sh=768&tw=200&th=125";
String link = "<a class='" + linkCssClass + "' href='" + GetLinkUrl(url) + "' "
+ GetOnClick(target)
+ GetTitle(title, description)
+ ">"
+ "<img src='" + img + "' />"
+ title
+ "</a>";

return link;
}

But I believe all the CodeBehind is tucked away in the mojoPortal.Features.UI.dll. Is there a way to override this? i tried adding Links.acsx.cs to the LinksModule folder, but that didn't do anything.

I am hoping you can give me some direction. i'm still trying to wade through the developer documentation, but as i am a hobbyist, rather than a professional programmer, it's a bit heavy going. If you can point me in the right direction or to the particular articles that would help me out, i would be most grateful.

As far as tools go, I do most of my building in Visual Studio Express, and it covers my needs most of the time. I have a copy of Visual Studio 2005 Standard (not currently installed). If I need to install VS2005 or get additional software, please let me know.

Thank in advance for your help and for developing what looks to be a really good product.

Steve
 

 

 

 

7/10/2009 12:52:47 PM
Gravatar
Total Posts 18439

Re: Modifying/Extending the Links module

Hi Steve,

That would be great if you would like to try and implement that, I'm not really wild about the websnapr thing myself, it was easy to do but if you go beyond 100,000 impressions they want to charge for it. It would be much better to be able to do it without the service. 

You should be able to work with the mojoportal source code using VS Express 2008 SP1. It sounds like you have the pre-compiled deployment files rather than the source code, you should download the source code to get the full VS solution.

You can send me any modified or new files at joe dot audette at g mail dotcom

If all else fails this looks pretty trivial to integrate so I could do it myself. 

Best,

Joe

 

7/10/2009 4:34:59 PM
Gravatar
Total Posts 3

Re: Modifying/Extending the Links module

Hi Joe,

Thank you for the words of encouragement.

I have both the pre-compiled deployment files and the full source code. I'm just not sure what to do with the source code now that i have it.

I'm trying to follow the directions in the Deployment documentation. I immediately ran into a problem, that being the instruction to open mojoportal-complete.sln. (http://www.mojoportal.com/developinginvisualstudio.aspx) I don't have that file. I have mojoportal.sln, mojoportal-core.sln, mojoportal-mvc-experimental.sln, mojoportal-plus-silverlight.sln, mojoportal-silverlight-blend.sln, and mojoportal-plus-silverlight.vsmdi. I don't know which of these to use instead.

I tried using mojoportal.sln (after saving a copy to a different name) and did manage to get a barebones (no CSS applied) version of the application running and using the little bit of data I added using the pre-compiled version. Unfortunately, the changes I made in the mojoPortal.Features.UI project do not show up, even those the solution build went through without a hiccup.

Perhaps it would be best if i told you how i have made this work in a MUCH simpler application of my own design and you can either try it out for your next build or lead me in the right direction.

  1. Add a "Thumbnails" folder to your application root.
  2. Download the website thumbnails code from http://www.eggheadcafe.com/tutorials/aspnet/b7cce396-e2b3-42d7-9571-cdc4eb38f3c1/build-a-selfcaching-asp.aspx
  3. From the ThumbnailsWeb folder of the download, copy the "bin" folder and the GetSiteThumbnail.aspx and GetSiteThumbnail.aspx.cs files to your application root.
  4. Add references to the two DLLs you just added: ThumbnailWeb.dll and WebSiteThumbnailControl.dll.
  5. Add the following assembly: <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> to the web.config.
  6. Change the CreateLink method as described in the original message. (My code is structured differently, but this is the equivalent and should yiield the same results.)

That worked for me. If you find the thumbnails too big, change the sizes in the "tw=200&amp;th=125" portion of the query string.

I know i'm just missing something that's probably obvious to you, and i apologize for my newbie ignorance.

Again, thanks for a great product and for any help you can throw my way.

Steve

 

 

 

7/14/2009 2:32:46 PM
Gravatar
Total Posts 18439

Re: Modifying/Extending the Links module

fyi, I implemented an http handler today based on this that can generate the image, now all I need to do is implement the javascript balloon hopefuly I can find some jquery for that.

Have a feeling this thing won't work in medium trust hosting but have not tested yet to confirm it, we shall see.

I'll post again once I've got it working in the links feature.

Best,

Joe

7/14/2009 5:03:03 PM
Gravatar
Total Posts 3

Re: Modifying/Extending the Links module

I didn't even consider the trust issue.

I've done a little testing on my own app, and i think you are right.

If you can think of a work around, please let me know.

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