Search Results

Search found 7920 results on 317 pages for 'drupal cache'.

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

  • 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

  • Drupal view filter to show only one of a certain item

    - by Joel
    I'm fairly new to Drupal, and am using Node Import to take a TSV file and turn it into nodes. I'm hitting a problem, though, with automating updates to the nodes. Again, I'd like to take a Tab Separated Values text file, and load it into my site via Node Import (or whatever else anyone might suggest) and then only show updated Nodes. Here's a specific example: I have a Node with the following info: StoreId Name Address Phone Contact 01 Name1 Address1 Phone1 Contact1 02 Name2 Address2 Phone2 Contact2 etc. The info pulls into the nodes just fine (Thank you Node Import!), but we also want to process updates to the nodes. So far I have two ideas... figure out how to delete duplicate (previous) instances of the same StoreID, or just save the node with the duplicate StoreID (and new other info) and just display the most current version. In Views, I can get it to show the nodes and everything, but I can't figure out how to only display the most recent version of each StoreID. A view of views would work, but I can't seem to get that to work, either. Any ideas or other approaches I could take? Thanks in advance for the help!

    Read the article

  • Drupal 6 vs Drupal 7 performance

    - by lifecoder
    Hi all. I want to start new project and stuck without idea what version to use. I have huge expirience with D6, and also one project (module developement) for D7. It looks like D7 slower, have bigger memory consumption and also have a lack of documentation by the moment. I don't need new CCK, Views and other - looks like I'll coding all features needed as modules. Is D7 have sweet parts now, or better way is develop project under D6? What way you choose for yourself, and why?

    Read the article

  • Correct way to use Drupal 7 Entities and Field API

    - by Martin Petts
    I'm trying to use Drupal 7's entities and field API to correctly build a new module. What I have been unable to understand from the documentation is the correct way to use the new API to create a 'content type' (not a node type) with a number of set fields, such as Body. I'm trying to set up the entity using hook_entity_info, then I believe I need to add the body field using field_create_instance, but I can't seem to get it to work. In mycontenttype.module: /** * Implements hook_entity_info(). */ function mycontenttype_entity_info() { $return = array( 'mycontenttype' => array( 'label' => t('My Content Type'), 'controller class' => 'MyContentTypeEntityController', 'base table' => 'content_type', 'uri callback' => 'content_type_uri', 'entity keys' => array( 'id' => 'cid', 'label' => 'title' ), 'bundles' => array( 'mycontenttype' => array( 'label' => 'My Content Type', 'admin' => array( 'path' => 'admin/contenttype', 'access arguments' => array('administer contenttype') ) ) ), 'fieldable' => true ) ); return $return; } /** * Implements hook_field_extra_fields(). */ function mycontenttype_field_extra_fields() { $return['mycontenttype']['mycontenttype'] = array( 'form' = array( 'body' = array( 'label' = 'Body', 'description' = t('Body content'), 'weight' = 0, ), ), ); return $return; } Then does this go in the .install file? function mycontenttype_install() { $field = array( 'field_name' => 'body', 'type' => 'text_with_summary', 'entity_types' => array('survey'), 'translatable' => TRUE, ); field_create_field($field); $instance = array( 'entity_type' => 'mycontenttype', 'field_name' => 'body', 'bundle' => 'mycontenttype', 'label' => 'Body', 'widget_type' => 'text_textarea_with_summary', 'settings' => array('display_summary' => TRUE), 'display' => array( 'default' => array( 'label' => 'hidden', 'type' => 'text_default', ), 'teaser' => array( 'label' => 'hidden', 'type' => 'text_summary_or_trimmed', ) ) ); field_create_instance($instance); }

    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

  • Drupal image management

    - by vian
    Please suggest how should I approach these requirements. What ready-to-use solutions (modules) are best suited to achieve something like this: What I need is an image library that has searchable, tagged images that are already resized when we publish them. If the author searches the library and the image he needs isn’t there, he can upload one and have it added to the index. The important thing is that images in the library can be sorted into three categories: News images, top story images and feature images so that, over time, we don’t end up with hundreds of images crammed into one folder, thus making browsing a pain (and to prevent someone from something like: Searching for a keyword so they can find an image for the news, picking an image, and then seeing it’s 1600X. 1200). Also, I need something which will assemble thumbnail galleries easily. I don’t want to have to go to the image library, get a URL, go back, paste it in, etc. I should be able to pick, say, 8 images and say “create gallery”. How this objective is achieved is flexible, but I am looking for a shortcut to get around assembling screenshot galleries by hand.

    Read the article

  • Error after installing Classified Ad Module on Drupal 7

    - by Ams
    Hello, i just installed Classified Ad but after the installation i get this error: Notice: Undefined index: type in ed_classified_form_alter() (line 218 of /home3/amineamm/public_html/chrini/sites/all/modules/ed_classified/ed_classified.module). When i look up at the php code i can't figure out how to correct it. Here is my code: function ed_classified_form_alter(&$form, $form_state, $form_id) { module_load_include('inc', 'ed_classified', 'ed_classified_utils'); if ($form['type']['#value'] == EDI_CLASSIFIED_MODULE_NAME) { if ($form_id == 'ed_classified_node_form' && $form['attachments'] && _ed_classified_variable_get('alter_attachment_text', EDI_CLASSIFIED_VAR_DEF_ALTER_ATTACHMENT_TEXT) ) { // Don't allow the attachments block to be collapsed. $form['attachments']['#collapsed']=FALSE; $form['attachments']['#collapsible']=FALSE; // Enhance the help for classified ads. // NOTE: this is appropriate for the upload_image module enhancements only! $form['attachments']['#title']=t('Photo Attachments'); $form['attachments']['#description']= _ed_classified_variable_get('alter_attachment_text_description', t(EDI_CLASSIFIED_VAR_DEF_ALTER_ATTACHMENT_TEXT_DESCRIPTION)); } } } Any suggestion ?

    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

  • Drupal: Views titles

    - by stef
    I have a View that outputs a page. Under Basic Settings I set a "title". When I load the page, I see that title as the page title (at top of the browser) - all good. How can I print this value out in the "Display output" .tpl file? The $title variable doesn't seem to hold any value here. Do I need to use a preprocess function? Thanks

    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 Private Publishing

    - by Kevin
    Is there a way to have a content type that is only viewable to admins AND the person who created it, including comments? I feel like I know the answer to this but its escaping me.

    Read the article

  • Drupal 6: How to quickly theme a view ?

    - by Pierre-Jean Coudert
    I've defined a view with the cck and view2 modules. I would like to quickly define a template specific to this view. Any tutorial or information on this ? What are the files I need to modify ? Here are my findings: (Edited) In fact there are two ways to theme a view : the "field" way and the "node" way. In "edit View", you can choose "Row style: Node", or "Row style: Fields". with the "Node" way, you can create a node-contentname.tpl.php wich will be called for each node in the view. You'll have access to your cck field values with $field_name[0]['value']. (edit2) You can use node-view-viewname.tpl.php wich will be only called for each node displayed from this view. with the "Field" way, you add a views-view-field--viewname--field-name-value.tpl.php for each field you want to theme individually. Thanks to previous responses, I've used the following tools : In the 'Basic Settings' block, the 'Theme: Information' to see all the different templates you can modify. The Devel module's "Theme developer" to quickly find the field variable names. View 2 documentation, especially the "Using Theme" page.

    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

  • Passing data between Drupal module callback, preprocess and template

    - by rob5408
    I've create a module called finder that I want to take parameters from a url, crunch them and then display results via a tpl file. here's the relevant functions... function finder_menu() { $items = array(); $items['finder'] = array( 'page callback' => 'finder_view', 'access callback' => TRUE, ); return $items; } function finder_theme($existing, $type, $theme, $path) { return array( 'finder_view' => array( 'variables' => array('providers' => null), 'template' => 'results', ), ); } function finder_preprocess_finder_view(&$variables) { // put my data into $variables } function finder_view($zipcode = null) { // Get Providers from Zipcode return theme('finder_view', $providers); } Now I know finder_view is being called. I also know finder_preprocess_finder_view is being called. Finally, I know that result.tpl.php is being used to output. But I cannot wrap my head around how to do meaningful work in the callback, somehow make that data available in the preprocessor to add to "variables" so that i can access in the tpl file. in a situation where you are using a tpl file is the callback even useful for anything? I've done this in the past where the callback does all the work and passes to a theming function, but i want to use a file for output instead this time. Thanks...

    Read the article

  • Drupal cck and views

    - by abhishekgupta92
    I have added a new content type event. Now, i have to make a view in which it shows a set of fields if the dateOfEvent (one of the fields) is less than the present date and some other set of fields of the 'event' content if the dateOfEvent is more than the present date. how can I do that in the views.. thanks in advance for helping...

    Read the article

  • A question about Drupal Node and Views

    - by Sushi
    I have created an "Add Question" content-type node which lets users ask questions. The questions have a title, image attachment option, and the content. I am showing the questions which have image as a block by filtering it as "Content: Photofield - list True" in Views. This way, only the questions which have images attached to the question appear in this block. Photofield by the way is the content type. I want to create a new block which only shows the questions which have no attached image. I have done filtering this block view by keeping filters as "Content: Photofield - list False" but in vain. There's also some expose option and I did some messing around with it too without coming to the result I want. Can anyone help?

    Read the article

  • Drupal - Search box not working - custom theme template

    - by vr3690
    Hello, I am using a customised version of search-theme-from.tpl When I use the search box, I do get transferred to the search page. But the search does not actually take place. The search box on the search results page does work though. This is my search-them-form.tpl.php file (demo : <input type="text" name="search_theme_form_keys" id="edit-search-theme-form-keys" value="Search" title="Enter the terms you wish to search for" class="logininput" height="24px" onblur="restoreSearch(this)" onfocus="clearInput(this)" /> <input type="submit" name="op" id="edit-submit" value="" class="form-submit" style="display: none;" /> <input type="hidden" name="form_token" id="edit-search-theme-form-form-token" value="<?php print drupal_get_token('search_theme_form'); ?>" /> <input type="hidden" name="form_id" id="edit-search-theme-form" value="search_theme_form" /> There is also a javascript file involved. I guess it's use is pretty clear from the code: function trim(str) { return str.replace(/^\s+|\s+$/g, ''); } function clearInput(e) { e.value=""; // clear default text when clicked e.className="longininput_onfocus"; //change class } function restoreSearch(e) { if (trim(e.value) == '') { { e.value="Search"; // reset default text onBlur e.className="logininput"; //reset class } } } What can be the problem and how can I fix it?

    Read the article

  • Drupal: can't add the taxonomy field to Views ?

    - by Patrick
    hi, I've prepared a View for my nodes and I've selected which fields to display. I just realized that there is not the taxonomy field from Content:Taxonomy There is only Taxonomy:Term category and warning: "The content might be duplicated, use appropriate filters". Should I use this item ? What kind of filters should I use ? thanks

    Read the article

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