Latest posts

Browse topics

How to Create a Stunning Masonry Front Page in Drupal: A Step-by-Step Guide

Creating a Drupal masonry front page can be an effective way to showcase your website's content in a visually appealing way.

Masonry layouts are popular for their ability to display content in an organized and dynamic manner, allowing users to easily navigate and explore your website.

In this tutorial, we'll guide you through the steps to create a Drupal masonry front page. 

Step 1: Install and enable the Masonry module

To begin, you'll need to install and enable the Masonry module in your Drupal site. This can be done through the Drupal administration dashboard by navigating to Extend > Install new module, and then searching for "Masonry" in the search bar. Once you've installed and enabled the module, you can begin configuring your masonry front page.

Step 2: Create a new view

To create a masonry front page, you'll need to create a new view. In the Drupal administration dashboard, navigate to Structure > Views > Add new view. Give your new view a name and choose "Show content of type" as the view's base table. Then, select the content types that you want to display on your masonry front page.

Step 3: Configure the view

Once you've created your new view, you'll need to configure it to display your content in a masonry layout. Under the Format section, choose the "Masonry" format and configure the settings as desired. You can adjust the number of columns, the width of the gaps between the content blocks, and other visual aspects of your masonry layout.

Step 4: Customize the view's fields

To further customize your masonry front page, you can adjust the fields that are displayed in each content block. Under the Fields section of your view, you can choose which fields are displayed, adjust their order, and configure their display settings. This allows you to create a masonry front page that showcases your content in the most effective way possible.

Step 5: Save and preview your masonry front page

Once you've configured your view, be sure to save your changes and preview your masonry front page to ensure that everything is displaying correctly. You can access your new masonry front page by navigating to the URL that corresponds with your view's path.

At this point, you may be wondering whether you have the time and expertise to create a custom masonry front page in Drupal on your own. If you're not confident in your Drupal development skills, or if you simply don't have the time to invest in learning how to do it yourself, then hiring a professional Drupal development company like DrupalTbilisi.com can be a smart choice.

DrupalTbilisi.com has years of experience in Drupal development and can help you create a custom, professional-looking website that meets your unique needs. They have a team of Drupal experts who can work with you to understand your business goals and branding requirements, and create a customized masonry front page solution that fits your needs and budget.

In conclusion, creating a masonry front page in Drupal can be a powerful tool for showcasing your website's content in a visually appealing and organized way.

Whether you choose to tackle it on your own or hire a professional Drupal development company like DrupalTbilisi.com, the key is to focus on creating a masonry front page that is visually engaging, user-friendly, and showcases your content in the most effective way possible.

How to Use Drupal Web Widgets Module to Embed Custom Content on External Websites

Drupal is a popular and powerful open-source content management system (CMS) that provides a wide range of tools and features to create and manage content on websites. One of the most useful tools in Drupal is the Widgets module, which allows users to create and embed custom content on their websites and other external sites. In this article, we will explore how to use the Drupal Widgets module to embed content on other websites.

The Drupal Web Widgets module enables site administrators to create custom widgets that can be used to embed content on other websites. These widgets can be customized to match the look and feel of the website they are being embedded on, allowing users to provide a consistent and cohesive user experience.

To get started with the Drupal Web Widgets module, you will need to download and install it on your website. Once installed, you can create a new widget by going to the "Widgets" section in the Drupal dashboard and clicking "Add Widget." This will open a new window where you can select the type of widget you want to create and customize its settings, such as the size and layout of the widget.

After creating the widget, you can then generate the code snippet that can be used to embed it on other websites. This code can be customized further to match the specific needs of the website you are embedding the widget on. For example, you can adjust the dimensions of the widget, set its alignment, and even specify the specific content that should be displayed.

To embed the widget on an external website, simply copy the code snippet and paste it into the HTML code of the target website using the appropriate tools, such as the website's content management system. When the website is loaded, the widget will be displayed according to the settings you specified, providing a seamless and integrated user experience for visitors.

One of the key benefits of using the Drupal Widgets module to embed content on other websites is that it provides site owners with an easy and efficient way to expand the reach of their content. By embedding custom widgets on other sites, you can attract new audiences, promote your brand, and drive traffic back to your site. Moreover, the Drupal Widgets module is highly customizable, making it easy to create widgets that meet your specific needs and enhance your site's functionality.

In conclusion, the Drupal Web Widgets module is a valuable tool that can help site administrators to create and embed custom content on their websites and other external sites. With its range of customization options and ease of use, the Drupal Widgets module is an ideal solution for anyone looking to expand the reach of their content and attract new audiences to their website.

Displaying Node Counts in Drupal: How to Show the Number of Nodes Referencing Each Item

In Drupal, it is common to use the Node Reference field to create relationships between different content types. This field allows you to reference a node from another content type and create a link between the two. However, displaying the number of nodes referencing each item in a node reference field can be challenging.

In this article, we'll explore a few ways to display the node count per node reference field in Drupal.

Option 1: Using Views

The most common way to display the node count per node reference field is by using Views. Views is a powerful tool that allows you to create custom queries and display the results in a variety of ways. Here's how you can use Views to display the node count per node reference field:

  1. Create a new View and select the content type that contains the node reference field you want to display.

  2. Add a relationship to the node reference field by selecting "Content referencing content" under the "Add Relationship" dropdown.

  3. Add a new field to the View and select "Content: Nid" (Node ID) under the "Add Field" dropdown.

  4. In the field settings, select the "Count distinct" aggregation option to count the number of nodes referencing each item.

  5. Save the View and preview the results to see the node count per node reference field.

Option 2: Using Custom Code

If you prefer to use custom code instead of Views, you can create a custom template file for your content type and use PHP to display the node count per node reference field. Here's how you can do it:

  1. Create a new file called "node--[content-type].tpl.php" in your theme's template directory. Replace [content-type] with the machine name of your content type.

  2. Add the following code to the template file:

<?php

$node = node_load($nid); // Load the current node

$field = field_get_items('node', $node, 'field_node_reference'); // Replace 'field_node_reference' with the machine name of your node reference field

$count = count($field); // Count the number of nodes referencing the current node

print $count;

?>

  1. Save the template file and clear your site's cache to see the node count per node reference field on your content type.

Option 3: Using Contributed Modules

Finally, you can use contributed modules to display the node count per node reference field. The Node Reference Count module is one such module that allows you to display the number of nodes referencing each item in a node reference field. Here's how you can use it:

  1. Install and enable the Node Reference Count module.

  2. Edit the settings for your node reference field and select "Display the number of existing nodes" under the "Node Reference Count" section.

  3. Save the settings and view your content type to see the node count per node reference field.

Conclusion

Displaying the node count per node reference field can be a useful way to understand the relationships between different content types in Drupal. Whether you use Views, custom code, or contributed modules, there are several ways to display this information. By following the steps outlined in this article, you can easily display the node count per node reference field in your Drupal site.

If you need any help, consider hiring me for your next Drupal project

Custom Drupal Search Built with Search API + Database Search + Views

The default Drupal search function is pretty much OK, but if you are looking for ways to control and extend search behavior  - you are stuck with the default out-of-the-box search. 

I'll show you how you can boost your search functionality, by using just two (OK, three modules)

Download the following modules:

Download and extract them into the sites/all/modules folder

Enable Database search,  Search API, and Search views

Now we must add a search server and search index.

Let's start with Search server.

  • Go to admin/config/search/search_api

  • Click on Add server link

  • Give it a name - I prefer to call it as DB Server, if you wish, you can enter the Server description. Under the dropdown from Service, the class chose Database service. Click Create Server.

Now go back to admin/config/search/search_api - you should see - your newly created server as enabled, and index as disabled.

  • Click on the Edit button for the Default node index.

  • You must click the check box next to the Enabled button, and under Server, you must choose our newly created Server which we called DB Search (if you called it another way - you should see that name under drop-down box). Click Save settings.

We are almost there - before indexing items, as it will appear in the next window after you will click Save settings, let's add some fields to index.

  • Go to admin/config/search/search_api/index/default_node_index/fields

If you have made some custom changes to your Drupal site, like added custom fields, taxonomies e.t.c. and you would like them to be indexed in your search server - this is the place where to add fields to the search index. If you are OK with the default (Title and body) leave the settings intact.

Now let's index our nodes. You should configure cron, so items are indexed automatically, but if you want manually index your search server, go to admin/config/search/search_api/index/default_node_index

  • Click on Index now button to index 50 items, and repeat it, so all your content is indexed, if you have too many nodes, use a cron job.

Now we are ready to build our Search page.

Create a new View

Admin > Structure > Views > Add new view

  1. View name: Search
  2. Show: [the name of the Search index] (in the case of Default node index the default is "Default node index")
  3. Create a page [tick]
  4. Page title: Search
  5. Path: Search
  6. Display format: Unformatted list of Fields
  7. Items to display: 10, use pager

Continue & edit (the new View)

Format: Show: Fields | Settings

Fields: Title, Body

Filter criteria

  • Fulltext search: Expose this filter, Required, Remember the last selection, Use as search keys
  • Indexed Node: Status: Operator: Is one of, Value: Published

Sort criteria

  • Search: Relevance, descending (if you don’t have an order with fuzzy search you will get a PDO exception)

Page settings

  • Access: Permission: view published content

Advanced

  • No results behavior: Global: Text area “No results matched your search.”

Exposed form

  • Exposed form in block: Yes
  • Exposed form style settings: Submit button text: Search

Save the View. Add the exposed form block to a region.
Note that you will only receive results for partial matches that are longer than the minimum word length specified in the Index configuration.

It's up to you now, how are you going to format the display of your views page. As extra, you could add Facets to be displayed on the sidebar as well.

Here is the final search results page  I made for this site: https://www.reinisfischer.com/do_search?keyword=yerevan

Consider hiring me if you need help with Drupal website development

Etchmiadzin Cathedral in Armenia

Etchmiadzin Cathedral is considered the oldest cathedral in the world. The original church was built in the early fourth century between 301 and 303 according to tradition by Armenia's patron saint Gregory the Illuminator, following the adoption of Christianity as a state religion by King Tiridates III. 

I had a chance to visit this holy site at start of 2014, a harsh winter was in Yerevan and affected photos listed bellow. I would love to return here and re-photograph in Summer. 

At the main entrance gates

At the main entrance gates

On our trip to Yerevan, Armenia, we met a cool Taxi driver Tom, and asked him, what is the most must have to see tourist attraction in Yerevan, he told that we must visit Etchmiadzin Cathedral which is located outside of capital Yerevan.

We negotiated with Tom to drive us there. At start he told it would cost about 5.000 Drams, but later it turned out to be 7000 Drams with stops at Yerevan Market and local kabab tasting.

The same entrance gates from the inside

The same entrance gates from the inside

I was impressed - It's the oldest church building in world. It dates back from 301 A.D.  Just logical it's listed as UNESCO World Heritage site.

Etchmiadzin Cathedral

Etchmiadzin Cathedral

Some church renovation works were performed when we last time visited it in 2014. 

At Etchmiadzin in Armenia

At Etchmiadzin in Armenia

Etchmiadzin was the seat of the Catholicos until 484. It was restored as catholicosate almost a millennium later in 1441 and remains as such to this day.  It has been constantly renovated since the 17th century. Major additions were made by various catholicoi. Diminished during the early Soviet period (1920–30s), Etchmiadzin revived again under Vazgen I in the second half of the 20th century.

Christmas installations at Etchmiadzin  cathedral

Christmas installations at Etchmiadzin  cathedral

Etchmiadzin has been one of the most important locations in Armenia since its foundation. The cathedral complex is called the "Armenian Vatican" for its significance. Along with several important churches located nearby, the Etchmiadzin Cathedral was listed as a World Heritage Site by UNESCO in 2000

That said all I can add is a huge thanks to our taxi driver Tom, here is his phone number +374 91228812 in case.

If you are looking for nice hotel in Yerevan, take a look at this hotel review or this