Questions tagged [7]

Version tags should be used for questions that apply to a version only, not to merely say what version a site is using.

Filter by
Sorted by
Tagged with
-1
votes
1answer
1k views

When should the "translatable" tag be added to a query?

I noticed that a Drupal core function is using the following code: $categories = db_select('contact', 'c') ->addTag('translatable') ->fields('c', array('cid', 'category', 'recipients', '...
4
votes
1answer
2k views

Lots of 500.shtml page not found errors in logs

I've been getting lots of page not found errors for 500.shtml in my logs. A lot of them seem to be originating from search spider and ho I might be able to fix these, I'm curious to why 500.shtml is ...
3
votes
2answers
263 views

Can solr point into a certain point in a document?

I have very long documents (around 100 pages when printed) that I need to index with Apache Solr Search. Is it possible to index the pages with solr in such a way that clicking the result from the ...
5
votes
1answer
11k views

drupal_add_js best practice to include inline code or script file

While reading the API page for drupal_add_js, I kept wondering what is the best practice to include inline JavaScript or a JS file. It seems like it works exactly the same even if you omit 'file', '...
70
votes
3answers
12k views

Given that db_select is much slower than db_query, why would I want to use it?

For the background on this, please see http://drupal.org/node/1067802. Given all that, what situations exists where I might want to use db_select(), or should I be relying solely on db_query?
4
votes
2answers
705 views

How to invalidate a views cache based on custom criteria?

I have a custom content type (story) with a datetime field which determines if a story shows up in a the views that list the nodes of that content type; if the datetime defined for a node is newer ...
2
votes
3answers
2k views

Can views pages be indexed and be searchable by apachesolr?

By default drupal will only send nodes to apachesolr, is there a way to send views pages to solr, so that they may show in the search index? I know this question seems a little out there, just ...
3
votes
1answer
270 views

What is the purpose of the PHP class FileTransfer?

What is the purpose of the PHP class FileTransfer? In which cases, should a module deal with that class or one of its child classes?
1
vote
1answer
188 views

What is the difference between the classes ArchiverTar and Archive_Tar?

What is the difference between the classes ArchiverTar and Archive_Tar? Which one is a Drupal module supposed to use?
1
vote
1answer
196 views

Grant access to CCK referenced nodes

I have one content type 'object' that references one or more nodes of content type 'image'. I'm granting access to nodes with TAC Lite: a user can view only content with a particular term. Since the ...
0
votes
2answers
562 views

Panels call custom function

Is it possible to call custom code from a panel? My custom module has a function which returns some content. I wish to call this from my panel.
1
vote
1answer
274 views

What is the access record "content_access: all"? This is overriding my taxonomy access module

I have had problems with my permissions ever since I last rebuilt my permissions. (I did this after working on user reference permissions. This field has no user reference on it) The taxonomy ...
2
votes
1answer
380 views

Is there any security consideration with webform and Salesforce API?

We are implementing the Salesforce webform module for our client and they are asking us if there are any security issues to consider by having SOAP installed on their server. (The Salesforce API ...
5
votes
4answers
901 views

How to get the content owned by the currently logged-in user?

A user is the owner of only one node, and I want to redirect the user, at login time, to his only owned node. How can I get the node content if I know only the logged-in user?
2
votes
3answers
13k views

What is your recommended Banner/Slider module for D7?

I am searching for module that create banner/slider effect for D7. Have a check on this page: http://drupal.org/node/418616 Mostly not yet port to D7. What are your recommend modules?
3
votes
2answers
3k views

How to change default registration form?

By default, user registration form in Drupal 7 takes 2 fields: "Username" and "Email." I want users to set their password directly upon Registration. Take 4 fields: - Username - Password - Confirm ...
3
votes
3answers
2k views

Get the title of the active tab

Is it possible to get the title of the currently active secondary tab? I'd like to re-use the the title of this tab later on in the content. I found menu_local_tasks(1) which comes close, but this ...
9
votes
3answers
20k views

Form Api File upload

I have the following code in my form. $form['new']['upload'] = array( '#type' => 'file', '#title' => t(''), '#size' => 40, ); On the submission handler, it returns the file name but ...
2
votes
1answer
265 views

CCK field value count is never less than 1

I have got a CCK field set up so that unlimited values can be entered upon node creation (number of values: unlimited). When I try to print values in a node with the following code if ($node->...
2
votes
3answers
155 views

Best practice to have a 'category' fields where admin can choose wich voices the user can choose

I have a content type that needs a 'category' field; this can both be a taxonomy vocabulary or a text field (with the select widget), it doesn't really matter. (I won't have more then 5-6 voices at ...
16
votes
3answers
20k views

Removing main content block on frontpage

I'm new to Drupal 7 and I'm looking to replace the frontpage's default main content block with an equivalent block generated from Views (gaining more control over the block in doing so). I have ...
22
votes
14answers
13k views

How do I hide the default page /node?

Drupal out of the box comes with a page (which is the default homepage) that is assigned to the node path. How do I avoid users reach it, and redirect them to the actual homepage of the site?
4
votes
2answers
2k views

Send a CSV file to the user on FAPI form submit

I have a FAPI form that collects some information from the user, then generates a CSV file. The intent is when the user clicks 'export' on the form, the CSV is downloaded straight away. However, when ...
3
votes
2answers
2k views

Creating a view block inside a fieldset using templates

I am trying to create a new .tpl.php for some of my views. I know how to create the file and display the elements the way I want, but only by changing the default views-view.tpl.php which would ...
7
votes
2answers
15k views

How do I get the logo path?

I have a custom logo and I have tried to get his path in this way theme_get_setting('logo_path'), but no expected result. I am using the code in a custom block, in input PHP.
7
votes
2answers
6k views

How do I output an image in a block?

I tried to put this code in a custom block that uses PHP as input format, but it doesn't work in Drupal 7. $settings = theme_get_settings('my theme'); if (!$settings[toogle_logo] = 0) { print '<...
2
votes
3answers
1k views

How to prevent multiple votes in polls of the rate module?

I have installed the rate module, and set the emotion widget. I like this module but after I vote successfully, I can click the vote button again. Instead I want to popup a window which says" you ...
3
votes
3answers
1k views

how can I have a body with more than 64 Kb of data in it?

I've noticed that when I create a node with too much data in the body field subsequent edits will not save. Or rather, the save goes ahead and I am taken back to viewing the node, but the content hasn'...
4
votes
1answer
4k views

Views argument settings

Views 2 for Drupal 6 had settings for the arguments passed to a view. Does Views 3 for Drupal 7 still have those settings? Have those settings been renamed, or removed? This is the partial screenshot ...
2
votes
2answers
755 views

Path associated to Views

I used Pathauto to create URLs for my nodes like gallery/[node:title]. I created a view with an argument, and the path is gallery/% (% is the node title), but when I point my browser to that URL, I ...
2
votes
1answer
930 views

Where can I find the save destination path for a filefield? (via code)

I have an image file field and I am attempting to write a little script that will programmatically scan my nodes and save images found in the body of my node into an image file field entitled ...
11
votes
2answers
8k views

How to set URL alias automatically for a content type WITHOUT using Pathauto? Which hook to implement?

Pathauto can do the job easily for all content types, but in my case I only have one content type URL that needs to be customized, and I would prefer to not install Pathauto and Token. Can anyone ...
3
votes
2answers
357 views

Organic Groups module messes up node editing

Updated header to reflect real cause of problem I've created some content types using node references for "belongs to" or "owned by" relationships. When I add a new node, selecting the node ...
2
votes
1answer
107 views

How should I use a field in views?

I have a CCK field that I want to use in a view. How can I do it?
2
votes
2answers
216 views

Never show the term name if the user has no permission to view the term

I use a vocabulary to freetag bookmarks I post to my site, and I want to hide all the terms (also most nodes; most or all, I don't care). With TAC module I use following setting for a start: global ...
4
votes
2answers
437 views

Image upload & gallery

Is there a way to limit the number of imagefield fields present in a node? I am using iTweak Upload, which allows to upload an unlimited number of images, but I need something that can limit the ...
16
votes
5answers
13k views

After deleting all nodes, how do I reset the node ID to start from 1 again?

I generated tons of dummy content for testing, and then deleted them all. As nid is auto-increment, newly created node will have a nid of last created nid +1. How can I make nid start from 1 again?
4
votes
2answers
2k views

Window Title vs Page Title

Can the Window/Browser title be set separately from the page title (which is displayed in an <h1>)? I'd like to be able to do this in the most direct way possible from code, not using extra ...
4
votes
3answers
11k views

Taxonomy menu with custom path for taxonomy terms

I am trying to make a taxonomy menu using the Taxonomy Menu module with a custom path for the taxonomy terms. Instead of /taxonomy/term/tid I want /proj/!tid (or ultimately /proj/!term-name but I'll ...
7
votes
5answers
12k views

how to overwrite the search box?

<div class="fr_search"> <form action="/" accept-charset="UTF-8" method="post" id="search-theme-form"> <input name="search_theme_form" id="edit-search-theme-form-1" size="...
1
vote
2answers
1k views

Batch API and curl or file_get_contents() issue in Drupal 7?

Has anyone ever experienced issues with curl or file_get_contents() when using the batch API? I'm trying to import nodes from a remote data source via batch API; I used file_get_contents() during one ...
2
votes
1answer
275 views

cck Nodereference for files

I am trying to create a node that has a single file attachment (using CCK filefield), and be able to reference that file by other nodes (possibly more than one node). The application is such that ...
6
votes
3answers
3k views

How to display the same views exposed form block twice?

I'm trying to display the same views exposed from block twice. Once in the left nav and once in content top. With multi block I can clone the block and I am able to display both. However, I would like ...
3
votes
2answers
2k views

How can I make the Book Navigation also show the Summary of the Child Page?

Currently the Book module will create a navigation of links to each of it's children pages. I need that navigation to also include a teaser or summary from the child page. This is for Drupal 7.
2
votes
2answers
338 views

What are the legal considerations to build a service like Drupal Gardens and earn profit from it?

I ask for your help to clarify a doubt I had on the usage and licensing of the Drupal platform to build a commercial project like Drupal Gardens. Today, I have read both licensing and usage rules ...
3
votes
2answers
2k views

How can I obtain the "latest" vid when on Revisioning's "View latest" tab?

I am using the Revisioning module to handle content revisions and I am creating a custom block that needs the vid of the node that the user is viewing to generate the appropriate content. I was trying ...
13
votes
3answers
15k views

How do I add client-side form validation to a Drupal form?

How do I add client-side form validation to a Drupal form? For example, in the comment module. If the vistor don't enter the email address, I want to popup a window that says: "please enter the ...
14
votes
3answers
8k views

NoSQL vs Other SQL Drupal Setups

What are the advantages of running NoSQL (ex MongoDB) over MySQL, PostGRE SQL or MSSQL in Drupal? Are the advantages gained from simply using the storage or does some Drupal configuration need to ...
1
vote
3answers
1k views

Variables used in template.php

How should I know which variables and objects can be used directly in the template.php file?This is what a template.php file created by somebody else contains: function garland_separate_terms($...
3
votes
1answer
434 views

og_members block & og_nodes block won't display content

OG Version: 7.x-1.x-dev My problem is that I can't get the og_members block & og_nodes block to show up under a group page. Breakdown of my process: A fresh install of D7, necessary modules ...