Latest posts

Browse topics

How to develop Native Drupal app using Drupalgap - Part 1: Custom Front Page Using views - Images and Date

There was a time when I was really eager to develop native Drupal app, back then I decided to stick with Drupalgap. Now, more than a year has already passed since, and I haven't achieved my goal (s) yet.

Until recently, I decided to finish works on native Drupal app I started back in 2014. Speaking of my app -  nothing fancy here, just my latest blog posts, with ability latter to extend functionality adding more native app features (geo location, for example) . As I like to call it - minimum viable product approach.

I installed DrupalGap module and all its dependencies on my site, I must admit I had some problems actually getting it alive, but they were more server related rather problems with module itself. In short I experienced problems with server permissions to upload files, so I had to install DrupalGap library manually (instead of a one click installation), and then turned out that DrupalGap is not very friendly with php 5.2. version, so I had to patch it a little bit.

Ok, when I was setup and mobile-application folder was created on my server, I straight went to explore how to get a front page for my app listing latest articles with images and date, and here is how I achieved it:

Custom front page for Native Drupal app using DrupalGap

For most of the documentation I followed on DrupalGap Docs. Almost all from written bellow is taken from DrupalGap documentation: Article Titles with Images and Image Lists. I modified a little bit views and .js file to achieve results I was looking for. It took me several hours to get this done, and hopefully I can spare you some time. For previewing my app online I installed Ripple Emulator (Google Chrome Extension) and disabled Cross Domain Proxy

App preview on Google Chrome Ripple Emulator

App preview on Google Chrome Ripple Emulator

​Creating Json Views for DrupalGap

  • Create a new view - Article Images
  • Set view to Json data document
  • Add fields: title, images, nid and post date

Preview your view:

{
  "nodes" : [
    {
      "node" : {
        "title" : "Tortuga Snack Bar in Portofino, Italy",
        "field_images" : {
          "src" : "http://www.reinisfischer.com/sites/default/files/styles/front/public/tortuga.jpg?itok=dgcNmioC",
          "alt" : ""
        },
        "nid" : "4407",
        "date" : "01/21/2016 - 00:22"
      }
    },

Next create a new custom module in your DrupalGap folder: (How to create custom module in DrupalGap)

  • In /app/modules/custom (you will have to create those directories as well) I created a new folder - front, in which I created new .js file front.js.
/**
 * Implements hook_menu().
 */
function front_menu() {
    try {
      var items = {};
            items['front'] = {
              title: 'Article Images',
              page_callback: 'front_article_images'
            };
     
      return items;
    }
    catch (error) { console.log('hook_menu failed - ' + error); }
}
 
/**
 * The page callback to display the view my_module_article_images.
 */
function front_article_images() {
  try {
    var content = {};
       
    content['my_articles_list'] = {
      theme: 'view',
      format: 'none',
      path: 'article-images', /* the path to the view in Drupal */
      row_callback: 'front_article_images_list_row',
      empty_callback: 'front_article_images_list_empty',
      attributes: {
        id: 'article_listing_items'
      }
    };
       
        return content;
  }
  catch (error) { console.log('front_article_images - ' + error); }
}
 
/**
 * The row callback to render a single row.
 */
function front_article_images_list_row(view, row) {
  try {
        
      var image_html = theme('image', { path: row.field_images.src });
      var title_html = '<div class="mobile-title"><div class="inside"><h2><span>' + row.title + '</span></h2></div></div>';
      var date_html = '<div class="mobile-date">' + row.date + '</div>';
      var link = l('<div class="mobile-wrap">' + image_html + title_html + date_html, 'node/' + row.nid) +'</div>';
      return link;
            
  }
  catch (error) { console.log('front_article_images_list_row - ' + error); }
}
 
/**
 * Callback function for no results.
 */
function front_article_images_list_empty(view) {
  try {
    return '<p>Sorry, no articles were found.</p>';
  }
  catch (error) { console.log('front_article_images_list_empty - ' + error); }
}

What I did in this file:

First - I setup display format to none, so I can apply my own custom CSS, instead of using ul li elements, then I added date field and finally applied some custom CSS classes for wrapping results page, here are the CSS styles for them, I added them to drupalgap.css file (but you should probably add them to your theme css file). N.B. CSS styles in this example are not perfect, you should use them just as a reference. 

.mobile-title{
    position:absolute;
    bottom:0px;
    left:0px;
    background:black;
    width:100%;
    height:40px;
    filter: alpha(opacity=90);
  /* IE */
  -moz-opacity: 0.9;
  /* Mozilla */
  opacity: 0.9;
}
.inside{
    position:absolute;
    bottom:25px;
    left:10px;
}
.mobile-title h2{
    line-height: 12px;
    font-size: 12px;
    display: inline;
}
.mobile-title h2 span { 
padding: 0.4em; 
 background-color:orange; 
 }
.mobile-wrap a{
    color: #ffffff!important;
    border-color: #bbb;
    text-shadow:none!important;
    text-transform:uppercase;
}
.mobile-date{
color:orange;
font-size:10px;
position:absolute;
bottom:5px;
left:10px;
}

Make changes in settings.js file

  • Add Drupal.modules.custom['front'] = {}; 
  • Change front page drupalgap.settings.front = 'front';

What's next?

I hope this is a good starting point if you are struggling finding out how to theme your custom frontpage in DrupalGap. Speaking of me - I will fine tune this app to make it look better, and hopefully will move to the stage two - actually finishing it and publishing online. I will keep you updated.

How to take and create HDR Panoramic photos

In today's digital photography school tutorial series I'll show how to create HDR panoramic photos.

Make sure you check my previous tutorials on HDR photography - How To Take and Post-Process Night HDR Images , How to Capture and Post-Process Professional HDR Photos Using HDR Efex PRO

Now, regarding panorama photos, there is not always a need to create a 180 or 360 degree panoramas, sometimes you just want to fit in your frame a little bit more than a regular shot can do, then comes in panorama technique. 

HDR panorama photography

HDR panorama photography

Shooting mode

A sturdy tripod is must have, also a DSRL camera is preferable. Check out: Top 13 Best digital SLR cameras of 2016 for beginners

Install your camera on a tripod, and shoot it portrait mode. Settings for camera - Manual mode, f11, ISO 100, bracketing 3 frames, timer 2 seconds. Rotate your tripod head after each bracketed shot for about 15-20 degrees.

I will shoot in JPEG mode

Post Processing

You will need to have Photomatix, Adobe Photoshop and Adobe Lightroom

Let's start with importing our scene from camera to PC. I will not use default Adobe Lightroom wizard, instead I will save all images on HDD (If you are shooting in RAW mode, you will be required to use that one extra step with Lightroom)

Create a new folder on your desktop - I will call it HDR Panorama, and copy images from your memory card containing images from your scene in that folder

Folder structure for HDR panorama

Folder structure for HDR panorama

Now open Photomatix and choose Batch Bracketed Photos

Batch bracketed photos in Photomatix

Batch bracketed photos in Photomatix

Now from select folder choose folder you just stored images from your camera, as well I will leave default for presets, and press Run button

Batch processing in Photomatix

Batch processing in Photomatix

It might take a while to align your images in final you should seen a screen like this:

Batch results

Batch results

You are done with Photomatix now, now it's time to import exported batch results in Adobe Lightroom

HDR images imported in Adobe Lightroom

HDR images imported in Adobe Lightroom

I will not apply any customizations yet, I will use Adobe Lightroom at this stage just to export (convert and resize) my images, so I can import them to Adobe Photoshop and perform a photomerge.

Select all your images and click on Export from File menu or just press CTRL+Shift+E

From file settings I'll change image format to PSD and will apply image sizing to resize to fit 1024 pixels

Adobe Lightroom export settings

Adobe Lightroom export settings

The real magic starts now - it is time to open Adobe Photoshop and do a photo merge from File - > Automate - > Photomerge

Adobe Photoshop Photomerge settings

Adobe Photoshop photomerge settings

Select psd files you just exported with Lightroom, in most cases I will go with Cylindrical settings, press OK and let the magic happen

It might take a wile to Adobe to generate tour scene, but in a result you should have your HDR panorama generated like this

HDR panorama in Adobe PS

HDR panorama in Adobe PS

Now, merge all layers and save your scene as TIFF image.

Now once more open Adobe Lightroom and import TIFF image you just saved from Photoshop

Apply some cropping and fine tune your image (whites, blacks), but since we did already a HDR, there is actually not much need to apply some fine tuning, you are ready to export your final HDR image

Crop panorama in Adobe Lightroom

Crop panorama in Adobe Lightroom

Now export your final image and you are done. 

I hope you enjoyed this tutorial, if so, please drop a comment or just say hi, I would love to hear from you back.

Hotel Edelweiss Review in Gudauri

Located in Gudauri, a 10-minute walk from the nearest ski lift, Edelweiss Hotel features an on-site restaurant serving Georgian and European cuisine and free Wi-Fi throughout the property.

We booked hotel Edelweiss for 2015 Christmas (December 23-25) and enjoyed our stay at this place a lot. Thus the price we paid for this hotel is well above average (about EUR 100 per night) we are paying for hotels in Georgia, the service offered for price was just excellent.

Alternatively check out Hotel Shamo Review in Gudauri or see TOP 10 Best Gudauri hotels.

Hotel Edelweiss in Gudauri, Georgia

Hotel Edelweiss in Gudauri, Georgia

As it might look like a small hotel from a distance, turns our is a 4 story building from inside. One thing I really enjoyed is the facade of this building, I wouldn't mind to built such facade for our rural house. See: Home Remodeling 

Bed at Hotel Edelweiss in Gudauri

Bed at Hotel Edelweiss in Gudauri

In total there are 28 hotel rooms at Edelweiss hotel. 

Lux room at Hotel Edelweiss in Gudauri

Lux room at Hotel Edelweiss in Gudauri

The modern rooms here are equipped with a flat-screen TV with satellite channels, a refrigerator with a minibar, and a private bathroom with a shower.

Breakfast at Hotel Edelweiss, Gudauri

Breakfast at Hotel Edelweiss, Gudauri

The hotel offers a buffet breakfast. An à la carte lunch and dinner are served daily.

Lobby at hotel Edelweiss

Lobby at hotel Edelweiss

Other hotel facilities include a 24-hour front desk, luggage storage, ironing and laundry services, and a shuttle service. 

Bar / restaurant

Bar / restaurant

Fireplace at Hotel Edelweiss

Fireplace at Hotel Edelweiss

The Bottom Line

Hotel Edelweiss is a bit above the average price (EUR 100 per night), but you are getting what you paid for. I will consider Hotel Edelweiss next time when visiting Gudauri, and can only recommend this place to you.

The Gabriadze Theater in Tbilisi

Though modest in size, The Gabriadze Theater is among the world’s preeminent cultural institutions. Presenting mature puppet performances full of depth and meaning, it has gained the respect and recognition of international audiences and critics alike.

Located in the heart of Tbilisi Old Town, just right next to the Anchiskati church, this theater building offers some interesting architecture as well. Thus, I have never visited a spectacle here (though I have bough tickets for a few times, but due to my laziness never visited) - I believe the Gabriadze theater this is one of the top tourist attractions in Tbilisi.

Gabriadze theater building in Tbilisi

Gabriadze theater building in Tbilisi

The Gabriadze Theater stands in the heart of Tbilisi’s historic Old Town.  Among the shows in its current repertoire are: “The Autumn of My Spring”, “The Battle of Stalingrad”, “Ramona”, “Diamond of Marshal de Fant’e”.

Box office at Gabriadze theater

Box office at Gabriadze theater

About Rezo Gabriadze

Often referred to as “a Georgian national treasure”, Rezo Gabriadze influences the culture profoundly. His work continues to make an indelible and lasting impact on those who experience it. Being an artist first and foremost, he has gained an international reputation as a screenwriter, film and stage director, sculptor and puppeteer.

Gabriadze was born in the town of Kutaisi in what was then Soviet Georgia. He grew up in a world of arts and letters. As he grew creatively, his attention was drawn to film. He went on to write and illustrate over 35 screenplays, including the important films: “Don’t Grieve”, “Mimino”, and “Kin-Dza-Dza”.

Frustrated with the lack of intellectual freedom during the Soviet era, he turned to puppet theater as an surreptitious way of telling his dramatic stories. In 1981 he founded The Gabriadze Theater – a marionette drama theatre in the old town of Tbilisi. His productions of “Alfred and Violetta”, “The Autumn of Our Springtime”, “The Emperor of Trebizond’s Daughter” and “The Battle of Stalingrad” brought international recognition to the theater. It has been touring the world ever since.

As a painter and graphic artist, Rezo Gabriadze has contributed to over 50 books. His illustrations have accompanied the writings of Pushkin, Kharms, Bitov. His art works can be seen in numerous museums including The Hermitage in St. Petersburg, The Dostoyevsky Museum in Moscow, and Lenbach House Gallery in Munich and in private collections. His iconic sculptures “Chizhik-Pizik”, and “Major Kovalyov’s Nose” in St. Petersburg have become major attractions. In October 2012, Moscow’s Pushkin Fine Arts Museum presented its first major one-man show of Gabriadze’s paintings, drawings and sculpture.

Among his many international awards is “Commander of the Order of Arts and Letters of the French Republic”.

Replacing Roof - Part 1: Removing the old roofing

In today's home remodeling series I'll share some epic experience on roof replacement works. If you have been following my blog for a while, you probably have noticed that in Spring 2015 we inherited an old and very bad managed rural house.

That Summer taught me a lot  - I learnt how to use a scythe to move a grass, and also excelled as a construction worker (Room One - Wall and Ceiling Painting with Water Based Paint, How to Patch and Plaster Walls in Your Old Rural House), but nothing compares to experience like actually changing a roof.

It was already more than 3 months since we started to manage this house, but we hadn't any plans to stay any longer that till the end of Summer here, we had actually already bought our return tickets to Tbilisi at the start of September. We hadn't much time left - just about one month to replace old roofing for this house, if we wanted the house to survive upcoming winter (the roof was already leaky). 

So we ordered a metal roof, which was meant to arrive at the start of August, but prior to that, I ordered additional wooden laths and wooden boards, so we can fix existing roof construction and add new roofing. Now it was time to get rid of the old wooden shingle roofing. It was a sunny July 30, 2015. when with help of my brother and father we started this epic journey - Replacing Roofing.

So let's start what we got in the morning of July 30, 2015

Old roofing

Old roofing

The old roofing was made of wooden shingle, as you can see the whole structure of roof is... skewed/ crooked. A large section of roof is covered with moss. We opted for metal roof as replacement, but before that we had to get rid of the old roofing and fix existing roof construction. Some days ago there was some weak attempts of me to clean of the loft. Read more: Loft cleaning - Preparation works for replacing that leaky roof

Tools involved in roof replacement works

Tools involved in roof replacement works

Electrical cables, drills, screws and bolts. As you can see tools are placed on recently repaired kitchen (Removing Junk And Adding First Layer of Paint (Kitchen Works), More Paint Job - Base layer for Kitchen;s Floor) . Also we have fixed all the electrical plugins together with my dad some month ago already. Read more: Replacing Electrical Wiring and Installing Outlets

Tools involved in rood replacement works

Tools involved in roof replacement works

Air level, ax, saws, a chain saw and of course security belts. 

Constructors brigade (phase 1)

The gang - Constructors brigade (phase 1)

From the left: my brother, author of this blog, and my dad. Somebody seems very enthusiastic here. 

Yesterday's pizza from Fontaine's Palace in Liepāja

Yesterday's pizza from Fontaine's Palace in Liepāja

Now, let's begin:

Using a chain saw to saw up old the roof lathing

Using a chain saw to saw up old the roof lathing

What actually we are trying to do here is to completely purify load-bearing beams

Using ax to free up the beams

Using ax to free up the beams

Basically this is a very simple task, where a lot of hand strength is required. Saw up and bang with an ax, and so on until all beams are cleared. For today's challenge we decided to clear just 1/2 half of one roof's side, then level up beams, and to drag a crosswind membrane over leveled beams at the end of day.

View from the garden

View from the garden

Old wooden shingle

Old wooden shingle 

Loft without roofing

Loft without roofing

Suddenly our demolishing works were interrupted as materials arrived - wooden laths and wooden boards. It was supposed they will arrive just tomorrow, but as they did arrived today we had to unload tractor trailer of about 6m3 of materials.

Tractor arrived with construction materials

Tractor arrived with construction materials

Damn, I must trimmer that grass again. Read more: Lawn mowing in the backyard territory

Author of this blog unloading materials from tractor trailer

Author of this blog unloading materials from tractor trailer

Using string to measure level of beams

Using string to measure level of beams

The leveling process with a string line.

The leveling process with a string line.

After some time another surprise came - rain. We stopped our works for couple of hours and enjoyed a lovely rainbow meanwhile.

Rainbow in the evening

Rainbow in the evening

Using flex to saw up metal screws for roof construction

Using flex to saw up metal screws for roof construction

It was already late evening (around 23:00) and we decided to stop any further works today, and continue tomorrow morning early, but before that we had to do one more major thing for tomorrows works - to paint with an antiseptic those wooden boards that arrived earlier today, so we can quickly move forward tomorrow.

Wood processing with antiseptics

Wood processing with antiseptics

Now, this as one long working day, some even claimed that they didn't agreed on 18 hour work day here. As in matter of fact, indeed this was about 18 hour working day. So we went to the sleep in a house without 1/4 of roof at all, while the rest of the roof was leaky. It rained that night. But I got this feeling of happiness. I got asleep.