Archive for category Web Development
SilverStripe Tips & Essential Modules
Posted by Terry Apodaca in PHP, Programing Languages, SilverStripe, Technology, Web Development on January 6, 2011
Along with all the greatness that comes with the latest version of SilverStripe 2.4, there are a few (sometimes several) Modules you should install along with your base SS installation. A few tips I would like to make before we begin is to First: always install ONE module at a time. Read it’s readme file and/or _config file to know what is required for installation. Sometimes you will need to copy some stuff from the module _config to your project _config. It might also tell you the order of installation needed if it depends on another module to work. Second: is to ALWAYS run yoursite.com/dev/build?flush=1 after each Module you install. This will make it much easier to debug if you find problems with an installation. THIRD: is once you get to a point where you are pretty comfortable with SS, I always install everything I can before I modify or create my Custom Templates/Themes. Most modules are developed by their maker on top of the default BlackCandy theme and probably look the best there too…so if you install some modules after you have already implemented a new Theme…you might have some debugging and layout fixing to do.

The very first Module you should upload is the DataObjectManager by UncleCheese. This module has always been great and it has only one [optional] requirement, and that’s to install the SWFUploadField Module. You didn’t need the SWFUpload, but it made uploading things so much better. Up until UncleCheese came out with Uploadify which in my mind makes SWFUpload obsolete. The good thing here is that if you have them all installed, the latest versions will check for Uploadify first, and if not installed, it will fall back on SWFUpload, and if that’s not installed, no worries…still works.
Install Order:
SWFUploadFile (I keep installed just in case)
DataObjectManager
Uploadify
The next Module is also from UncleCheese, and just about every website I go to and/or build has some sort of Photo Gallery. He has also come out with ImageGallery which also works wonderfully and seamlessly with the modules I listed above. In fact, since they are all by UncleCheese, you can guarantee he makes sure they all work and compliment each other. This newest version is very very feature rich…so much so you don’t want to fiddle around with using some jQuery plugin…because they are already there… you can pick and chose your settings!
Everyone that builds and/or runs a website should have some kind of stat tracking. The most robust and FREE is Google Analytics. I use to use one or the other that is listed in the Modules pages of the website. That was until Ty Barho posted an article on SSBits that gives a very good tutorial on how to: Quick & Easy Google Analytics with SiteConfig…and he’s right. This is a good tutorial to also get you started in creating your own Modules. Because you follow this…you can use it and extend it on any website you build.
I will be adding more to this as SilverStripe matures more and more. I am becoming a huge supporter of this framework and CMS. So much so that I have pretty much used only this for my clients since last year (moved away from WordPress or rolling my own in CakePHP or CodeIgniter).
Also, please let me know if you have other modules you use in pretty much every one of your SS installations. I’d like to try them out. I know there are several out there…especially on github that a lot of people don’t know about. Most notable is Andrew J Short’s module: MemberProfiles. I’ll get back to this module later on though…
One last thing I would like any and all SS developers to be aware of, is A _config.php Cheatsheet by Aram Balakjian. I highly advise you to read this and use as much of it as you can in your early stages of development. The dev portion of it is great!!!
MS Report Viewer Toolbar
Posted by Terry Apodaca in .NET, Code, HTML, JavaScript, Programing Languages, Web Development on September 8, 2010
I was working on a Web Application that required the use of Microsoft’s Reporting and Report Viewer. I have been use to using these together on a Windows Application and never had any issues with the Reports or the Report Viewer. But, come to find out, the Report Viewer Toolbar does not render properly on IIS 7.0. What’s even more silly is that when you are developing locally it renders just fine (I was using Visual Studio 2008). Nothing worked when I deployed/published to the web server:
![]()
< rsweb:ReportViewer ID="ReportViewer1" runat="server" AsyncRendering="False" Width="750px"> < /rsweb:ReportViewer>
Yep, images were missing from the toolbar as well as nothing really working at all. The toolbar uses images and JavaScript that is generated dynamically, using a call to “Reserved.ReportViewerWebControl.axd”. This is usually already completed for you when you add the control, and adds necessary references to your config files. You will usually find this:
< system.web > < httpHandlers > < add path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" validate="false"/ > < /httpHandlers > < /system.web >
One thing that has been left off the auto generate is something Microsoft messed up in the switch to IIS 7.0 from IIS 6.0 and you have to remember for this Report Viewer to also add manually:
< system.webServer >
< handlers >
< add name="ReportViewerWebControl" path="Reserved.ReportViewerWebControl.axd" verb="*" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/ >
< /handlers >
< /system.webServer >
IIS 7.0 will now understand that whenever a call is made to ReportViewerWebControl.axd it needs to route it to the Http Handler Microsoft.Reporting.WebForms.HttpHandler
Telerik RadChart vs MSChart (Microsoft)
Posted by Terry Apodaca in .NET, AJAX, Code, Design, Free Software, Technology, Web Development on August 19, 2010
We had a very large project that required some pretty intense charting of data…coming from an Oil and Gas company. So, you can only imagine the amount of data we had to massage and chart in some way, shape, or form.
We used a very nice set of controls for this project in Telerik. They are by far my favorite set of proprietary controls for the .NET Framework. The project was heavily built around these controls so it was only natural to want to keep with them. One problem…98% of the charts had to be Logarithmic. If you are not familiar with this…its when a charts Y Axis is equally spaced with labels dramatically increased (1, 10, 100, 1000, so on) instead of your normal Linear charting (1, 2, 3, 4, etc).
This presented a problem because the Telerik RadChart did not represent the logarithmic minor ticks and lines properly. They didn’t increase and scale the way they were suppose to. It’s hard to explain in words, so here is a screenshot:

The image above still shows a Linear scale even though it’s actually Logarithmic. Well, I searched all over the internet to see if this was just a bug in the Telerik RadChart control or if I was just doing something wrong. Turns out, Telerik knows (recently) about this issue and it has been logged. I added a reply to that thread (in the link) asking if there was any update on the issue…and as you can read there…they said they were not going to fix this. They did offer a workaround though…and here is a screenshot:

What they said to do was just remove the Minor Grid Lines and Ticks from the chart. Well, I had already done that as a temporary fix, but if you know anything about the oil and gas industry then you know how sensitive and important the data is. So, when we are charting their data it is very important to be as precise as possible. The minor grid lines were very important. (BTW, this is just test data in the images, so don’t worry about any issues about showing the clients stuff).
I did some more digging and searching because I really didn’t want to spend too much more time and/or money on this Charting need. I was very lucky too. I came across Microsoft’s latest Charting Controls (add-on to Visual Studio 2008). What’s even better is that as of VS 2010 and .NET Framework 4 it will be already incorporated so there won’t be any installation needed. It did take me about a day to configure, get the data bound to it, make it pretty, etc…but this was the solution I ended up using. And, it turned out to be a lot better…and much more visually appealing. Here is the final:

My only other option would have been some Flash solution or Silverlight. And if you know me very well, you know that I HATE Flash and/or Silverlight. This is one time I can say Hurray for Microsoft this time.
Undo-DiggBar and others…
Posted by Terry Apodaca in Code, JavaScript, Web Development on April 7, 2009
Nathan Smith over at Sonspring just reminded me of a great script to keep your site out of iframes and other mechanisms some sites use to pawn your content off as their own.
<script type="text/javascript">
/* <![CDATA[ */
if (window.location !== window.top.location) {
window.top.location = window.location;
}
/* ]]> */
</script>
Throw this inside your head tags and you should be pretty secure from having your content reused as someone else’s…etc. Thanks Nathan, for the reminder!
960 Grid System
Posted by Terry Apodaca in Code, CSS, Design, HTML, Web Development, XHTML on March 27, 2008
A wonderfully crafted and beautifully designed system to help any and all designers when it comes to Grid Designs/Layouts. Thanks for the awesome resource Nathan!!

