Drupal StackExchange

How to manage reservations with a 2 hours duration without duplicate bookings?

1 month 3 weeks ago

I want to make a calendar view that will show when music teachers are available, so that students can register online and attend a lesson. The courses have all the same duration which is 2 hours. For this, I created a content type called "Lessons" (Fields: title, description, teacher name, teacher email, date/time) and a content type using node reference module for registrations to each specific lesson. In that way students can register online for music lessons.

There are 2 problems with this:

  1. How can I have a fixed 2 hour duration in the day of the calendar view that won't let students register for more or less time than the two hours? I can not just hide the time fileds because the system must show them the time that the lesson takes place?

  2. I want to allow just one user register for each lesson and then the system must show that lesson as booked. To be more specific, I want the calendar to show the whole day seperated in 2-hour periods and which periods are free. When a user registers for a lesson, the lesson changes color (I can do this with css) and is marked as reserved so that the "next" user can only register for another of the open lessons and so on.

Any ideas?

Pan Adams

Custom module update with project status url

1 month 3 weeks ago

My .info file is the following.

name = {some_name} description = This will contain all {some_name} related information package = {Package_name} core = 7.x ; Information added by Drupal.org packaging script on 2014-10-03 version = "7.x-1.1" core = "7.x" project = "{project_name}" project status url=http://domain.com/{project_name}/7.0/sub_module datestamp = "1432104957"

I uploaded the sub_module.zip and the sub_module.tar.gz files, as well as the sub_module folder to the above project status URL, with .info version set to 7.x.2.1.

Still I'm not getting any updates for my custom module. Can anyone help me with this?

Ashish

How to render formatted text field from paragraphs as is in twig?

1 month 3 weeks ago

I need to render a text (formatted long) field using twig. At this time i am doing the following below. However, i am finding that if i were to add a line break in the text field or apply adding spacing or a horizontal line, the twig filter "raw" removes those attributes. I need assistance to see what I am missing.

I have already set the view mode for field on the content type to default

Twig template (filter used)

{% for item in items %} {{ item.field_body.value|raw }} {% endfor %}

Expecting

Actual result

usernameabc

Define a normalizer just for a specific use case

1 month 3 weeks ago

I try to create a custom API with custom endpoints where API users can receive entity data from our page. We want to have flat arrays for most of the fields and some additional custom data added so I tried to implement some custom normalizer classes. I found out that supportsNormalization() is the place where the decision is made if my normalizer is used, but I have no context. I just have the object which needs normalization and the format on which I can say Yes, please use my normalizer. As I don't want to force all my entities everywhere in the project be normalized with flat array this is too restrictive for us. I want to use my normalizer only when the entities should be normalized for delivering it in a specific API. Is there a way to achieve this?

Tobias Krause

Views, Taxonomy, multiple parameters using contextual filters

1 month 3 weeks ago

A view has been created to display related content types via their taxonomy terms, using contextual filters. Currently the view is able to display content based on the first param eg. about The goal is to abe to display content based on the second param, being the child term and hide the parent eg. about/meet-the-team.

Here is a break down

Url : page/parent term

parent term Content item referenced to parent term Content item referenced to parent term Content item referenced to parent term Content item referenced to parent term

Url: page/parent term/child term

child term Content item referenced to child term Content item referenced to child term Content item referenced to child term Content item referenced to child term Content item referenced to child term

Url: page/parent term/child term/child child term

Content item referenced to child child term Content item referenced to child child term Content item referenced to child child term Content item referenced to child child term Content item referenced to child child term Content item referenced to child child term Content item referenced to child child term

And this will continue on

Eg Url: page/parent term/child term/child child term/child child child term/child child child child term.

Chris

How do you use hook_query_alter to get inside a query's creation?

1 month 3 weeks ago

I'm getting no love from hook_query_alter. I have a simple query to which I want to add a tag, while also adding a node_access tag. Thus the whole query looks like this:

$the_nodes = db_select('node', 'n') ->condition('n.type', 'some_node_type') ->fields('n', array('nid', 'title')) ->addTag('node_access') ->addTag('my_custom_tag') ->execute()->fetchAll();

I then define a handler in one of my modules and litter it with debugging statements, hoping something will happen:

function mymodule_query_alter(QueryAlterableInterface $the_query) { dsm("inside mymodule_query_alter"); dsm($the_query); if ($the_query->hasTag('my_custom_tag')) { dsm('Found it!'); // do real work here } }

I then clear the system cache. Once I've done this, the following things happen:

  • My handler is running, and reports a number of invocations from various system calls.
  • The objects being dumped by the dsm calls are all very much alike -- they contain only an alterTags array, which typically has entries for either node_load_multiple or file_load_multiple, but nothing else -- certainly nothing like a full Query object.
  • None of the alterTags arrays have an entry for my_custom_tag.
  • The inner "Found it!" message never fires.

Arggh. This is my first encounter with hook_query_alter(), and I'm probably just missing something basic about its use. Can anybody clue me in? (BTW, based on some browsing around, I've also tried defining handlers for my_module_query_my_custom_tag_alter and my_module_query_node_access_alter, but never see anything from them.)

Jim Miller

Accessing Content: Path field within views_view_unformatted TWIG template

1 month 3 weeks ago

I have a view that has the fields: Content: ID, Content: Title and Content: Path.

In my views-view-module.html.twig file I can access the fields via the following:

{{ item['#row']._entity.id }} {{ item['#row']._entity.title[0].value }}

But I cannot seem to retrieve the path field using:

{{ item['#row']._entity.path[0].value }}

Do I do this the same way or am I missing a trick? I've tried to use dump/kint but I keep getting the WSOD.

Can anyone offer me a solution?

Thanks in advance

cwiggo

Pass custom variable to an entity reference templete

1 month 3 weeks ago

i have the following problem in Drupal 8.

In custom content type there is a field, which is a multiple entity reference to the same content type. The field is set to use custom view mode, where only title and body fields are displayed. Kind of sub-pages structure. Also the content type has a boolean field, which determines whether the body field of sub pages (entity reference) should be displayed or not. So in my theme_preprocess_field() hook i can get the boolean value, but i don't know how to pass it to the entity references, so in my node--mypage--grid-item.html.twig i could check for that flag and determine should be content.body be rendered or not.

Thank for any hints.

user1112057

How to get text from radio option value

1 month 3 weeks ago

How do I get the option text from the submitted value of the radio field in Drupal 8 webform submission? I have written a rule action condition on webform submission where I am storing data in a middle table.

Based on screen I am looking for Option Text from webform field. Current version: Drupal 8.6.15 & webform 8.x-5.2

kirtivaland

Drupal Planet

Specbee: 7 Most Popular Marketing Automation Drupal Modules - A Marketer's Guide

1 month 3 weeks ago
You can't escape marketing automation if you're looking to scale your marketing efforts. Each organization sets different marketing automation targets. According to research, productivity optimization is the primary goal, followed by acquiring more leads, analyzing performance, and aligning marketing and sales. So what's yours? Various marketing teams/individuals have their preferred marketing automation tools that align with their goals. Some appreciate the user-friendly interface of Constant Contact, while others favor the feature-rich capabilities of MailChimp. As an extremely flexible CMS, Drupal offers seamless integration with a wide variety of marketing automation platforms. Its open architecture ensures smooth data synchronization among email marketing software, CRM systems, and analytics tools. In this article, we'll explore some of the most popular marketing automation Drupal modules designed to simplify every marketer's workflow. Why You Can't Afford to Ignore Marketing Automation Tools “Good marketing makes the company look smart; Great marketing makes the customers feel smart” - Joe Chernov (VP Marketing @ Pendo). Great marketing requires more than just a physical team capable of manually managing your marketing workflows. It demands marketing automation tools to streamline lead nurturing and expedite your entire marketing process. Did you know that companies proficient in lead nurturing generate 50% more sales-ready leads at a 33% lower cost (ref)? Marketing Automation tools help convert raw leads into nourished and qualified marketing leads that are turned over to the sales team for further customer relation management. This applies to both B2B and B2C organizations. It helps track your prospective customer’s activities right from when they visit your website to reading your blogs or filling out a form. You can also schedule and track your marketing campaigns via email, social media, or any other communication. Prospective customers can be easily segmented into suitable mailing lists based on their interests or preferences and will receive/view only relevant content, thus giving you happier (also read ‘less annoyed’) leads. A ‘drip campaign’ (email campaign) can be scheduled depending on the right time and right interest shown by your leads that will help you stay on top of their minds thereby nurturing your leads. You will also be able to see the reports/analytics and analyze the success of your marketing campaigns. Drupal Modules for Marketing Automation Drupal is renowned not only for its robustness and scalability but also for its vast active community of contributors. Within the Drupal CMS, you'll discover numerous contributed marketing automation modules or plugins that are both free and user-friendly. However, they may not always offer as many features as third-party tools. Fortunately, there's an abundance of third-party marketing automation software available that seamlessly integrates with your Drupal website, providing a wider range of functionalities. Webform While the Webform module itself isn't a marketing automation tool, it serves as a crucial foundation for integrating Drupal with third-party marketing automation software. The Drupal Webform module is used to collect user data via forms. You can build forms like surveys, simple newsletter signup forms, or contact forms. This submitted data is then pushed to third-party marketing automation systems. In the latest Drupal versions (8+), Webforms have undergone significant enhancements, including an object-oriented API, source editing capabilities, new and improved form elements, extendable plugins, improved documentation, and more. Learn how to get started with Webforms in this brief tutorial. HubSpot HubSpot marketing automation is well-known for providing users with a wide range of inbound automation tools – Marketing hub, Sales hub, and Service hub. Each of them can function alone or all together. The HubSpot Drupal module integrates with Webform and the HubSpot API. Once a user enters their information via Drupal Webform, the records are sent to HubSpot’s lead management tool, where the leads can be tracked and nurtured. MailChimp MailChimp is a very popular email automation platform that does more than just send bulk emails. You can create custom campaigns, send and schedule automated emails based on certain predefined triggers, track and monitor customer behavior, personalize, generate reports, etc. The Drupal MailChimp module integrates your Drupal website with Mailchimp which will help in tracking and creating a list of website visitors. This list is sent to the MailChimp list from where email automation and other features can be accessed. You can also create signup forms, and campaigns and track activity from your Drupal website. Your visitors can also have control over which of your email lists they want to be on or off. Learn how to create targeted email campaigns using MailChimp and Drupal in this article. Marketo MA Marketo, now an Adobe company, is a very popular and widely used marketing automation tool that automates activities such as lead tracking and nurturing, personalization, analytics, advertisements, social marketing, automated campaigns, and more across multiple devices. The Market MA Drupal module helps you capture lead data during form submission and adds tracking capabilities to your Drupal website with the Marketo Munchkin tracking codes and API. It also integrates seamlessly with the Drupal Webform module. Learn how to synchronize your lead data from Marketo to Drupal in real time using Webhooks in this article. Mautic Mautic is the first open-source marketing automation platform and was recently acquired by Acquia. It allows for multi-channel communications and campaign management, visitor tracking, email marketing, content customization and personalization, etc. The best way to integrate Mautic with your Drupal website is with the Webform Mautic module. This module enables the addition of Mautic handlers to Webforms, facilitating data submission to Mautic lists. To effectively track website contacts, ensure the installation of the Mautic tracking code on your Drupal website. Google Analytics Did you know that Google Analytics was originally based on a web analytics service called Urchin, which Google acquired in 2005? Google Analytics is now the most widely used website analytics tool in the world today. No marketing automation is complete without analytics and GA does a great job at it. The extremely popular Google Analytics Drupal module (having over 200k downloads!) lets you add a web statistics tracking system to your website. It can track, monitor, and support domains, users, files, search systems, Adsense, custom code snippets, and a lot more. To generate reports for all your tracked data, you should install the Drupal module for Google Analytics Reports. Learn how to implement GA4 for a successful marketing strategy here. Yoast This Drupal module brings the power of your favorite Yoast tool directly into your Drupal environment. With the Real-time SEO for Drupal module, you don’t have to worry about missing keywords or exceeding text limits. It's an excellent tool for Drupal SEO, offering real-time page analysis of meta tags and alerts to rectify any missteps along the way. It provides a preview of how your page title and meta description will appear in Google search results. This module helps fasten and improve the SEO optimization process and thus acts as an effective marketing automation tool. Other Popular Marketing Automation Drupal Modules Salesforce Suite - Integrates with Salesforce by synchronizing Drupal entities with Salesforce objects. ActiveCampaign - An integration between Drupal and the popular CRM tool - ActiveCampaign. Pardot - Adds Pardot web analytics integration to your Drupal website. OmniSend - Integrates with the OmniSend marketing automation tool that automates email marketing and more. AddToAny Share Buttons - An easy-to-use social media sharing button set to add to your website. Final Thoughts By integrating marketing automation tools with your Drupal website, you can efficiently convert leads into satisfied customers, boosting operational efficiency and accelerating revenue growth. At Specbee, our team of Drupal experts is proficient in seamlessly integrating your Drupal website with various third-party marketing automation tools. We provide a comprehensive range of Drupal services designed to enhance your business outcomes and drive success.