Drupal StackExchange

Displaying the contents of a document file (doc, docx, etc.)

2 days ago

I'm looking for a way to display the contents of an uploaded document file such as a .docx file.

In Drupal 6 I used the iPaper module which did the trick as all I needed was api code to connect with the service, and the documents were able to be kept private.

But for Drupal 7, I'm pretty sure the File entity (fieldable files) module should do the trick, but I'm not able to get it working for any files other than .txt.

There are some Google viewer modules which I'm not sure what added functionality they have over the above module, but those don't appear to work correctly. One of them requires that files are public domain which doesn't work for this project due to privacy requirements.

Some other modules like group docs viewer and ajax docs viewer charge a hefty monthly fee for displaying rendered files, but all I need is a simple open source docx viewer.

What is the best way to proceed? Which modules are stable for production use?

Best case would allow for user upload, file contents displayed under the actual file attachment, and the rendered document editable for the user.

Note: i've gotten the google docs module to work but that doesn't allow for private files. google needs to access the file publicly in order to render. scribd field also works to some extent but has too many errors and bugs still. looking for a better, simpler solution.

droopie

How to process html in twig file

2 days 2 hours ago

I've a plain text field, where I've added few text in wrapped in tag. I've tried to get the processed html text in the twig by using

{{ content.field_front_page_description|field_value }} {% set text = content.field_front_page_description|field_value %} {% set build = { '#type': 'processed_text', '#text': text|render, '#format': 'full_html', } %} {{ kint(build) }} {{ build }}

But it is returning an array with not processed text. How do I do that

Fazeela Abu Zohra

Displaying the submitted values in a table

2 days 3 hours ago

I created a custom form and after the form is submitted I need to display the submitted data in a table. This seems like a very simple problem. I am able to use dpm() and drupal_set_message() to display data submitted from the form in mymodule_form_submit($form, &$form_state); however, I can't output it to a table.

I have 3 field values

$form_state['redirect'] = 'some/path/' . $form_state['values']['my_value'];

Using this I can send just 1 value. But how can I send an array with this? Query string may appear to be very long.

akshata

How do I filter the current year?

2 days 5 hours ago

Initially, I have installed the Token module and created a Views block containing years.

I want to filter out the current year from the block (it should not show the current year).

In filter criteria, I have changed content:year ([current-date:custom:Y]), but it is not filtering the current year, and it is showing as follows:

  • 2013(3)
  • 2014(5)
  • 2015(6)
  • 2016(2)

I am expecting the output to be as follows:

  • 2013(3)
  • 2014(5)
  • 2015(6)

How can I achieve this? Any help is greatly appreciated.

logeshvaran

Customise Webform Email Submission Data

2 days 5 hours ago

In the webform-mail.tpl.php template, it outputs the main form data using:

[submission:values]

I am using the html format (using mime-mail) and this outputs to the email html in the form:

<div><label>Name</label>Name value</div>

Is there a way I can customise the output so that it doesn't use the label field and uses a <p> tag instead?

The problem with the <label> tag is that I cannot style it in Microsoft Outlook as it ignores all styling for this tag, and the email is quite difficult to read/understand.

Ben

Drupal 10: Minimum number of selections required

2 days 7 hours ago

Is it possible to require at least 5 out of 10 checkbox options to be selected in one web form field usung webform_validation module or built in custom properties?

I'm new in D10, In D7 I was using webform_validation and "Minimum number of selections required".

I could but don't wan't to use any hooks and custom functions.

.... EDIT: Why so much down vote, but no one point any solution ?

Artur Śmigielski

how do I build a dynamic URL in views?

2 days 7 hours ago

I am using drupal 7, have a content type and two taxonomy categories, size and shape.

Im trying to build a dynamic url such as mysite.com/node/nid/tid/tid, which would get rewrote as e.g mysite.com/page-1/large/square.

I want the content of the url to just show the node, so in this case node/1. But I am also going to make 2 blocks one for category size and another block for category shape which will get the relevant IDs from the url and show the relevant content, in this case block 1 will show large and block 2 will show square.

I thought I could generate the page in views by setting the URL to node/%/%/% or node/%// and setting arg 1 to nid, but this comes back as page not found.

So I am wondering is this possible in views if not how can I create a url such /arg1/arg2/arg3 which represents /a nid/a category 1 tid/a category 2 tid, and then populate the page dynamically?

Thanks for any help

edit/

So I have got the arguments working. mysite.com/%/%/% by setting the last argument as the target page rather than the first argument. But how can I rewrite the url. So arg1 becomes node title, arg2 becomes term id 1 and arg3 becomes term id 2 title?

Sam Healey

Drupal Planet

Chapter Three: National Nurses United: Supporting a Large Website

2 days 7 hours ago
At Chapter Three we do more than build websites from the ground up. We also support existing websites that require new or additional resources. The type of work we do is flexible and depends on the client’s needs. It ranges from basic maintenance and security updates to more substantial overhauls, cleanup, and feature enhancements.  One major website we support is National Nurses United (NNU). With nearly 225,000 members, NNU is the largest union and professional association for registered nurses in the United States. It is the country’s leading advocate for collective bargaining for RNs, regulatory protections for patients and nurses, and for guaranteed health care and expanded medicare.

Drupal Association blog: 5 Reasons to Join Us at DrupalCon Portland 2024

2 days 7 hours ago

Discover Why DrupalCon Portland 2024 Is the Must-Attend Event of the Year

If you're part of the Drupal community or interested in Drupal, you won't want to miss DrupalCon Portland 2024! The conference is set to be the most exciting and informative event of the year, catering to developers, marketers, content editors, content publishers, and anyone else who interacts with their website. In this blog post, I'll outline the top five reasons why attending DrupalCon Portland in 2024 is a must.

Immerse Yourself in the Ultimate Drupal Experience

DrupalCon Portland 2024 promises an entire week dedicated to Drupal and the vibrant Drupal Community. It's your chance to connect with some of the most brilliant minds in the industry, engage in discussions, build lasting friendships, and simply have a fantastic time. Key highlights of the event include:

  1. Foster Community Through In-Person Connections: Experience the warmth and synergy of the Drupal community by connecting face-to-face with fellow Drupal enthusiasts. This is a unique chance to share your passion for Drupal with like-minded individuals in a vibrant, engaging setting.

  2. Driesnote & Eminent Speakers: Gain insights from the Drupal founder during the much-anticipated Driesnote and learn from a lineup of distinguished speakers. These sessions promise to be thought-provoking, offering deep dives into various aspects of Drupal, its ecosystem, and future directions.

  3. Contribution Opportunities: Participate in contribution sprints where you can tackle real-world problems, contribute to the project, and interact with key project contributors and maintainers. This is your chance to make a tangible impact and glean insights from the guardians of the Drupal codebase.

  4. Social Gatherings and Welcome Party: DrupalCon isn't just about learning; it's also about having a great time. The Welcome Party and other social events provide perfect settings to unwind, celebrate, and build friendships in a more relaxed atmosphere. View the social events or submit yours now.

  5. Birds of a Feather Sessions: Engage in "Birds of a Feather" (BoF) sessions, where small groups gather to discuss hot topics and share knowledge on specific areas of interest within Drupal and technology. These small gatherings encourage open dialogue and are a great way to dive deep into subjects you care about with peers.

Rediscover the Thriving Drupal Community

After years of remote work and lockdowns, DrupalCon Portland 2024 provides a refreshing opportunity to step out of your home office and connect with passionate Drupal enthusiasts. Meet the faces behind your favorite modules and engage with like-minded individuals who share your love for Drupal.

Unparalleled Learning Opportunities

DrupalCon offers unparalleled opportunities for learning and growth. From inspiring keynotes and informative sessions to hands-on training and contribution sprints, this event is the ultimate platform to expand your knowledge and expertise. Break out of your routine and explore the full potential of Drupal.

This year will be filled with broader topics to help you drive your digital experiences forward. Some of the new highlights this year include:

  1. A new marketing track dedicated to driving your business goals forward.
  2. Artificial Intelligence (AI) - Learning how AI is being incorporated into Drupal and how it can help you improve your day to day and achieve your goals.
  3. Birds of a Feather - More structure and planning going into our BOF sessions to drive higher levels of engagement and inform stronger conversations.
Be Inspired by Innovations

Witness the transformative power of Drupal and be inspired by the innovative and talented Drupal community. Attendees at DrupalCon Portland are focused on:

  1. Crafting cutting-edge content management systems.
  2. Delivering groundbreaking customer experiences.
  3. Mastering their craft and pushing boundaries.
Forge Valuable Connections

DrupalCon Portland is the perfect environment to connect with individuals who share your passion for Drupal, open-source technology, and delivering top-notch digital experiences. Building relationships here can significantly impact your career, opening doors to exciting opportunities.

There are countless reasons to join us at DrupalCon Portland 2024, and we can't wait to welcome you! It's a unique opportunity to connect with the Drupal community, discover the incredible work happening within Drupal, and spend quality time with friends and colleagues from around the world who share your common passion. We look forward to seeing you there!

Register now for DrupalCon Portland 2024.