Skip to main content
This is a PHP function I wrote that helps simulating a drupal get form for Views Exposed Filters, it returns the exposed form array so you can theme it or alter it:


function _get_exposed_form($view, $display_id){
$view = views_get_view($view);
$view->set_display($display_id);
$view->init_handlers();
$form_state = array(
'view' => $view,
'display' => $view->display_handler->display,
'exposed_form_plugin' => $view->display_handler->get_plugin('exposed_form'),
'method' => 'get',
'rerender' => TRUE,
'no_redirect' =…
Read more
Friday, July 20, 2012
And this happens with Drupal too!

When creating a node that has for instance a field where you place the embedded code of a youtube video, once submitted the add form, on Chrome the video does not get displayed unless you refresh the page. Basically this is how Chrome prevents XSS attacks.

What i did to solve this momentarily ( workaround) is adding a Javascript refresh page condition on my template.php:



function my_theme_preprocess_html(&$variables) {
// on chrome we need to reaload the page so the uploaded video can be shown
// this is due how Chrome prevents XSS (cross…
Read more
Tuesday, January 24, 2012
The reason for this blog is to create a guide on how to install Drupal on a Linux Server ( I choose Ubuntu 10.04 amd64 LTS but any Linux distro will work just fine) but instead of using all the PHP packages bundled with this Linux distribution we will be using Zend Server which is an Application Sever built for  PHP by Zend.

So, once you have set up Ubuntu, let's login as the root user typing the following command:
    
    $ sudo -s

cool , now that we have all the privileges, let's add the Zend Server repository to our sources list by typing:
 …
Read more
Yesterday, I was working on a new requirement on a website I'm currently working on and the idea of it is make Drupal provide a Widget so anyone can copy/paste a single piece of HTML code inside a iframe and embedded that code anywhere, so providing ans iframe is not a big deal but of course the iframe will display inside it whatever comes from the source url you set for it, example:

<iframe frameborder="0" height="480" src="http://www.mysite.com/widget/"; target="_blank" align="center" width="360" scrolling="Auto"; bgcolor="#C9D3DE"> </iframe>

In this case "src" retrieves…
Read more
Node referencing has been a great concept when working with Drupal content, it helps create complex references between nodes and it has been widely used, for example when you create a Photo Gallery. Having a Photo Gallery is pretty easy in Drupal, you need a content-type that will handle the information of an album or gallery and another content-type that will handle the images information. Using Node References will attach those images to your Albums. How? using this module in Drupal 7:

References

Of course, by default you won't have a nice way to identify which of the referenced nodes…
Read more
Sunday, April 10, 2011
I got to say Wow! I have been working with Drupal for the past 4 years and translating content has been a difficult process not only when installing a site with different languages but maintaining that site and the translations. Now with Drupal 7 this tasks is becoming a pretty simple task thanks to 2 fully recommended modules:

Localization update

Localization client

Localization update module is now taking care of importing the .po files from translations project http://localize.drupal.org/ not only for the core files but the community modules installed on your system, automatically…
Read more
Monday, April 4, 2011
First Drupal 7 blog, first Drupal 7 install since it is available. Let's see how it goes, so far there are some modules i cannot yet get to activate, track field, location and gmap, not ready for D7! but the Media module looks pretty awesome to handle media on Drupal 7 and its plupload integration. The video below was added using this module. Well what can i say, so far so good Drupal 7!

I'll keep posting as soon as new features arrive!

Read more
Friday, February 18, 2011