Paul
  • Member for 10 years
  • Last seen this week
Conditional image style in Views
4 votes

Add the image field twice(!) to the fields list. Use the frame style on the first image and the no-frame style on the second. Exclude both fields from display and place them before the checkbox. Next,...

View answer
Internal/External JS don't work with Drupal, but works fine in static HTML/JSFiddle
Accepted answer
4 votes

I've rebuilt the scenario and my guess now is that you don't want the value of the select field but the option text for your parsing purpose. Thus, the script should probably be something like this: (...

View answer
Programmatically find out field name of an Id-field
Accepted answer
3 votes

EntityType provides a function to get field keys: EntityType::getKeys. The result is an array and the id key identifies the property name of the primary field. See https://api.drupal.org/api/drupal/...

View answer
Drupal 7 GetLocations field geocoding off?
Accepted answer
3 votes

The API geocoder may be different from the Maps geocoder (see the FAQ in the API documentation). The results may even vary for users from different users from different countries. For me, Spier Wine ...

View answer
Find latest core version number
3 votes

For Drupal 7, fetch the XML at https://www.drupal.org/node/3060/release/feed?api_version[0]=103 to get the release history. The first item's title contains the latest version. <?xml version="1.0" ...

View answer
Does anyone knows a good menu module?
Accepted answer
2 votes

UPDATE: This answer is no longer valid due to the module not being maintained. Please refer to other menu modules. DHTML Menu may be an solution. It's still in beta for Drupal 7 though. DHTML Menu ...

View answer
How can I save form data on a node in Drupal?
2 votes

In your submit function, you just need to create a node, e.g. $values = array( 'type' => $node_type, // Drop in your desired node type. 'uid' => $user->uid, // Want to set an author? '...

View answer
Scheduling a module to run at a specific time
2 votes

Depending on how detailled your specific time is, you could still use hook_cron. For example, let's say the normal cron runs every hour, you could check date('H') in your module and only if it equals ...

View answer
Views & colorbox trigger, make the colorbox image adapt to screen size
Accepted answer
2 votes

The colorbox-trigger is normally only required when you want to display HTML in your colorbox. You are then required to set height and width as colorbox is not able to determine the dimensions of the ...

View answer
How do I remove the “submitted by” text on Views in drupal 7
2 votes

Since the QA didn't care to explore on his found solution. Assuming your view displays teaser texts / full posts, go to the content type settings (e.g. /admin/structure/types/manage/page for Basic ...

View answer
Convert an already created custom content type into a new module
2 votes

Take a look at the Features module. It allows you to export content types as features which can then be installed similar to modules.

View answer
How do I theme a form element?
2 votes

You should be able to wrap form elements with #prefix and #suffix: $form['submit'] = array( '#type' => 'submit', '#value' => t('Submit'), '#attributes' => array('style' => "padding: ...

View answer
Drupal 7: fetchField(0) giving me half of the records!
2 votes

Yes, the loop iterates through result, but additionally you do that kind of again in your line $value = $result->fetchField(0);. This should be changed to $value = $record->name;.

View answer
translate interface search exact keyword
Accepted answer
2 votes

No, there isn't any way to do that through admin interface. The string search is based on the LIKE condition which includes hardcoded placeholders (%) to search for all strings containing your ...

View answer
Is there a way to prevent content from being selected for copying or being printable for Drupal sites?
2 votes

As MPD already mentioned, it is not really a Drupal problem but rather more general. Something that might help in your case is Cufon, a method to replace text with images. It's somewhat obsolete now ...

View answer
I want my LinkItem to get target="_blank" if my node has the checkbox checked
Accepted answer
1 votes

According to your answer to my comment on the question, you are using a view. To have my solution work, it needs to display fields, not teasers. First off, you do not need to add an additional field ...

View answer
How do I get a view to display as themed within a simplenews html email?
1 votes

This sounds very similar to what I did a while ago. I documented my setup on drupal.org. This seems to work for your already. I think your MailSystem is the source of error here. Make sure the ...

View answer
Module that allows visitors to suggest modifications on a node
Accepted answer
1 votes

Apart from the notifications, Workbench along with Workbench Moderation seems to meet most requirements. Drupal only has two states for nodes: unpublished and published. With Workbench Moderation, ...

View answer
How to attach a single node multiple times to an entity (e.g. badges)?
Accepted answer
1 votes

Somehow it kept slipping my attention, I was probably focussed too much on specific ideas, but as it turns out, there is already a module for that, it's simply called Relation. It's not that straight ...

View answer
Link node/teaser to view
1 votes

Your description is a bit mixed up regarding the terms you use. Here's what I understand and how I would do it. (1) You have a content type 'model' which is used to describe the individual model. (2)...

View answer
do thumbnail image styles lower the page load
Accepted answer
1 votes

Uploaded images are scaled depending on the preset you choose for display. Thus, a typical high resolution image which might have 8 MB is reduced to maybe 150 kB when using a thumbnail preset. This of ...

View answer
D7 Views: Rewrite multiple field into one with custom separators
Accepted answer
1 votes

My solution to overcome the issue now is not purely through views settings but involves some CSS. First, I removed all commas and instead rewrote the fields to <span class="methods">[methods]&...

View answer
Translation of fields
1 votes

View the page this item is supposed to appear on, Drupal will encounter the item and add it to the translation interface again.

View answer
How to make blocks contextually aware of current webform page
Accepted answer
1 votes

This is currently not possible through the default UI due to the URL of all webform pages being the same. There are two possibilities as far as I know. (1) If your blocks only show help texts or any ...

View answer
Drupal search - 2 search pages using their own settings
Accepted answer
1 votes

First, I would consider to use Views along with exposed filters to create your special "search" pages. E.g. create a view which only lists blog entries and then add a filter for body text to it. My ...

View answer
How to add number format function in decimal results in views 3
Accepted answer
1 votes

You could rewrite the field output and use PHP to adjust it to your needs. EDIT: To be able to actually use PHP in your rewrite rules you need an additional module called Views Custom Field.

View answer
Correct way to link to views (to solve multi-domain problem)
Accepted answer
1 votes

Since you obviously are capable of PHP, the best way I can think of is to write a custom wrapper for l(), something like: function ml($text, $path, int $domain = NULL, array $options = array()) { ...

View answer
Display user role with the Advanced forum module
1 votes

In advanced forum module edit advf-author-pane.tpl.php in your chosen forum theme and and below print $account_name; you'll need a similar line like print implode(', ', $account['roles'];. It should ...

View answer
How can I include standard bits of text in a node, depending on the node location or a particular term?
1 votes

If you create a new content type, say "Location Description", you could add a node reference field into your hotel content type referencing the respective location node.

View answer
Bypass publish approval on content creation for a certain role
1 votes

This sounds like you might need a module to moderate content (especially if the content may be changed after publishing and these changes need to get approved again before being published). In Drupal ...

View answer