How to use Sizzle CSS selector engine? - sizzle

I don't know how to use Sizzle so how can i use it?
Please provide me some example code.
Thanks,
jakobaindreas11
P.S. I always do questions like these

Basically, all you need to know is this:
Sizzle("selector");
Sizzle supports almost all CSS3 selectors.

Related

How to use Markdown and Handlebars together?

We are using NodeJS + Express + Handlebars and it works just fine. Now we wont to use Markdown for our documentation. I looked for several days to find something I can use, and the best choice right now is mix of those packages
https://github.com/tj/consolidate.js
https://www.npmjs.com/package/marked-engine
and than register new app engine
app.engine('md', require('marked-engine').renderFile);
The main problem is that I can't use my handlebar layouts with this, so it would be great if there is another approach which would allow me to render Markdown inside handlebar layouts. And I would like to achieve that without Asemblio, Grunt or anything similar if it is possible.
Thank you in advance,
Jovan
This is a tipical use case for a filter in template engines like handlebars. So a fast google search for filters in handlebars lead me to this npm package. And a quick look to the docs show this
{{filter "## Hello *World*!" "markdown"}} → «<h2>Hello <em>World</em>!</h2>»
So maybe this is exactly what you are looking for, in case that this won't work, you should still look for filters, thats the way to go for your problem.
PS: I haven't tested this particular package

MVC patterns with node.js with comon layout and partials

I am trying to apply mvc pattern (as in ruby) using node.js. I would like also to use a common layout and partials. I saw this post and I tried Locomotivejs, but I don't know how to apply a common layout and partials with Locomotivejs. Should I use another frameworks? if I should, which one has all these features? Could you please give me some suggestion?
You can see what I did in order to solve that problem with locomotive.js here:

Removing searchresult from other languages in expression engine

I want to remove search result that is not pointing to the current language code.
I have expression engine 2.5.3 and using the Multi language 2.0 module and the built-in search engine.
This will remove those results but will mess up the pagination.( Some page got 1 result, another has 10 results... )
{exp:search:search_results}
<?php if(get_langcode_from_url('{page_uri}') == "{country_code}"){?>
<div>{title}</div>
<?php } ?>
{/exp:search:search_results}
Is there a better solution to this? I prefer not to buy any modules if it's unnecessary.
Was hoping someone would have a better answer for this but as no one has answered...
Approaches to this solution I'd consider:
Roll your own pagination.
Somehow get your results limited at a higher level so native pagination would work. There is a thread about this in the module's support forum.
Disguise your pagination issues by loading them a little differently. Maybe something like Infinite Scroll could help? Not free but not too dear either.
If you've arrived at your own solution by now I'd love to hear it. Multi-language support is the next big thing on the to do list for us.

I need to have "profile url" functionality in my jsf application, is there any way apart from filters I can achieve this?

I need to have "profile url" functionality in my jsf application, is there any way apart from filters I can achieve this?
For ex:
www.website.com/dan.thomas should take me to the Dan Thomas`s page
I can not use filter to achieve this.
I can not use filter to achieve this.
Then it stops here. There are no other ways. You might consider to reformulate the question to solve the concrete problem why you cannot use filters for this, at least, if it's actually a programming problem.

Form validation in addition to YUI

I'm in the process of adding some much needed client side form validation to a website I'm working on. We're currently using YUI. YUI doesn't have any form validation built in as I can see(prove me wrong).
I googled it
http://code.google.com/p/yui-form-validator/
It's not important that it's a YUI-extension as long as it plays along with YUI in a civilized manner.
What should I go for? Anyone out there with experience and an opinion?
There's a module in the gallery: http://yuilibrary.com/gallery/show/form
I haven't used it, but it looks pretty good to me.
Looks like we'll go for http://validatious.org/
Lightweight and standalone. Will not interfere with YUI.

Resources