Golems GABB: Hiding Form Fields in Drupal 8

Hiding Form Fields in Drupal 8 Editor Mon, 08/14/2023 - 12:12

Imagine that you have created a content type with several fields. Depending on your needs, you may not require all of these fields to be displayed when viewing the entire node. Luckily, there is a simple way on Drupal how to hide a field on a form.
Code snippets may be applied to conditionally hide or enable a form field programmatically When you need to hide or show a form field. based on the specific value from another field, the Drupal form API hide field allows Drupal 8 hide form fields relating to values chosen in other fields. 

qtatech.com blog: Comparing the Top Drupal Hosting Platforms: Which One is Right for You?

Comparing the Top Drupal Hosting Platforms: Which One is Right for You? kanapatrick Mon, 08/14/2023 - 10:04

When it comes to launching a powerful and feature-rich website using Drupal, selecting the right hosting platform can make a significant difference in your site's performance, reliability, and security. With an array of options available, it's crucial to understand your hosting needs, evaluate performance, consider scalability, and weigh security features before making a decision.

Image removed.

The Drop Times: Empowering Cool Things with Ease in Drupal | Interview with Alexander Varwijk

Discover the driving force behind creating interactive online community experiences and embracing API-first approaches. Join us as we dive into the mind of Alexander Varwijk, the Lead Engineer at Open Social, and gain insights into his journey with Drupal, React, and GraphQL. Unveil the challenges faced by Drupal in staying competitive in the modern web landscape and learn how innovations in Rust and JavaScript are shaping the future of front-end, API, and application development. Don't miss this exclusive interview with a tech visionary at the forefront of web development!

DrupalEasy: A method for utilizing multiple authors for a single Drupal node

Image removed.A client recently asked me to figure out how to allow additional authors to not only be listed on a single node, but also to let them have the same edit and delete permissions as the main author of the node. I thought it might be helpful to put together an article that details one potential solution to this not completely uncommon task.

This is not something I have implemented in any modern version of Drupal (8, 9, or 10), so I took a fresh look at the problem by reaching out to my Drupal network via Slack and social media - I even asked ChatGPT (with poor results in this case.) I received several suggestions, including the very new Node Co-Authors module, the not-at-all-new Access by Reference module, and the full-of-momentum ECA module.

I also decided to use this as a topic of discussion during the weekly DrupalEasy office hours (exclusively available to our long-form training course students and graduates.) I did some initial research and decided to try the Access by Reference module first - mainly because it seemed rather flexible as well as straight-forward to use. I really liked the fact that I could configure it to use any user reference field I add to a particular content type to specify additional authors.

The Access by Reference module allows you to specify additional authors via several methods, including via a reference field (this is the obvious choice, IMHO,)  user email address, a shared profile value, or via a reference parent (interesting) For this use case, via a user reference field was exactly what I was looking for.

Spinning up a fresh Drupal 9 install to test it on, I installed the Access by Reference module and added a standard multi-valued "Additional authors" entity reference field on the Basic page content type (image above).

Next, I navigated to the "Set access by reference" configuration area and added a new "abr configuration." This is where I told the Access by Reference module about the user reference field I had just added. Setup was pretty straight forward:
 

Image removed.

There really wasn't anything tricky to setting up the abr configuration. I basically pointed to the "Additional authors" field I added, set the "Reference type," and then specified that I wanted additional authors to inherit read, update and delete permissions from the main author. Easypeasy.

The final step was to give the "Access By Reference" permission to the role of users I wanted to be able to become additional authors. For example, by giving this permission to "Authenticated users", then any user can be added as an additional author for a particular node and then have edit and delete permissions for the node (probably not the best configuration.)  In my client's case, they have something akin to an "authors" role that makes perfect sense for this scenario.

While this completed the functional aspect of the task, I really wanted the "Additional authors" field to be listed in the "Authoring information" accordion of a standard Drupal node add/edit form (when using Claro). This was accomplished with a very small custom Drupal module (named multiauthor) that implements a single Drupal hook:
 

/** * Implements hook_form_alter(). */ function multiauthor_form_alter(array &$form, FormStateInterface $form_state, string $form_id): void { if (in_array($form_id, ['node_page_edit_form', 'node_page_form'])) { $form['field_additional_authors']['#group'] = 'author'; } }

This hook alters the Basic page add and edit forms, setting my custom "Additional author" field (field_additional_authors) to the "author" group (this is the "Additional authors" accordion).

With that in place, the somewhat elegant solution is complete.
 

Image removed.

At this point, any users added to the "Additional authors" field will have the same read, update, and delete permissions at the owner of the node. Success!

Spinning Code: Mid-Career Resumes

As we exit the Great Resignation, and move back to more traditional hiring patterns, application materials are increasingly important again. Over the course of my career I’ve been involved in a lot of hires, and read a large number of resumes. I know what I like to see, what I don’t like, and I have a bunch of friends in a similar position (although their likes and dislikes are sometimes different).

Recently, I realized that much of the advice online about resume writing is for people early in their career. That’s fair; they are the people with the least experience and need the most help. But as someone who is now mid-career, and reading resumes for other people who are also mid-career, I am noticing resumes from people who seem to still follow the early career advice.

So a few weeks ago I reached out to my friends who, like me, sometimes review mid-career resumes. While none of us is a full-time recruiter, we are the people who you need to impress if you want a job on our team. This post is a combination of my take, and the input I got from those people.

There are NO Hard Rules About Resumes

Resumes are not a regulated industry. There are no hard and fast rules. Any advice you see is just a set of suggestions. In the end, you have to decide what makes you look good and guess at what is effective.

Studies are rare, and even the best are poorly done. That is not the researchers’ fault. You cannot double blind a job hire. You cannot have 1,000 managers at different companies all hire for the same job from the same pool of applicants. Any one who knows a researcher is watching them work, likely changes their behaviors. Any study that finds bias creates legal risk for companies that participate which in turn limits participation and openness to data publication. List of problems with studying the process goes on and on.

  • Anyone who tells you there is one best way to create your resume, is wrong. 
  • Anyone who is entirely focused on the hiring manager, risks failing to give advice to beat automated filters.
  • Anyone who is entirely focused on beating the automated filter, ignores that nearly ½ of the jobs in America are at small companies and unlikely to use such filters. 

Write the best resume you can. Ask friends, particularly those who do hiring, for feedback. Consider paying a resume writer for help. But don’t expect even paid experts to be correct all the time.

Mid-Career Resumes Should Highlight Your Experience

The biggest mistake I see in resumes of people in mid-career, or even late career, is failing to highlight their experience. People who were at one employer for a long time struggle with this the most, but I’ve seen resumes for people with 15 years of experience that read like a recent graduate.

Your experience should be front and center. Everything about your resume should say “this is an experienced person.”

I like some form of summary at the top. Tell me what kind of employee and colleague you are. Not an objective section, but a summary of who you are. It can come in many forms: 

a short paragraph:

Salesforce MVP, developer, administrator, and consultant with 20 years of experience in the nonprofit and higher education sectors. Seven Salesforce certifications, experience in more then 20 programming languages. Proven experience leading teams and working closely with non-technical clients.

list of titles, or key phrases

Salesforce MVP, Technical Architect, Nonprofit Fundraising Expert

After that, your job experience and skills are next. How exactly you do this can vary. Some people like skills in a sidebar. Some people put a list at the top. Some people put that list after their job experience. Frankly, as a reader, I don’t care. But I want to be able to find your list of skills and your relevant job history fast.

Your currently valid certifications should be included near your skills. But only those the reviewer will find relevant. 

Think About Your Audience

Likely the person reading the resume of an experienced person is an experienced person. We have habits, routines, and work styles that are built on experience. We also have things like aging eyes, old printers, out of date external monitors, and other things that it are tempting to ignore.

Text should be high contrast, print well in black and white (there is a huge exception here for graphic designers, who benefit from showing off graphic design skills), and be generally easy to read. I don’t want your pretty three color graph, head shot, or blue text that prints light gray.

If I am reading a handful or resumes, I’ll do that on a screen and I can zoom in if I need. But if I’m digging through a big pile, I’ll print them. I will print them on my 20+ year old laser jet, blank and white, printer. When I last worked in an office and reviewed resumes, I used the office’s even older laser jet black and white printer. Your shaded background might make the whole thing unreadable on those devices. Besides, you should have too much experience to waste space on a picture (and that’s before we talk about companies trying to avoid identity based biasing who might not want reviewers to know what you look like too early in the process).

I strongly recommend going for simple, clean, classic, design approaches. 

Mid-Career Resumes Should be More Than One Page.

I haven’t used a one page resume in more than 20 years. I don’t know who is still saying one page is the magic number. A new graduate might benefit from the one-pager, but if you have 10-30 years work experience, and you only need one page to tell me, it better be the most amazing page of text you’ve ever created. When I see a one-page resume, before I see the words I see a person with limited experience.

Personally, I like the two pager. Two very full pages. I want to see that you were forced to edit and format aggressively to make it fit on two pages. You want me to think you have 5 pages of content, but you compressed it effectively.

Two pages gives you plenty of room to show off, without wasting my time. It shows me you can edit and filter content. Ideally, it’ll leave me wanting more information, that gives me questions I can ask in your interview.

Some people like longer. When I spoke with friends who hire, most people liked two pages. But some were open to 3-4. Beyond four you are into academic CV land, which is a different thing entirely.

Connect the Dots

You have experience, you are showing it off well, good. But are you showing off the right experience? One of the most consistent pieces of feedback I got from friends who do hiring is that we want to know you know who we are as an employer.

No every detail, but tell us what your public persona is. Is there a values statement in the job ad? Reflect some of that language back in a cover letter. Do we work in a specific market? Make sure to include some experience that connects you to that market. 

When I worked at a nonprofit, we wanted people excited by the work we did. Which means they needed to find ways to tell us in their resume, cover letter, application, and interview they knew something about that work. Since becoming a consultant, I’ve been consistently amazed that people will send resumes and come to interviews that don’t know what kind of customers we have.

Write a Cover Letter whenever Invited

This applies not just to mid-career applicants, but everyone else too. Not all jobs accept a cover letter, but when given the chance to say more: say more.  The numbers I can find on resume review suggest an average of 6-7 seconds. I think that’s low in practice (see comments on studies), I know when I dig through a large stack I find ways to filter out some very fast, and others get more careful review. So an average will likely be far from my median or modal times.  Even so, a resume that isn’t tossed out because it’s an applicant who is wildly unqualified, will get 15-30 seconds in my first pass.  You add a cover letter, now I’m spending more time reading. You could double, or even triple, the time you get in the first review 45-90 seconds – that’s huge.

It also means you can connect some additional dots for me. If your resume includes experience that you consider related, but that might not be obvious, you have a couple sentences now to tell me that story. Are you career pivoting? Tell me what about your old career makes you better than your experience suggests. Do you volunteer in your community? Tell me what about that helps you understand our work, or support our company values.

In Mid-Career Resumes the Basics Still Matter

Details matter: fix your typos, use consistent formatting, etc. I saw a resume recently with a red-line through their summary line. That’s a bad first impression.

Write resumes you want to read: If you have read resumes as part of your job, think about the ones that impressed you and mimic those.

Get feedback from a friend: You probably have friends and professional contacts who will give you blunt feedback. Ask for it. I did as part of writing this post.

Consider hiring an expert: There are people who do this for a living. Some of them are really good. When you ask your friends for feedback, ask them for references to services they used.

Not everything is needed: Edit down your experience. Keep the stuff that says you’re awesome, cut stuff that’s not relevant to the hiring manager.

References for More Thoughts on Mid-Career Resumes:

The internet is full of advice on resume writing. Most for beginners, but some for people with more experience.  Here are a few things I found useful:

The post Mid-Career Resumes appeared first on Spinning Code.

LN Webworks: Step-by-Step Guide: Adding Google Directions Module to Drupal

Image removed.

Drupal, with its robust API-first approach, opens up a world of possibilities for seamless communication with various Google services. Amongst all, the Google Directions API stands out as a powerful tool for providing accurate navigation and route planning services. Leveraging Drupal's capabilities, integrating the Google Directions API becomes even more accessible and efficient. 

Before we delve into the Google Directions Module for Drupal development and learn how to implement it, let’s understand Google Direction Module and the crucial prerequisites that would get you prepared. 

CTI Digital: Drupal developer, Viktor, now certified with Acquia's Drupal 10 site builder certification

Image removed.

We have fantastic news to share! Drupal developer, Viktor Tamas, has recently passed the Acquia Certified Site Builder exam for Drupal 10. This achievement is a testament to our team's commitment to learning, strengthening our capabilities while providing great promise for our clients.

Image removed.

Gbyte blog: Use DDEV on Nix and NixOS

NixOS on the Desktop

NixOS on the server is a thing of beauty (check out my last blog post about Hosting Websites on NixOS), but after my Arch installation crapped out, I decided to take it further and also use it on my laptop as a daily driver.

Even though I was aware of the vast number of packages in the Nix repositories, I was still pleasantly surprised to find that almost all of my daily tools were available directly in the stable repository. Even Steam is just one line of configuration away!

However, a crucial work tool of mine, DDEV, was missing from the repositories. DDEV is a tool designed for launching local web development environments for PHP, Node.js and Python projects.

DDEV in the Nix User Repository

With a bit of help from a savvy individual named kraftnix in the Jupiter Broadcasting Nix Nerds matrix group, I was able to create a buildable package of ddev on Nix.

Civic UK: The cost efficiency of investing in your digital presence: a digital agency’s perspective

In the rapidly evolving digital landscape, businesses face a critical decision: to invest in their digital presence or risk falling behind their competitors. As a project manager and an account manager in various digital agencies, I’ve witnessed firsthand how strategic investments in a robust Content Management System (CMS) like Drupal can lead to substantial cost savings and long-term growth. Let's delve into how prioritising your digital presence and structure isn't just an expense, but a smart investment in your business' future.