Pages

Showing posts with label design tools. Show all posts
Showing posts with label design tools. Show all posts

Thursday, December 10, 2009

"Hybriding" in Kentico

In this article I will introduce a new approach I have been using in Kentico configurations. This particular case involves a slider I configured for the LiveAir Networks site. The task seemed pretty straightforward in the web 2.0 world. I wanted to create a billboard banner for a home page that rotated through slides that included photos, graphics text and an action button. Of course, the site is in Kentico CMS and best practices would dictate that the slides be editable and configurable and html text would be nice for SEO. The first option that came to mind was data driven flash. I have done a similar thing with xml datadriven flash - http://tinyurl.com/ycvnpw6 . My problem in this case is that the client wanted to avoid Flash for a variety of reasons. The next option I looked at was one of the really nice sliders available in the MooTools or JQuery library. The problem with this approach would be making it easily editable by the user. After some serious brainstorming I came up with an approach which I will dub"Hybriding". In this approach I used native Kentico Webparts, CSS and Graphics to produce the results. What I am about to explain is how I ended up with the banner that went on the site's home page - http://tinyurl.com/liveair.


[screenshot of page]

The Web part I chose for this task was the Scrolling Text Web part. That may sound confusing, since there are graphics in this configuration. The reason I chose this over the image slider was to have easily editable text. It is possible to configure this control to any size you want, so all I had to work out was getting the photo image and the action button in.  I configured the Web part to show the Document type CMSArticle, the reasons for that will become apparent. I knew what size the container had to be so I wrote a Custom Transformation which I named CMS.Article.ScrollingPreview and a Web part container which I named Banner
Slider.

I took a look at the code for the default Article transformation:


 <h1>
<%# Eval("ArticleName") %> </h1>


<%# IfEmpty(Eval("ArticleTeaserImage"), "", "") %>
<%# Eval("ArticleText") %>


Then in the CMS Site Manager I built the new one:



<div style="background: #fff url(<%# GetFileUrl("ArticleTeaserImage") %>) top left no-repeat; height:250px; width:565px;">
<div class="scrollingpreviewtxt">
<h2>
<%# Eval("ArticleName") %></h2>
<p class="content"><%# Eval("ArticleTeaserText") %></p>
</div>
<div class="buttonimg">
<%# Eval("ArticleText") %>
</div>
</div>


As you can see to get the photo graphic in I use an outer div with a background image which I pulled as the Article Teaser Image. I used inline style for this so that I could put the macro in the style - I wasn't sure this would work, but it did. Now the user can edit the image. Of course I had to build special images with white space for the text to fall on to with a nice fade effect.  Next comes an inner div to hold the title and text, all of which get their styling from the CSS already in place. The CSS for the transformation is:



/*#Transformations/Scrolling Preview#*/

.scrollingpreviewtxt /*inner div to hold the text*/
{
width:240px; 
height: 220px; 
padding-left: 20px;
}

.buttonimg /*the button*/
{
position:relative;
bottom:10px;
left: 435px;
width: 85px;
height: 30px;
background:transparent url(/App_Themes/liveair/images/reg_button.png) top left no-repeat;
padding-top: 7px;
margin:0;
float:left; 
text-align:center;
font-size: 12px;
font-weight: bold;
}

.buttonimg a, .buttonimg a:hover /*needed to add this to the button hover - it inherited the rest*/
{
font-weight: bold;
}


One sneaky thing I did was using the Teaser text of the Article for the text in the body of the slide and the
Article text for the text in the button, wrapping it in the buttonimg div to make it an action button. Now the
client has a slider that they can edit the text, image and button text on from an easy form interface and easily
add slides from the CMS desk. How cool is that!






To hold it in place and give it a border a simple Web part container containing this div id:



#photobox
{
position:relative;
top: 0;
left: 20px;
width: 565px;
height:250px;
margin: 0;
background:#eeeeee;
border: 2px #cccccc outset;
padding: 0;
float: left;
clear:both;
} 

All set!
Later I will do a post on a "hybrid" control using the native Kentico repeater wrapped in some Mootools javascript to create a slider with navigation buttons and text with links, then on to configuring JQuery UI for CMS desk editable tabs populated with articles. Stay tuned!

Thursday, April 30, 2009

TWO GREAT UTILITIES FOR WEB BUILDERS - PT 1

I have previously outlined my general workflow for designing and building websites. I take a pretty "hands-on" approach. This being said I would like to share a couple of powerful utilities that I use on every web project and have found to be invaluable in terms of saving time and keeping the quality of my work high. Both are available in both free and commercial versions. I think knowledge of these could benefit anyone involved in building and/or maintaining websites.

Irfanview - The Great Little Image Utility With the Funny Name

The first tool addresses the issue of image management. The scenario I will address as an example is this one. You have your design, the client gives you a disk or sends you several emails of various pictures to use, usually full size digital camera or scanned images. Now comes the task of re-sizing and optimizing these images to work in the website. If there are a large number of images involved, this is a time consuming and repetitive job that I hate to bill to my clients at full rate. There area number of shortcuts, but they usually yield less than optimal quality and dependability. The solution? Irfanview (pronounced ear-fan-view). The powerful little program with the funny name. Below is a list of some of Irfanviews many functions.

* Many supported file formats (the list is too long to include here.)
* Multi language support
* Thumbnail/preview option
* Paint option - to draw lines, circles, arrows, straighten image etc.
* Toolbar skins option
* Slideshow (save slideshow as EXE/SCR or burn it to CD)
* Show EXIF/IPTC/Comment text in Slideshow/Fullscreen etc.
* Support for Adobe Photoshop Filters
* Fast directory view (moving through directory)
* Batch conversion (with image processing)
* Multipage TIF editing
* File search
* Email option
* Multimedia player
* Print option
* Support for embedded color profiles in JPG/TIF
* Change color depth
* Scan (batch scan) support
* Cut/crop
* IPTC editing
* Effects (Sharpen, Blur, Adobe 8BF, Filter Factory, Filters Unlimited, etc.)
* Capturing
* Extract icons from EXE/DLL/ICLs
* Lossless JPG rotation
* Unicode support
* Many hotkeys
* Many command line options
* Many PlugIns
* Only one EXE-File, no DLLs, no Shareware messages like "I Agree" or "Evaluation expired"
* No registry changes without user action/permission!
* and much much more


To be honest I have never found the time to explore all of Irfanview's capabilities,but the ones I have tried worked well. Today I will be discussing using batch processing to take the clients picture files and convert them to use in a website. I create a directory, usually with 'websize' in the name and then open Irfanview. When you first open Irfanview you are presented with a simple user interface, with a screen for single images or movies.



On the file tab in the menu, you select 'Batch Conversion/Rename' or you can just press the B key on your keyboard. You will be presented with the dialog shown below.


Choose a Function - In the top left corner of the dialog you select the function you want to perform. A batch conversion will convert files to a specified format and will also perform other functions in the process; such as resize, optimize, sharpen,watermark, etc. More on that in a moment. Batch rename can rename a group of files and allows the setting of a naming pattern and the ability to serialize the names. This can be handy for making groups of images you use conform to your own naming conventions without having to keep track of doing individual files. It is also real handy for loading gallery applications that load using file names/directories. The last of the three choices combines the first two functions.

Choose Your Files and Output Directory - On the right side of the dialog is where you can navigate to the working directory and choose the files you wish to work on. You can do the selecting and sorting in this dialog or you can just open a folder and select and drag and drop the files you want to work with into the bottom left box on the dialog. To preview files you have added in the box, just select a file and it will appear in the image preview box on the left if you have the Show Preview image box checked. Or you can just press the P key on your keyboard. In this interface you can also move the files around or autosort them by different parameters to get them in order for serializing. By default Irfanview works from top to bottom.

Conversion Settings - On the left, under 'Batch conversion settings' you can set the Output format using the dropdown. Once you have selected your format you can click on the 'Options' button and you will be presented with choices specific to that format (jpeg/gif options shown below).


One of the coolest things here is the ability to set the filesize, using the RIOT plugin and the optimization is set automatically. To add other functions to your you click on the 'Advanced' button below the 'Options' button and you will be presented with the dialog shown below.


This is where the true power of Irfanview starts to show. You have a variety of options for setting resizing, cropping and resolution as well as make tweaks to the pictures. Usually I just use the resizing function, but the quality of adjustments made using this tool are quite high, of pro caliber (see the bottom of this article). When using settings here, pay particular attention to the MISCELLANEOUS choices in the bottom right corner. This controls overwrites and directory writing. You also have an option on the bottom left of this dialog to save settings (as and INI file) and to load settings you have previously saved. Another great time saver!

If you have selected a rename option in the 'Work as' section that will activate the 'Batch rename settings input. You can enter a name and then click on the options button which will show you the various settings you have available. It is all pretty self explanatory. One of my favorite features here is the ability to replace text in a file name - handy for versioning. Other than that, on the file management side, I usually have created a directory for the output and select Copy original/input files to output directory. I imagine most people would make the choice to keep the originals.



This brings us to the final choice in this flow, selecting the output directory. You can choose to input a directory manually (who does that anymore?), use the current directory (default),or Browse to choose your output directory.

With your images all loaded and sorted and all of your output options and your output directory select you are now ready to go. "Start Batch" or the S key on your keyboard and watch Irfanview work. The first time you do this you will be amazed at how fast it is. It reports its output as it goes and lists whether each conversion went okay and it gives a a little summary of files, errors and warnings at the end.



That is basic file conversion on Irfanview. I have used this utility for years and is has saved me untold man hours in putting together web projects. I also do photography and use it for renaming and optimizing proofs, renaming files for submission to editors and other task. As I mentioned before, Irfanview is free for non-commercial use and a license for commercial use is currently only USD $12.00, quite a bargain and well worth it to support Irfan Skiljan in his efforts to continue enhancements and improvements. This utility works on all current versions of windows, even 64 bit Vista. You can obtain Irfanview at http://www.irfanview.com/ .

Example: I have posted a couple of images for you to compare. The first if for the original image, a web image at 114 kb and the second is the same image, resized and optimized with Irfanview to 51k. You can view them in different tabs on your browser to compare or download them for comparison. This will give you and idea of the quality you can get with Irfanview.

Original

Optimized

Next up - JRuler!

Looky!