Search Results

Search found 1578 results on 64 pages for 'drupal fapi'.

Page 2/64 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How do you separate the template of a blog block in Drupal?

    - by Ralph
    Hi, In Drupal, I created a block using views. This block contains the latest blog entries. I've placed this on a specific page to display it as an archive. Now, as for the blog itself (for example when one of them is clicked), A blog template for it depends on node-blog.tpl.php. My problem is, when I style node-blog.tpl.php, the block I created for the archives (as it displays on the page) gets affected. For example if I add TEST on node-blog.tpl.php, I will also get that on the block for every entry. I think it's because it is associated to a blog entry? What I want is to have node-blog styled "alone" when blog entries are viewed individually and not get the other entries on the blocks on the archive page be affected. How should I do this?

    Read the article

  • Is it possible to add custom fields to a Drupal taxonomy term?

    - by user278457
    I'd like to add a date field to a drupal taxonomy term, alongside the default "title" and "description" Is there some technique/php/module that lets me do this? Is it possible to do with CCK?? I need to be able to display the new field in the same view presenting the content nodes referencing the term. At the moment, I've added a date field to the content nodes with CCK, and it's displayed by the view. But that's not exactly what I'm going for, I just want to update one date per term.

    Read the article

  • Problems in user - registration module in DRUPAL

    - by Nitz
    Hello Guys, I have some problem in drupal registration page. I want to change whole user registration page. in registration module i want to add new field type. Bcz i want that user can choose the date from date-time picker. I have ready date-time picker which i have implement, but i don't know where to put that code. I want to add validation on new added text fields. Means i have added one text field for Phone no, so now i want to check if user had only entered the numbers.....in new user registration page. Thanks in advance Nitish

    Read the article

  • Drupal CCK field type with complex fAPI child fields

    - by Cliff Smith
    This question is basically a follow-up to this one: http://stackoverflow.com/questions/1640534/drupal-custom-cck-field-with-multiple-child-fields I need to build a CCK field type that stores several pieces of data, and fAPI form elements to accept the input for each piece of data already exist. These elements are built out into multiple HTML form inputs with fAPI #process functions. The problem is that when I try to use these elements in my CCK field, the input from the widget doesn't line up with the database columns specified in hook_field_settings(). The widget returns something like this: Array ( [thumbnail_image] => [imceimage_path] => ... [imceimage_alt] => ... [imceimage_width] => ... [imceimage_height] => ... [user_address] => [address_number] => ... [address_street] => ... [address_city] => ... [address_state] => ... Unless there's a way to specify "sub-columns" in hook_field_settings(), it appears to me that I can't use form element types with sub-elements in CCK fields. I've tried using CCK field validation to pull out the "imce_xxx" values from thumbnail_image and likewise with user_address, but that doesn't get me anywhere. Is it not possible to use form elements with child elements in CCK field definitions? Thanks, Cliff Smith

    Read the article

  • drupal - override form action?

    - by n00b0101
    I originally started this question in another thread, but that thread was sorta, kinda answered, and now I primarily want to know how to specify another form action... I tried using the code below, but the form action, when output, remains unchanged, although looking at the print_r($form), it's correctly changed... Why isn't it picking up? function mytheme_user_profile_form($form) { global $user; $uid = $user->uid; //print '<pre>'; print_r($form); print '</pre>'; $category = $form['_category']['#value']; switch($category) { case 'account': $form['#action'] = '/user/'.$uid.'/edit?destination=user/'.$uid; break; case 'education': $form['#action'] = '/user/'.$uid.'/edit/education?destination=user/'.$uid; break; case 'experience': $form['#action'] = '/user/'.$uid.'/edit/experience?destination=user/'.$uid; break; case 'publications': $form['#action'] = '/user/'.$uid.'/edit/publications?destination=user/'.$uid; break; case 'conflicts': $form['#action'] = '/user/'.$uid.'/edit/conflicts?destination=user/'.$uid; break; } //print '<pre>'; print_r($form); print '</pre>'; //print $form['#action']; $output .= drupal_render($form); return $output;

    Read the article

  • Default values for Content Taxonomy fields in Drupal with Hierarchical Select widget

    - by lazysoundsystem
    I'm trying to set the default value for a Content Taxonomy field in a hook_form_alter, but can't pin down the necessary format. I've tried this and many variations: foreach (element_children($form) as $child) { // Set $default_value. if ($form[$child]['tids']) { // This, for Content Taxonomy fields, isn't working: $form[$child]['tids']['#default_value'] = array('value' => $default_value); dsm($form[$child]['tids']['#default_value']); } else { // This, for other fields, is working: $form[$child][0]['#default_value']['value'] = $default_value; } } Can anyone tell me what I'm missing? Edit: In response to Henrik Opel (thanks for getting involved), here is the print out of the relevant field of the form with my changes to the default fields commented out, showing the '#default_value' field I'm trying to influence. It also shows that the option widget I'm using is Hierarchical Select (could this be a factor?). In the dsm() in the code above, the changes to the default value are recognised, but they don't get processed later on. field_name_of_content_taxonomy_field (Array, 3 elements) #tree (Boolean) TRUE #weight (String, 1 characters ) 5 tids (Array, 7 elements) #title (String, 10 characters ) Vocabulary_name #type (String, 19 characters ) hierarchical_select #weight (String, 1 characters ) 5 #config (Array, 15 elements) // 15 elements here #required (String, 1 characters ) 0 #description (String, 0 characters ) #default_value (Array, 0 elements)

    Read the article

  • form layout in drupal from a module

    - by EricP
    I created my own module called "cssswitch". I'm trying to create my own html layout to display the admin form portion of the module. I understand how to use the hook_form_alter() to modify form elements, but I need to create the entire form layout to make some fields appear next to each other. It seems I need something like the way I have the frontend view of the node displayed with theme_cssswitch_display(), but for the admin part of the node. function cssswitch_form_alter(&$form, $form_state, $form_id) { switch($form_id) { case 'cssswitch_node_form': $form['hour_start']['#prefix'] = '<div class="start-box">'; $form['ampm_start']['#suffix'] = '</div>'; $form['ampm_start']['#attributes'] = array("style" => "border-width:2px;"); break; } } function cssswitch_theme() { return array( 'cssswitch_display' => array( 'arguments' => array('node'), ), ); } // to display the view of the node function theme_cssswitch_display($node) { $output = '<div class="cssswitch-cssfilename">Filename: '. check_plain($node->cssfilename). '</div>'; $output .= '<div class="cssswitch-time_start">Start: '. check_plain($node->hour_start). ':'.check_plain($node->minute_start).' '.check_plain($node->ampm_start).'</div>'; $output .= '<div class="cssswitch-time_end">End: '. check_plain($node->hour_end). ':'.check_plain($node->minute_end).' '.check_plain($node->ampm_end).'</div>'; return $output; } thanks for any help

    Read the article

  • Drupal Studs help me with my form_alter hook ( I am almost there)

    - by user363036
    So I think I am almost there conceptually but need some missing pointers. Objective is to add a few more fields to the normal user registration form, style it a little, then submit it with storing the extra fields in a table. This is what I have so far. Can someone give me the final nudge and get me going. Please help me. Also how do I apply some minor styling like aligning the new form fields ? Thank you so much !!!!!!!!! function module_menu() { $items = array(); $items['school/registration'] = array( 'title' = 'Upgraded Registration Form', 'page callback' ='module_school_register', 'type' = MENU_CALLBACK ); return $items; }//end of the function function module_school_register(){ return drupal_get_form('form_school_register'); }//end of the function function module_school_form_alter(&$form, $form_state, $form_id) { dsm($form_id); if ($form_id == 'user_registration_form') { // modify the "#submit" form property by prepending another submit handler array $form['#submit'] = array_merge( array('_module_registration_submit' = array()), $form['#submit'] ); } } function _module_registration_submit($form_id, $form_values) { // store extra data in different table } function module_registration_validate($form, &$form_state) { $error=0; //Validation stuff here, set $error to true if something went wrong, or however u want to do this. Completely up to u in how u set errors. if ($error) { form_set_error('new_field_name', 'AHH SOMETHING WRONG!'); } }

    Read the article

  • How to get rid of Drupal CSS stylesheets?

    - by unforgiven
    I am trying to accomplish the following. I need to use Drupal 6 as a project requirement, but I want to use it with my own HTML and CSS stylesheets for each node/view/panel etc. The problem is, whatever the theme, I always found that Drupal applies to my HTML content both my CSS stylesheets and the CSS related to the theme chosen. I have also tried, without success, using the stylestripper module (installed in sites/all/modules). No matter what I do, additional CSS stylesheets are applied to my pages, completely destroying my layout. What is the proper way to achieve this? Why stylestripper does not work at all? Is there a completely blank theme available? I have tried basic, mothership, zen etc, but I always see additional CSS stylesheets applied to my pages. This is driving me crazy, Drupal was chosen by someone else for its flexibility. Thank you in advance.

    Read the article

  • Drupal: Template Files, Modules and Content Types for Advanced Theme

    - by theandym
    Intro I am in the process of trying to convert my first HTML/CSS design into a theme for Drupal. I have used ModX for quite a few designs and appreciate the ability to create different page templates and custom variables to be assigned to those templates. However I seem to be having some issues making the transition. The site I am working on theming in Drupal is for a real estate agent. Each page/section will have a different set of content associated with it and will need to display only that content. For example, there will be a page for current listings, each of which will be formatted by a custom content type. However, when I call the content on the home page (or on other pages) I do not want to see this listing data. Layout The layout of the site and the regions associated with each page/section is as follows: Home Spotlight Featured 1 Featured 2 About Spotlight Bios - Profiles of each agent (each will be a node with name, contact info, pic, etc) listed on the page; multiple nodes listed Sidebar Listings Spotlight Listings - Profiles of properties (each will be a node with locations, basic info, pic, etc) listed on the page; multiple nodes listed Sidebar Services Spotlight Content - general paragraph text area Sidebar News/Blog News/Blog Items - List of stories with summaries and links to full article Sidebar Each page/section will use the same header and footer. Issue I have done some reading on Drupal, custom content types (and CCK), Views, and Pathauto. However I have not been able to get a clear picture of how to put it all together to accomplish what I am attempting. What I really would like to know is which modules to use, how best to use them, which elements I need to use where, and what template files I should be using to theme the elements I need to use. Any help or reference to useful resources would be much appreciated.

    Read the article

  • Count rows in Drupal views plugin

    - by Rimian
    I've written myself a Drupal Views row plugin and I want to count the rows so I can do something with the output every Nth row. I can do this in the plugin's preprocessor function but if it gets used more than once (in panels for example) I can't reset the counter to zero. Can someone point me in the right direction here?

    Read the article

  • Registering Drupal Menu Paths?

    - by Kevin
    If I am making a module, and want to have two custom paths: path/path/path/index.htm (calls drupal_get_form) and post to path/path/path/result.htm How do you do that? I get a 404 on the second path. I get the form and what I want with the first path easily enough. All I want to do is theme the form results as a drupal table and display it here.

    Read the article

  • Drupal Views Question: Displaying results in two columns?

    - by Jonathan
    I'm new to drupal and I have a question about views: I'm building an employee directory and need to display the results in two columns, such as: Record 1 Record 2 Record 3 Record 4 Record 5 Record 6 . . . How can I accomplish this? To take it one step further, I want each record formatted as: IMAGE NAME TITLE I have no idea where to start. Any assistance is appreciated!

    Read the article

  • How to implement hook_theme in drupal 7?

    - by solomon_wzs
    I created a new drupal 7 theme and trying to implement hook_theme at template.php like this: function mytheme_theme($existing, $type, $theme, $path){ return array( 'mytheme_header'=>array( 'template'=>'header', 'path'=>$path.'/templates', 'type'=>'theme', ), ); } then I placed header.tpl.php into templates directory and cleared all caches, and call theme function: theme('mytheme_header', $vars); but it did not work and render page with header.tpl.php. What's wrong with my code?

    Read the article

  • Drupal 7 Forms API Conditional Logic not working in IE

    - by Francis Yaconiello
    I have a drupal 7 form with a bunch of fields: $form['account_type'] = array( '#title' => t('Utility Account Type'), '#type' => 'select', '#options' => necp_enrollment_administration_portal_account_type_options(), '#required' => TRUE, '#default_value' => isset($form_state['values']['account_type']) ? $form_state['values']['account_type'] : '', ); // Should show if account_type = 1 $form['home_wrapper'] = array( '#type' => 'fieldset', '#states' => array( 'visible' => array( ':input[name="account_type"]' => array('value' => 1), ), ), ); $form['home_wrapper']['first_name_1'] = array( '#title' => t('Primary Account First Name'), '#type' => 'textfield', '#default_value' => isset($form_state['values']['first_name_1']) ? $form_state['values']['first_name_1'] : '', '#states' => array( 'required' => array( ':input[name="account_type"]' => array('value' => 1), ), ), ); $form['home_wrapper']['last_name_1'] = array( '#title' => t('Primary Account Last Name'), '#type' => 'textfield', '#default_value' => isset($form_state['values']['last_name_1']) ? $form_state['values']['last_name_1'] : '', '#states' => array( 'required' => array( ':input[name="account_type"]' => array('value' => 1), ), ), ); // Should show if account_type = 2 $form['business_wrapper'] = array( '#type' => 'fieldset', '#states' => array( 'visible' => array( ':input[name="account_type"]' => array('value' => 2), ), ), ); $form['business_wrapper']['company_name'] = array( '#title' => t('Company/Organization'), '#type' => 'textfield', '#default_value' => isset($form_state['values']['company_name']) ? $form_state['values']['company_name'] : '', '#states' => array( 'required' => array( ':input[name="account_type"]' => array('value' => 2), ), ), ); In Firefox/Chrome/Opera all versions this form behaves as it should. However in all versions of IE the form initializes with display:none; style on all of the conditional fields regardless of what the value in account_type is. Changing the selected option of account_type does not effect the hidden status. Any tips on debugging this form would be awesome. Notes: I am not much of a Drupal developer, I inherited this site. Just trying to iron out the last couple bugs so we can go live there are more fields than are listed above, I just gave you some of the applicable ones so that you could get the gist of how my forms were setup current url for the form in development: https://northeastcleanpower.com/enroll_new I'm using http://www.browserstack.com/ to debug IE 7 - 10pp4 (I think we only have to support 8 and up though) I've also tried: ':select[name="account_type"]' => array('value' => 1), '#edit-account-type' => array('value' => 1),

    Read the article

  • Drupal join on taxonomy terms

    - by ciscoheat
    I have a Drupal setup like this: Content type: Apartments Vocabulary: Areas, that can be used with Apartments. Content type: User profile, with a Content Taxonomy Field for Areas so users can select what areas they are interested in. I would like a view that shows all the user profiles that matches the apartments in their area. A "User profile <- Areas <- Apartments" join in other words. I've been mucking around with the views interface for a while but it's not clear to me how the relations can be setup to achieve this. Can someone give me a hint? In case this cannot be easily solved with views, what is a good way of doing it otherwise? Thanks for your help.

    Read the article

  • Drupal: Views: exposed Taxonomy filter: additional functionalities

    - by Patrick
    hi! I'm using Drupal Views with an exposed filter (improved with better exposed filters module) based on taxonomy. I have a list of nodes and for each node I assigned several tags. I would like to add the following functionalities to the filter: 1 - when few tags are selected, I would like to disable all tags that are not possible to combine with the selected ones. In other terms, disable a tag if it is not visible in the filtered nodes. In this way I highlight only a subset of tags, to help the user to continue filtering the content. 2 - when I move the mouse over an article I would like to highlight the tags that are associated with such node with a different color. That is, if I selected TAGA, and the node also contains TAGB, and TAGC, I would like to highlight the last 2 tags if I move the mouse over the node. thanks

    Read the article

  • Drupal: Content in blocks from node_reference fields?

    - by Marco
    After only a few weeks of working with Drupal I've come up with a recurring problem, which I don't really have an optimal solution to, so I'm hoping that someone here might be able to give some best practice pointers. What I have is a region inside my node.tpl.php, which is populated with blocks that display content from two different CCK fields of the type node_reference. This works fine when displaying a single node. The problem appears when I need to use a view. For example, lets say I have a news listing, and a single news item view. When I display the single news item I can use the news node node_reference field to reference whatever material I would like to have in my sidebar, but when on the news listing view I would like to reference nodes separately. What would be the best practice to solve this? I'm having a few ideas, but none seem like the logical choice, how would you do?

    Read the article

  • drupal's hook_preprocess_page not working as expected

    - by Peter Carrero
    i am having an issue where hook_preprocess_page 's changes to &$variables is not being rendered, even though it is the last item under $theme_registry['page']['preprocess functions']. logging contents of $variables to a file show the contents changed, but contents appear unchanged on the site. flushed all cache on drupal, flushed all browser caches and still the same result. /** * Implementation of hook_preprocess_page(). */ function grinchlist_preprocess_page(&$variables) { if (grinchlist_usercheck($variables['user']['uid'])) { $variables['scripts'] = preg_replace('/<script[^>]*christmas_snow.*<\/script>/','',$variables['scripts']); } file_put_contents('/tmp/vars.txt',print_r($variables,true)); } the /tmp/vars.txt shows the variables properly, but the browser still show the script being loaded. this may be a silly example, but i've had this issue with the hook_preprocess_page in other instances and it would really help out to understand what is going on here... thanks.

    Read the article

  • Add image gallery to node in Drupal

    - by vian
    I'm using Image module for Drupal 6 and the submodule of Image Gallery. Image gallery is identified by taxonomy term of certain vocabulary. What I need is to attach Image Gallery View supplied with Image Gallery to certain node. I am now trying to use Views Attach to do this. But how can I pass an argument of taxonomy term for gallery to the view? Also I added the taxonomy term for gallery to be defined for both images and my node type. Is it ok?

    Read the article

  • Basic PHP question for Drupal Views theming

    - by oalo
    My PHP and programming knowledge is extremely basic, so this is probably a dumb question: I am theming a View in Drupal 6, and I want to add an id with a consecutive number to each item in the view (first item would have the id #item1, the second #item2, etc). I am customizing the style output (views-view-unformatted--MYVIEWNAME.tpl.php) and the row style output (views-view-fields--MYVIEWNAME.tpl.php), and I want to add a counter variable in the foreach loop in the style output tpl, and then use that variable in the row style output tpl, but the last one is not recognizing the variable. It does not give me any errors, but doesnt print the number. I understand this has probably something to do with variables visibility, how can I declare the counter variable in the style .tpl so I can the use it in the row style .tpl? Thank you

    Read the article

  • Drupal - Getting node id from view to customise link in block

    - by hfidgen
    I got a little problem with Drupal (again) in that I'm trying to work out how I can build a block which is able to show the node ID of the view page the block is currently sitting on. I'm using views to build a large chunk of my site, but I need to be able to make "intelligent" blocks in PHP mode which will have dynamic content depending on what the view is displaying. So.. how can I go about finding the $nid which a view is currently displaying?! Any ideas?

    Read the article

  • Combining multiple content types into a single search result with Drupal 6 and Views 2

    - by Chaulky
    Hi all, I need to create a somewhat advanced search functionality for my Drupal 6 site. I have a one-to-many relationship between two content types and need to search them, respecting that relationship. To make things more clear... I have content types TypeX and TypeY. TypeY has a node reference CCK field that relates it to a single node of TypeX. So, many nodes of TypeY reference the same node of TypeX. I want to use Views 2 to create a search page for these nodes. I want each search result to be a node of TypeX, along with all the nodes of TypeY that reference it. I know I could just theme the individual results and use a view to add the nodes of TypeY to the single node of TypeX... but that won't allow users to actually search TypeY... it would only search TypeX and merely display some nodes of TypeY along with it. Is there anyway to get the search to account for content in nodes of both content types, but merge the TypeY results into the "parent" node of TypeX? In database terms, it seems like I need to do a join, then filter by the search terms. But I can't figure out how to do this in Views. Thanks for any help i can get!!!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >