News for hackers. Stuff that matters.
Re:Fixie.js - Automatic filler content for HTML documents. by duopixel on Thursday May 03, 2012 @12:01AM (#3922325)
I dislike using lorem ipsum or other non-sensical text for mockups, but I admit that it fills a very real need for designing content-centric websites when the content isn't ready yet.

I've encountered just too many cases where the design looks great as a mock-up but when you start plugging in real data the layout start breaking apart, either because the content is too short, too long, or the designer didn't consider long usernames.

My dream for a filler content generator would be a large database of real content types, so you would have a list of real twitter handles, facebook names, blog post titles, world news articles and so on. You could then do stuff like h1 class="fixie worldnews title" or class="fixie twitter username".

Designers often argue that the purpose of Lorem Ipsum is to help the client focus on the look and not the content. I think this posture is wrong because you need the client thinking about content as early as posible.

Front-end developers also need the randomness of real world data to test the sturdiness of their layouts and account for edge cases as early as posible.

Re:Fixie.js - Automatic filler content for HTML documents. by wattjustin on Thursday May 03, 2012 @01:50AM (#3922545)
If we can get Samuel L. Ipsum integrated, I'm in. Either way, I think this is great if for no other reason than the amount of time it will save.
Re:Fixie.js - Automatic filler content for HTML documents. by splatzone on Thursday May 03, 2012 @06:56AM (#3923171)
Would you object if I tried to implement this? Seems like a fun weekend project.
Re:Fixie.js - Automatic filler content for HTML documents. by duopixel on Thursday May 03, 2012 @10:45AM (#3924042)
No objection at all, I'd be willing to design the landing page if you come around to implementing this :)
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @12:05AM (#3922330)
Agreed, lorem ipsum can become a crutch - good copy is integral for good design. That said, this script will give you random length paragraphs, articles, and what not, giving you some room to test your layout, and makes it easy to throw in temporary content until you've written something yourself.
Re:Fixie.js - Automatic filler content for HTML documents. by stephenhandley on Thursday May 03, 2012 @12:18AM (#3922361)
awesome. maybe an alternative api would be to allow for something like

  fixie.init([".array", "#of .selectors", ".that", ".should", "#be .populated .with .lorem"])
or just a string like

  fixie.init(".string, #of .comma .separated .selectors, .that, .should, #be .populated .with .lorem")
I think that would address the class proliferation issue and still be explicit about which dom nodes should be populated. easier to maintain / comment out.
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @12:25AM (#3922375)
Nice! I added it as an issue just a second after you.

I'll definitely give it a try, though I invite anyone else to send a pull request.

Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @07:37AM (#3923304)
This is fully implemented now. Woohoo :)
Re:Fixie.js - Automatic filler content for HTML documents. by JohnnyFlash on Thursday May 03, 2012 @04:16AM (#3922879)
This would be so much more awesome if you could assign the class to a container div. Then on each page reload it would randomly add content - be it paragraphs, headers, imgs, lists, tables etc.

This would be a fantastic tool for testing templates against a wide variety of random content. When making a template for clients to use you can never be too sure what they are going to add so you do your best to style everything. Getting random content on each page load would really solidify this testing.

Adding a class to individual elements... I don't find this too useful.

Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @02:25PM (#3925053)
You can now assign the class to a container div - you must still provide some empty tags to specify what kind of content you want.

For example, if you need a couple paragraphs of text, you can use `<article class="fixie"></article>`. If you need exactly 1 header followed by 3 paragraphs, you can use ``` <article class="fixie"> <h1></h1> <p></p> <p></p> <p></p> </article> ```

Re:Fixie.js - Automatic filler content for HTML documents. by kwamenum86 on Wednesday May 02, 2012 @10:57PM (#3922186)
Depending on what browsers you're supports it's probably far easier to use generated content (:before, :after). Maybe combined with calc or CSS expressions.
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Wednesday May 02, 2012 @11:26PM (#3922246)
Sure, but it's hard to get a variety of content in that way. If you have a paragraph that begins with lorem ipsum over and over again, you'll quickly notice.
Re:Fixie.js - Automatic filler content for HTML documents. by taitems on Wednesday May 02, 2012 @11:33PM (#3922269)
Then add some :nth-of-type() wizardry to it.
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Wednesday May 02, 2012 @11:45PM (#3922294)
Good point.

While there are some situations where that makes more sense, doing that for things like paragraphs is kind of silly - you're just moving junk copy to your CSS. You either have a giant CSS file, or some rather repetitive paragraphs.

Re:Fixie.js - Automatic filler content for HTML documents. by raingrove on Thursday May 03, 2012 @01:54AM (#3922563)
I like how the words generated are totally hipster!
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @07:42AM (#3923332)
Thanks! It's actually kind of funny how small the dictionary is...
Re:Fixie.js - Automatic filler content for HTML documents. by juddlyon on Thursday May 03, 2012 @10:36AM (#3924009)
Great idea!

I'd use this on client projects if:

- I could pass a selector rather than adjusting my markup (maybe I can add 'fixie' via jQuery?)

- There's an easy way to swap out the word list - I've had Bacon Ipsum, Hipster Ipsum, and Gangster Ipsum all slip through before and it's embarrassing (depending on the client).

Re:Fixie.js - Automatic filler content for HTML documents. by SirensOfTitan on Wednesday May 02, 2012 @11:41PM (#3922283)
Very cool. However, I don't particularly like the fact that I need to add a class to each applicable container.

Maybe a configuration file that allows for selection of specific classes/ids instead?

Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Wednesday May 02, 2012 @11:45PM (#3922296)
Now you can use a specific class instead. Just call fixie(myclassname);
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @07:42AM (#3923331)
This has been replaced by `fixie.init(["CSS-selector"]);`
Re:Fixie.js - Automatic filler content for HTML documents. by nXqd on Thursday May 03, 2012 @09:07AM (#3923654)
I don't this is a good idea. Because even if you want quick design but later you will have to fix them all. And nowadays designers are familiar with html ( the most basic skill ). But it's nice btw
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @09:09AM (#3923661)
The point isn't to write content for you - it's to automatically add temporary content so you can test out your design before writing copy.
Re:Fixie.js - Automatic filler content for HTML documents. by minikomi on Wednesday May 02, 2012 @11:54PM (#3922314)
Thought this might be something like http://jsfiddle.net/MNFV8/1/ but I like the addition of the paragraph generators too.
Re:Fixie.js - Automatic filler content for HTML documents. by teuobk on Wednesday May 02, 2012 @10:36PM (#3922145)
This looks pretty cool. It would be a great companion to http://placehold.it (which fills a similar role for images).
Re:Fixie.js - Automatic filler content for HTML documents. by dag11 on Wednesday May 02, 2012 @10:56PM (#3922183)
It uses placehold.it, actually: http://ryhan.me/fixie/sample.html
Re:Fixie.js - Automatic filler content for HTML documents. by abrichr on Wednesday May 02, 2012 @11:34PM (#3922271)
I can't remember the number of times I've wished for something like this. I'll be sure to check it out for the next web project :)
Re:Fixie.js - Automatic filler content for HTML documents. by kailashbadu on Wednesday May 02, 2012 @11:34PM (#3922272)
Like it. The only nuisance is the class attribute you have to repeat across all tags that you need to fill in.
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Wednesday May 02, 2012 @11:41PM (#3922285)
On a side note, you can now change the class name to whatever you want (thanks Luke Holder via github).
Re:Fixie.js - Automatic filler content for HTML documents. by eskimoblood on Thursday May 03, 2012 @08:48AM (#3923591)
Re:Fixie.js - Automatic filler content for HTML documents. by jberryman on Wednesday May 02, 2012 @11:42PM (#3922287)
What is the better alternative?
Re:Fixie.js - Automatic filler content for HTML documents. by kailashbadu on Wednesday May 02, 2012 @11:54PM (#3922315)
don't know. But the smart folk behind should be able to figure something out.
Re:Fixie.js - Automatic filler content for HTML documents. by tolmasky on Thursday May 03, 2012 @12:00AM (#3922322)
Just auto-filling all <p>'s and <h_>'s might be an interesting option. You could also have the API allow you to list tag names to be auto-filled. It can even be smart and first check whether the tag in question already contains text content, and if it doesn't, only then auto-fill it.
Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @07:41AM (#3923322)
Nice suggestion. I made some modifications so this is the new behavior. Child elements are targeted, and content is never overwritten.

``` <div class="fixie"> <p></p> <p>Hello <a></a></p> </div> ``` The above will cause only the first `<p>` tag to be filled, and the `<a>` tag.

In addition, you can now use `fixie.init(["CSS-selector"]);` to target arbitrary tag names, class names, and ids. If the tag in question contains text content, it will not auto-fill it (though it will auto-fill children, if need be).

Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @12:06AM (#3922332)
I considered doing that, but the problem is that I've noticed that some people use <p> tags as breaks between paragraphs. Requiring a class makes sure that the developer/designer knows where their filler content is going.
Re:Fixie.js - Automatic filler content for HTML documents. by grey-area on Thursday May 03, 2012 @04:09AM (#3922868)
If you're going to require classnames anyway, it might be more flexible to use those to define the type of content to insert. Personally I'd prefer adding a simple bit of js to a page to define the fixie behaviour, something like :

  fixie.fill('.my_header_class','head');
  fixie.fill('#my_id','paragraphs');

etc, as otherwise I have to have a special layout with lots of 'fixie' everywhere and perhaps a special structure using certain tags in order to use the js, and can't define what sort of content goes where except by changing the type of html element which contains it.

I'd prefer to start with an html document which has already been made, and consider how to add fixie to it in the least obtrusive way - and how to remove it later when it was not required, without impacting the document structure or classes etc at all. So if I can add a bit of js which adds fixie in an unobtrusive way to any existing page, and then remove it by simply commenting out that js, that would be preferable to having to set up a special template just to use fixie, or having to consider fixie use from the start. Fixie should really IMHO adapt to the html it is used on, not force that html to be adapted to it.

Re:Fixie.js - Automatic filler content for HTML documents. by rthprog on Thursday May 03, 2012 @07:42AM (#3923327)
As mentioned elsewhere, this is now implemented as `fixie.init(["CSS-selectors"]);`
Re:Fixie.js - Automatic filler content for HTML documents. by icanberk on Thursday May 03, 2012 @04:19AM (#3922885)
yep, we added fixie.init(query); functionality. coming up soon.
Re:Fixie.js - Automatic filler content for HTML documents. by franciscoapinto on Thursday May 03, 2012 @11:17AM (#3924180)
Won't work with javascript disabled, obviously. This makes it unusable for me.