Fancy Zoom
Posted by Nils - 10/02/08 at 05:02:03 pmFancy Zoom is a great way of adding zoom capabilities to your website in a blink of an eye.
Javascript powered and cross-browser compatible.
Have a look at the demo-site!
To add fancy zoom to your site do the following easy steps:
1. Download Fancy Zoom over at cabel’s place
2. add upload the contents of the package to your webroot
3. add the following javascript files to your html pages:
4. enable the body to load the neccesary javascript stuff:
and you’re done!
from now on, every link to an image becomes zoomed. Even text-links to images!
thank you cabel for this great addition!
- Nils
acts_as_ferret on associations
Posted by Nils - 28/01/08 at 01:01:50 amJust before anyone else runs into this §$%&/, I’ll do a quick post:
Let’s assume you have a rails app, want to add full-text search via Jens’ great acts_as_ferret(ferret) plugin and you’d also like to have attributes from multiple models in ONE index. In this case you probably found the same resources on the net as I did:
- http://railsenvy.com/2007/2/19/ac….
- http://www.ruby-foru…
- http://blog.codefront.net/2006/12/04/adding-full-….
All of these are really great tutorials, with just a little flinch that I (!!) missed the whole day:
THEY all have one to one or one to many associations, but in any case do the cross indexation on the model which has exactly one associated row, with something like this:
class Book < ActiveRecord::Base
acts_as_ferret :additional_fields => [:author_first_name,
:author_surname]
belongs_to :author
###
def author_first_name
return author.first_name
end
###
def author_surname
return author.surname
end
end
I (!!) did the whole thing on the model which can have multiple associated items on it and (i know this may be a little embarassing) missed the following line, wondering how this could possibly work for ME in the first place, because of the magic-undefined-instance variable:
def job_title
return job.title
end
What you have to do is this:
def job_title
jobs.collect { |job| job.title }.join ' '
end
Note the plural in here - I’ll give you a sec - and now you’re probably laughing
So - as i said, just in case - I wanted to share this little secret with those people out there, beeing as rubber ducked as me.
cheers, Nils
Theme updates
Posted by Nils - 25/01/08 at 09:01:52 pmfirst geekery! *hooray*
also bevor man hier überhaupt ANFANGEN kann zu bloggen musste erstmal das Theme auf den aktuellsten hip-web-zwonull-mega-standard gebracht werden. Einmal mit Profis arbeiten ne?!
Falls jemand ‘mal von seinem Wordpress die Meldung bekommen sollte “Your theme is not widgetized” der folge einfach folgenden einfachen Anweisungen:
Eure sidebar sieht wahrscheinlich etwa so aus:
Um jetzt Wordpress’ großartige “Widget” Funktion einzubauen, fügt man folgendes einfach in die sidebar ein:
|| !dynamic_sidebar() ) ?>
und legt (falls nicht vorhanden) die datei functions.php im Theme-Verzeichnis an:
if ( function_exists('register_sidebar') )
register_sidebar();
?>
letztere teilt Wordpress mit, dass die sidebar Widgets unterstützt.
Von nun an, kann man unter “Presentation -> Widgets” einfach per drag and drop die sidebar konfigurieren, wie hier in unserem Fall zum Beispiel mit der wunderschönen, noch sehr leeren Tag Cloud.
cheers, Nils
Powered by WordPress with GimpStyle Theme design by Horacio Bella. Get Entries and comments.
