You are hereModules

Modules


Creating custom facet block for Search Api Location module

Facets work fine and by design they narrow down the search results with each facet option you click. But what happens when you want to make them work differently. Some of that can be achived with changing opearator to OR in facet settings. But in this case with search api location module this doesn't work, not sure is it a bug or by design but I solved that with creating my own facet block.

Solr Search Api, search Title as fulltext and sort as string

Currently if you use SOLR for search and deploy it with search API module you can index Title field as fulltext so you can make better use of it and find parts of it when searching. But then you can't sort by title in search api sorts module, what to do? Well use

Install xDebug with Sublime for Drupal (Mac, PC, Windows or OSX)

I'll try to make this quick. Installing xdebug for drupal is the same as installing it for anything else like wordpress etc

So what you need to do is to get xdebug to your php folder. This is different depending on system you use, for example OSX has it already when you install MAMP so you will just need to enable it. Go to your php.ini file and find XDEBUG part and active it(remove comment from zend_extension) and add some lines below like, but probably would even work without them, maybe just include first line.

zend_extension=/usr/lib/php5/20100525/xdebug.so

Check if user is part of OG group

if (og_is_member('node', $current_group->nid , 'user', $account)) {

Seems that lates og_is_member needs 4 parametars when checking if user is part of the group, not 3 like it is written in most posts online, so you can get it like above.

FB connect - invite friends, no notification

If you are using FB connect module and its Invite friends submodule or making your own invite FB friends submodule (which is easy). You could probably get into a problem of having no notifications sent to user when you do click Invite in FB dialog box.

There are 2 possible reasons for that. One your app is missing the canvas configuration
Just add it from the your App panel in Facebook Developers. Currently it is in settings tab (4/2014) on link https://developers.facebook.com/apps/383569161782956/settings/

Views doubt: make a template or style in interface

Views has many options. You can change styling and structure of rows of data in interface of with templates. When I first started using views I choose templates, partly also because of not so much power in UI, but now you can do almost anything with UI. But after using UI, I would still recommend templates.

Database syncing over drush

This has been a long wish for me. Sync databases online and on localhost.

There is an add on for drush that does that
https://drupal.org/project/drush_sql_sync_pipe

Of course this didn't run smoothly and needed some extra config. First SSH didn't work correctly on connecting to remote server, and then MySql also had a problem with the same solution, they were both just needed to be added to windows enviroment, eniroment variables to be exact.

So

New Age sliders and carousel (Responsive)

After using views slideshow and jCarousel (and not so happy the way they work, mostly in theming department) there are new players in town and they are even responsive. Also easy to theme and easy to setup.

https://drupal.org/project/flexslider
https://drupal.org/project/owl-carousel

Flexslider is great for slideshows, they can even pull carousels but for great responsive carousels use the owl carousel. Just a note, owl for drupal is pretty beta, so you will need to use dev version and also use jquery update 1.8 version, otherwise you may end up with empty space in place of carousel.

No file found - get the file object in file upload validate function

I had a form without this "name" parametar, and without that parametar there is just no file object in validate function for file upload

$form['image']['file']= array(
'#name' => 'files[advert]',
'#type' => 'file',
'#title' => '

'.t('Add New Image').'

',
'#description' => t('Upload a file, allowed extensions: jpg, jpeg, png, gif'),
);

and then you can get it in validate function like below with 'advert'

function item_validate($form, &$form_state)
{

Tableselect Form API - How to delete/edit selected rows from tableselect

To delete/edit selected rows from tableselect and have something to work in in form_state you should add keys to your array in your form like:

$rows = array();
foreach($fullList as $line)
{
$rows[$line->category] = array(
'tid' => $line->category,
);
}

This way you will be able to easily retrieve values on your submit/delete handler on $form_state

foreach ($form_state['values']['table'] as $rows) {
$delete = db_delete('htb_if_categories')
->condition('category', $rows, '=')