texts:
I'm bad with words, so hopefully I can get this across clearly. I'm using Views and the dRealty module. I've tried using relationships, and it's a no go.

I made a Views block of an "Agent" content type that has an agent_id (field_agent_id) text field. The dRealty module creates listings by pulling data from a RETS server, and the agent id (field_listing_agent_id) comes through as a text field. I need to show the data of the agent with the id that matches the listing on the node. How can I pass the field from the node into the Views block?

I'm using Views PHP to filter and I'm referencing How to Filter view by comparing 2 fields, but no luck.


texts: Add a filter to my view before executing

texts:
I have a view and I want to get it's results.

$nview = views_get_view('tasks');
$nview->set_display('page');
$nview->pre_execute();
$nview->execute();

If I have 'nid' filter added to my view, I can modify it and get my view filtered.

$nview = views_get_view('tasks');
$nview->set_display('page');
$nview->pre_execute();
$nview->display['page']->handler->handlers['filter']['nid']->value['value']=180;
$nview->display['page']->handler->handlers['filter']['nid']->operator='=';
$nview->execute();

But what do I need write to add a filter if no filter present in view settings of my view?

$nview = views_get_view('tasks');
$nview->set_display('page');
$nview->pre_execute();

//some code here

$nview->execute();

UPD: Unfortunately, I can't use hook_views_query_alter because I need to use my code in my custom function which accepts view's name as an argument.
My target is to alter any view which name passed as an argument to my custom function.
So I need to alter filter/query only if I need get view's result and the view executes from my function. But if the view executes from it's page or block it needs to be executed without altering.


texts: Detect mobile device and redirect only specific URLs

texts:
We are using Acquia Mobile Redirect module to detect mobile device and redirect accordingly and it's working correctly on Acquia cloud. Its redirecting every request on mobile device.

But the request is to redirect only main domain not all the URLs.

For Example : when user entered www.example.com, then user should redirect to m.example.com and if user entered www.example.com/blog then don't redirect.

Question:

Is this can be done at Varnish/LBS level?
Is there any other module which support this kind on functionality?


texts: How do I disable Drupal 7 Theme Debug? "drush vset theme_debug 0" NOT WORKING

texts:
I enabled theme debug on my drupal 7 installation using drush vset theme_debug 1, But Now I can't disable theme debug using drush vset theme_debug 0, What the wrong, Is there any wrong or mistakes in the drush command above?

I also tried to comment out $conf['theme_debug'] = TRUE; in the settings.php and then replaced with $conf['theme_debug'] = FALSE; but none works.

Any help and suggestions on this issue?

Thanks


texts: theme-settings array of data configuration

texts:
I'm building a theme and right now I have individual key:value sets and hard coded values in the theme-settings.php for setting up a front page slideshow. I would like to know if there's a way to setup an array in theme-settings.php for the form and have the number of slides be dynamic.

I have failed to find any examples of info files and theme-settings.php files that would include a setup for an array with a few default values to get the user started.

My objective is the themes setting form will have a 0 to many input for this data so the user can add and remove slides from the settings page rather than having to manually edit the theme-settings.php and theme.info.

I would like to have each slide in the array hold a string, image, url. I already have this hard coded in my theme-settings.php, but if I can let the user change all of this in the themes settings menu that would make life easy.


texts:
I'm having some strange issues with the Drupal admin menu system. I can't reproduce it reliably, but these are the steps that usually cause the problem:

Go to /user and log in. This works as expected and redirects me to the user page, where I see the admin menu.
Navigate to the front page, either by clicking a link on the page or by manually entering the / address.
Observe that there is no admin menu.
Refresh the home page (possibly a couple of times), and the admin menu may eventually appear.

I've tried both Firefox and Chrome in private browsing sessions, as well as clearing the Drupal admin menu cache. I'm completely thrown by this, as checking in Firebug/Chrome developer tools reveals the SESSxxxx cookie properly set and not changing between when the menu is shown and when it isn't.

Related questions refer to CSS/JS aggregation issues as well as permissions errors. It seems unlikely that at least the latter problem would be so unreliable.

I have Drupal 7 running on PHP 5.4.39/Apache 2.2.22 under Debian wheezy.


texts: Views - Edit, view, delete node in dropdown

texts:
In facebook, on every post, there is a little arrow in the corner with content about that post.

Is there a Drupal module which allows me to achieve this?

What I want to do is:

I have different content types which a user can add.  I want to add the 'edit node', 'delete node' and 'view node' link into a small dropdown which allows the user to choose any of these options by clicking on the icon.


texts: CKEditor automatically making new paragraphs

texts:
When I'm writing some text with CKeditor and I press enter and want to write something on the next line, the editor automatically inserts the text on the new line into <p> ... </p> tags instead of only <br/>.

I tried to correct it with editing the config.js file and adding the line config.autoParagraph = false; but without success.

Do you know where is the fault?


texts: 8 - How can I update the entity reference fields of the form when I close the modal?

texts:
How can I update the entity reference fields of the form based on selection in the modal dialog when I close the modal ?

I have a form and users starts fill the form.
Then click on choose address button, opens modal dialog box.
After selection I need to close the modal dialog and update the form data based on selection.

Any suggestions would be great.
Thanks.


texts: How to use the Webform Serial in a Webform Rule?

texts:
Is there a way to use the Webform Serial (not the SID) be used in a webform rule?

I've tried the following with no success:

[data:serial]
[webform:serial]
[node:serial]

I do have Webform Rules & Webform Tokens installed.


texts: Is access control necessary upon form submission if I've controlled access to the page containing the form?

texts:
Let's say a malicious user has no access to some path (e.g. path/element/1) based on 'access callback' as set in hook_menu() or altered in hook_menu_alter(). What happens if he has access to path/element/2?

Could he simply not change the values that are POSTed in the form submission to the server? I thought they can (even though there are form tokens). If I do several access checks to determine who can view a page, and that page contains a form that can be submitted by anyone who has access to that page, do I need to do those same access checks in the #submit or #validate handler or anything like that? Or can I rely on Drupal's form API security to keep me from having to tediously duplicate all that access code twice for pretty much every custom form!

I know Drupal has some form tokens and whatnot, but doesn't this depend on the developer who output that form (assume a contrib or custom module) setting things up right? I remember a while back I created a custom form and tried changing the POSTed values of one of the elements, and the altered value is what got picked up by Drupal! There was no rejection of the form based on altered values! So clearly I did something wrong there (what might it have been?) - and if I did, then a developer of a contrib module could do the same. So what's the best practice here?


texts:
I have create a view and expose 3 filter but I want to create a expose block only one filter.
I have expose title,post date,and global search. but how to create only block of title in view.

when I create block of title then all three expose filter block has been created.


texts:
I have a site where people can sell their own items, so when a user creates a new product there is a flag "request product" that is added on the content.

I want the user who created the product to be able to unflag requests from other users.

Is this possible? Thanks


texts:
Is there a way to tell when we are in the /user/1/edit page vs in the /user/1 page when inside the template file page-user.tpl.php?

Are there any of the $variables that I can check?

I think I would rather check this, than create a nearly identical template file called page-user-edit.tpl.php. Or is there a better way?


texts: How do I add a dropdown field in the commerce form?

texts:
Does someone know how to add a dropdown field to the commerce form?

I need to add a field where people need to select one of the 3 options. Ex.: "How did you know us?" (options: Google, a friend, I don't know)

Can anyone help me?

Thanks


texts: Multislots in calendar for a custom field in views Drupal

texts:
My table (from another database) is exposed as entity in Drupal 7, so I can create Views from it.

I have two fields in the database (start_date and end_date). How can I make views treat these custom date fields (from custom entity) as a Drupal date field in such a way that the "Calendar view" shows it in multi slots ?


texts:
Localized taxonomy terms are not displayed in a View. Only the default language term is shown. I solved this issue writing a small module according to this article.

Perfect. But in one View i have two fields: term ID and Global PHP code. My question is: what needs to be changed in the Global PHP code below to have the localized terms displayed?

$term = taxonomy_term_load($data->tid);
//print l($term->name,"voices", array('query' => array('type' => $term->tid)));
print l($term->name,"voices", array('query' => array('f[0]' => 'field_production_type_:'.$term->tid), 'attributes' => array('class' => array($term->name))));

/*
  $url = drupal_get_path_alias('taxonomy/term/'. $term->tid);
  $url_part = explode('/', $url);
  print l($term->name ,"voices/voiceovers/".$url_part[1], array('attributes' => array('class' => array($term->name))));
*/


texts: How do I change the order of the Views row fields programmatically?

texts:
How do I change the order of the Views row fields (programmatically) not by Views UI?

E.g: the last field should come up first in the list.

Any hooks available?

Note:
I can not use the Views UI, as I don't own the code for feature re-create, so I'm looking for some hooks.


texts:
Does anyone know how to include a center alignment option for images in ckeditor?

The image below shows what I see:


texts: Drupal's 7 sites folder with its mysterious permissions and ownership

texts: The problem is that I had to give sites directory and all subfolders and files of it permissions 777 in order for drupal to recognize this folder and not redirect me to install.php page. But on a virtual hosting I noticed that sites is a protected folder and all of its content esspecially sites/default/settings.php with 550 permissions. I did not get the magic trick here, how does drupal recognized that folders. I have created drupal's folders and files both as root and other sudo users, but it did not help. And drupal still see only sites with 777 permissions.


texts: Save FileField file to an external server

texts:
When using FileField or ImageField, files are saved to a local folder in the Drupal install. This works great and all, but up till now the media files on my website are served from a discrete server (a CDN), and I'd really like to keep them separate.

Is there a module that extends File/ImageField to allow you to specify an external server (FTP and credentials) to use as a file server?

Any advice or pointers with this is appreciated.

(Ps I've seen the CDN module, but that requires the use of a server daemon or modifying the CDN's origin... and I'm not particularly fond of either implementation.)

<3


texts: Div and problem locating their CSS files

texts:
I'm making my first website with drupal 8 for a university project.

I currently have 2 problems unresolved, the first one is that using the geolocation module to add a google map location is giving me problems, the width is setted at 50% and i can't find the way to change it to 100%, since I can't find the .css file that generate the style from the location page. The code from website that I think responsible is:

<div class="geolocation-google-map geolocation-processed" style="height: 400px; width: 50%; position: relative; overflow: hidden;>

but I don´t know how to change it.

The second problem I have is that just over, it generate a div ("<"div">" Location "<"/div">") with the label title, and I would like to add a .css class to hide, or simply remove it.

PS: I don't know if it's important, but I'm also using drupal 8 zymphonies theme.

Thank you very much.


texts: Why can't I programatically create a location field in a node?

texts:
I'm trying to programmatically create a node with a location field, but I'm not able to do it. I have done it in a similar project and it works fine. I use the Entity API module to create the nodes, with this code.

 $localizationmap = array(
   'latitude' => $item['field_mapa']['latitude'],
   'longitude' => $item['field_mapa']['longitude'],
   //other elements added here (province, postal_code, country [es, en,...],additional, ...)
 );
 $entity->field_mapa->set($localizationmap);

I checked the values that are given to the array and they're OK.
Drupal log contains the following error:

  EntityMetadataWrapperException: Unknown data property field_mapa. en
  EntityStructureWrapper->getPropertyInfo() (línea 335 de
  /var/www/vhosts/drupal/litoral.interdigital.biz/sites/all/modules/entity/includes/entity.wrapper.inc).

field_mapa exists and it is the name of the location field I'm trying to fill.

What am I doing wrong?


texts: field collection v seperate content types

texts:
For my property management admin application I want to assign charges of different types to the properties being managed (e.g. service charge, utilities bill, maintenance costs etc.). So each property on an estate will have many charges associated with it.

In my original spec I have a table for properties/flats and an table for charges that records a foreign key from the property table in order to associate a charge with a property.

New to drupal I implemented this by creating a content type for properties and a content type for charges with a entity reference field to record which property node is related to which charge node. Next I will look into building a form that allows me to fill fields from more than one node at a time and some code to grab the correct property and autofill the entity reference field when adding a new charge by selecting say. 'add charge' from a page that lists properties.

Now I have doubts. I could also create a field collection with all the fields required for a charge (type, amount, date, comment) and allow unlimited values for this field collection. As this field collection is stored as an entity, doesn't this do the same thing as above without having to use the entity reference field and so avoiding some of the coding? Also, if I wanted to add a charge to many apartments at the same time, wouldn't it be simpler using a field collection?

I am too new to drupal to understand the difference. I now it is related to what I want to do with the data after it is stored (it should be available for use in calculated fields, to be listed with data from other nodes, searched for by charge type, for instance) but I don't know how to know which is better without building it twice!


texts:
I'm trying to add the #ajax property to the add form of a simple existing content type.  I thought hook_form_alter would be the way to go, but the code below doesn't get me the updated results I'm looking for.  I've essentially repurposed this code from a hook_menu function that creates the fields manually, attaching the #ajax at creation, so I think the code itself is okay.  I'm just not sure if I'm using the incorrect hook, or if I'm missing something, or what the problem is.

function ajax_test_form_example_node_form_alter(&$form, &$form_state, $form_id) {
    $form['field_username']['#ajax'] = array(
        'callback' => 'ajax_test_example_callback',
        'wrapper' => 'ajax-test-example-wrapper'
    );

    $form['text']['#prefix'] = '
';
    $form['text']['#suffix'] = '
';
}

function ajax_test_example_callback($form, &$form_state) {
    if(isset($form_state['values']['username'])) {
        $form['field_number']['#description'] = 'Hi  ' . $form_state['values']['username'] . '!';
    }
    return $form['field_number'];
}


texts: Identifying and recording fields that have been updated

texts:
I need to keep a record of fields that have been updated since some arbitrary point in time.  My initial approach was to use hook_entity_update() and compare the fields in the updated entity with those stored in $entity->original.  Any fields that didn't match were recorded in a separate table for future reference.

Unfortunately I then discovered that my content type contained fields organised into field collections.  It seems that field collections are stored as a single field which references independent entities.  Of course this reference doesn't change even when the field collection entity itself does.  Even if I were to load the field collection entity from within my update hook I wouldn't know whether it had changed or not.

So I'm stumped.

Would this be possible via some other mechanism ?  My first thought is hooking into the form submission but I'd need some pointeers on how to use From API to accomplish this.

Thanks in anticipation.


texts: field_group #states does not working with using hook_field_group_build_pre_render_alter()

texts:
I am trying to use #states on field_group at node add form.

From the search results I can find a couple of links which shows that hook_field_group_build_pre_render_alter() can make the magic but there is no luck for me.

I try to clear cache and dpm() some message inside the function. It seems the hook function has not been implemented at all.

These are the links I found.

Conditional fieldgroups/fieldsets in Drupal 7
hook_form_alter form state problems


texts: no search_api_solr results when search term ends with number

texts:
I have search_api_solr with views (I use as external Solr server https://hostedapachesolr.com. )

There is this strange issue:

1/ When I search for 951, there are correct results

2/ When I search for V951L, correct results

3/ BUT ... when I search for V951: there are NO results at all ...

This weird behavior stays the same, even when I alter the "views" settings or the search_api_solr settings.
It's like the system is confused that the search term begins with a letter and ends on numbers.

Does anybody knows how to fix this ?

Best regards


texts: How to safely remove fields from create content - project

texts:
I am customizing the Project Management (pm) module. When I create a new Project content type I do not need some of the fields such as price and currency for my particular application. I am concerned that if I use the Fields UI to delete them that when a new version of pm is release that I'll have problems installing it. I also worry that I might mess up the database.

I have made these fields hidden, but they still appear on the create new Project content page.

Are my worries baseless?


texts: Form field with support for multiple values

texts:
I'm building a costum form using Drupal (7) Form API

I want to create a text field with possibility to add multiple values through autocomplete.
The idea is to allow the user to add taxonomy terms to my instance that is to be saved through the form.

Final goal is to present selected values in a table with fields

Term name | Vocabulary | Actions

Where Term name is a input field with autocomplete. When a term is selected, Vocabulary name is appended through JS, and actions just contains a "Remove" button.

And finally under this table I'll have a button with "Add another value".
I'm seeing this done through the Fields API, if I'm setting a field to allow unlimited values. But I want to build this my self, as I'm not using a field, but my own costum database.

How do I accomplish this through Form API?


texts: Why do Chinese auto path URLs become something else?

texts:
I have a Drupal 7 site with i18n on it. There are lots of languages. The problem is that if you save a node that is in Chinese, and you select auto path, then the title that was, for example, /空氣清淨機 will be changed to /kong-qi-qing-jing-ji.

What exactly is this process called? Is it an "English alphabet" version of the Chinese text?


texts: How do I display tokens in a block using PHP code?

texts:
What is the way to use tokens in PHP code?
I need to show the user profile picture URL, but the following code doesn't work.

<?php
  echo "[current-user:picture:url]";
?>

How do I display tokens in a block? I am using Drupal 7.


texts: How to export all feature components with drush?

texts: With drush feature-export you can easily create a feature from a component. But is there a way to easily export ALL components into a feature? In the ui you can easily check all content types or all views. I tried drush fe newfeature views_view but it only exports one view not all of them.


texts: D7 : Plupload version could not be determined

texts:
I have installed the Plupload module and downloaded the library files v1.5.8.

I then uploaded the 'js' folder to '/sites/all/libraries/plupload/'

Having done so, 'admin/reports/status' now returns a message saying 'Plupload version could not be determined.'

Have I missed something obvious?

I have also tried the same with the latest v2.1.1 , with the same results.


texts: How make surveys with many questions whose answers are very similar

texts:
I want build a survey with many different questions whose answers are of evaluation range kind (strongly disagree, disagree, neutral, agree and so on) or yes/not kind. I have to create n different fields (I suppose text list and boolean fields) or is there a better way?
I'm using Entity Form module.


texts: Cannot fetch form_state['values'] of text field from dynamically created Ajax fields

texts:
I have a custom form with dynamically generated fields. I am unable to fetch values from these fields using form_state['values']. Code is attached below. I have been struggling with this since two days, but have not found anything that can fix the issue. Please help!!!

function oulta_seller_create_search_agent_form_second($form, &$form_state) {

$form['#tree'] = TRUE;

$form['names_fieldset'] = array(
  '#type' => 'fieldset',
  '#title' => t('People coming to the picnic'),
  '#prefix' => '
',
  '#suffix' => '
',
);

if (empty($form_state['num_names'])) {
  $form_state['num_names'] = 1;
}
for ($i = 0; $i < $form_state['num_names']; $i++) {
  $form['names_fieldset']['name'][$i] = array(
    '#type' => 'textfield',
    '#title' => t('Name'),
);
if(!empty($form_state['values'][$i]) &&  ($form_state['values'][$i] !='')) {
drupal_set_message($form_state['values'][$i]);//<-- This statement never gets executed. Also cannot fetch the value of $form_state['values'][$i]
}

}
 $form['names_fieldset']['add_name'] = array(
  '#type' => 'submit',
  '#value' => t('Add one more'),
  '#submit' => array('ajax_example_add_more_add_one'),
  '#ajax' => array(
  'callback' => 'ajax_example_add_more_callback',
  'wrapper' => 'names-fieldset-wrapper',
),
);
if ($form_state['num_names'] > 1) {
  $form['names_fieldset']['remove_name'] = array(
    '#type' => 'submit',
    '#value' => t('Remove one'),
    '#submit' => array('ajax_example_add_more_remove_one'),
    '#ajax' => array(
      'callback' => 'ajax_example_add_more_callback',
      'wrapper' => 'names-fieldset-wrapper',
  ),
);
}
$form['submit'] = array(
  '#type' => 'submit',
  '#value' => t('Submit'),
);

return $form;
}

function ajax_example_add_more_add_one($form, &$form_state) {
 $form_state['num_names']++;
 $form_state['rebuild'] = TRUE;
}

function ajax_example_add_more_callback($form, $form_state) {
 return $form['names_fieldset'];
}

function ajax_example_add_more_remove_one($form, &$form_state) {
 if ($form_state['num_names'] > 1) {
   $form_state['num_names']--;
 }
 $form_state['rebuild'] = TRUE;
}


texts: How do I remove a system CSS file in a theme?

texts:
I am trying to remove Drupal CSS files (such as ajax-progress.module.css) from my custom theme YML. Here is what I tried:

name: Mercante
type: theme
description: Tema para o site Mercante.co
core: 8.x
stylesheets-remove:
  - core/themes/stable/css/system/components/ajax-progress.module.css
libraries-override:
  system/base:
    css:
      theme:
        css/components/ajax-progress.module.css: false

Drupal's documentation about that is scarce at best...

Update: another version that also does not work:

name: Mercante
type: theme
description: Tema para o site Mercante.co
core: 8.x
stylesheets-remove:
  - @stable/css/system/components/ajax-progress.module.css
libraries-override:
  system/base:
    css:
      component:
        /core/themes/stable/css/system/components/ajax-progress.module.css: false
        /core/themes/stable/css/system/components/autocomplete-loading.module.css: false


texts: where to put addCommand when implement ajax callback commands

texts:
i' m trying to load a dynamic value on every node of my site and i want to achieve this via ajax callback commands and writing custom module
so i have a class  in src/ajax folder of module like:

class TestCommand implements CommandInterface
{
..
  public function render() {
    return array(
      'command' => 'test',
      'text' => $this->message,
    );
  }
}

also a js file:

(function($, Drupal) {
  alert('loaded');
  /**
   * Add new command for reading a message.
   */
  Drupal.AjaxCommands.prototype.test = function(ajax, response, status){
    alert('called');
    console.log(response);
  }
})(jQuery, Drupal);

but i don't know where i am supposed to put this below lines to call command on every node/view.
if i put this in mytheme_preprocess_node -checking with var_dump()- i can see
correct response but it doesn't call Drupal.AjaxCommands.prototype.test

  //where to put this lines to call test command on every node view.
  $response = new AjaxResponse();
  $response->addCommand( new TestCommand('someparam'));
  return $response;

js file is loaded because i get 'loaded alert'.

lots of examples on sites, call this via ajax callback in form.
one have different approach but i don't know how to apply these solutions in my situation.


texts:
Is there a way to set the node ID length for a specific content type?

I want to have a specific content type have an ID of 8 digits long so that it can be used as a claim number for the clients paper work.

How would I go about setting this default?


texts: How to create a rule to send email to users of a role that belongs to a country?

texts:
I'm using Profile2 module to assign a Country to a Role. For example I have:

User1 | Role: "International Members" | Country: "UK"
User2 | Role: "International Members" | Country: "Poland"
User3 | Role: "International Members" | Country: "Japan"
User4 | Role: "International Members" | Country: "US"

My content also has a field Country.

I have this Rule:

Events:

After saving new content
After updating existing content

Conditions:

Content is published

Actions:

Send mail to all users of a role (International Members)

That is sending email to all users in Role "International Members".
I would like to:

Lookup the Country of the content
Send email to only those "International Members" whose profile Country matches the one of the content.

So If I publish a content with Country set as "US" it should only send an email to User4.

Any idea?


texts: Drupal Commerce: How to validate payment method settings?

texts:
The code add settings for commerce_mymodule (for example) commerce payment module. Can I validate 'mymodule_deadline' variable and how?

/**
 * Payment method callback: settings form.
 */
function commerce_mymodule_settings_form($settings = NULL) {
  $settings = (array) $settings + array(
    'mymodule_min' => '',
    'mymodule_secret' => '',
    'site_mode' => 'DEMO_MODE'
  );

  $form = array();

  $form['mymodule_deadline'] = array(
    '#type' => 'textfield',
    '#title' => t('Order payment deadline'),
    '#description' => t('Deadline for payment - default 7 days (max. 30 days).'),
    '#default_value' => $settings['mymodule_deadline'],
  );

  return $form;
}


texts: How to update a content type node after node_submit?

texts:
I am in D6 and need to modify a table entry of a content type field (content_field_p_fieldname) after node submit  . What i done is wrote a hook_form_alter and written a code to update  in it . This works fine , but problem is : because of node revision works everytime on node edit it creates a revision and creates a new table entry ,and i can update the second last entry only .
I found out the cause as  'Node is creating revision after hook_form_alter' . Any solution on how to i update after node creating the revision , I tried hook_node_insert but with no luck .

/*
 * implementation of hook_form_alter
 */
function module_form_alter(&$form, $form_state, $form_id) {
    if (isset($form['#node']) && isset($form_id)){
        $node = $form['#node'];
        if (isset($form_id)){
            if($form_id == 'p1_request_node_form' || $form_id == 'p2_request_node_form' ) {
                   $form['#submit'][] = 'auto_ip_submit';
            }
            else if($form_id == 'ip_range_node_form'){
                    $form['#submit'][] = 'ip_range_submit';
        }
    }
 }

}

and in

     function auto_ip_submit(&$form, $form_state) {
        // stuff to update the table field data
      }

But this works only after the revision of node .


texts: Rules: Steps to trigger a rule when a field is updated

texts:
I am using the rules module to send an email when a particular CCK field field_test is changed. These are the steps I performed:

Event: After updating existing content
Condition: Field has changed

Under Field I chose field_test.
Under DO I chose the action as email.

My issue is that even if any other field is updated under that content type, it still triggers my rule, under debugging it shows Condition Updated content's field 'field_test' has been changed evaluated to TRUE.

I'd appreciate any help on this.

Thanks.


texts: How do I set different front pages for domain access sub sites?

texts:
I am using the Domain Access module and would like to have two distinct front pages. The primary one works as expected, and I have a separate front page template. The secondary domain front page is not picking up the front page template; instead, it is displaying the breadcrumbs and heading just like the secondary pages.

How do I configure the module so that the secondary domain picks up the front page template?


texts: How can I alter the title of a node upon save?

texts:
I want to automatically set the title of nodes with content type ABC to the node ID.  (I want to hide the title field from the form in the UI, and I don't care about titles for this content type.)

For now, I am putting in dummy data (Title and Body) to test this.

At first I tried hook_ENTITY_TYPE_presave():

/*
 * Implements hook_ENTITY_TYPE_presave()
 */
function mymodule_node_presave(Drupal\Core\Entity\EntityInterface $entity) {
  if ($entity->getType() == 'ABC') {
    $entity->setTitle($entity->id());
  }
}

However, this fails because the entity ID has not yet been assigned.  So next I tried hook_ENTITY_TYPE_insert():

/*
 * Implements hook_ENTITY_TYPE_insert()
 */
function mymodule_node_insert(Drupal\Core\Entity\EntityInterface $entity) {
  if ($entity->getType() == 'ABC') {
    $entity->setTitle($entity->id());
  }
}

This does not result in an error, and I get the status message ABC 23 has been created. However, the node title shows the dummy title I entered, not the node ID.  I tried to fix this by adding $entity->save() to the insert() hook, but this results in a duplicate key error.

How can I change the node title to the node ID upon saving the node for the first time?


texts: I'm working on a drupal site. Its already done by someone else but I have to change some things. I want to edit a block but when I want to edit, it doesn't show the block body. http://i.imgur.com/ntIM5QI.png


texts: Rules to remove user from role on node publish

texts:
I have tried the following:

Event: updating an existing content
condition: NOT node-unchanged published
remove user role (I'm stuck here)

The last item is my problem. There is no user reference in the data selector field, it just has site and node items and even the node items has nothing related to the node's field. It just has stuff like status, vid, uid, comments, nothing referring to the nodes field items.

What I think I need is to select Romove user role, I select the user from the data selector and then select the role it needs to be removed from.

DETAILS ON CONTENT TYPE
The content type provides field for two email addresses to be provided by the node author - the node status at this time is unpublished. The two emails are then used to create new user accounts (with notification to the email owners) which are added to specific roles (these are done with rules). The two new accounts are granted permission (via the field permission module) to provide values to corresponding fields in the same content type. When the two users update the node by providing the values, the admin changes the status of the node to published.

Once unpublished the two new users need to be removed from the respective roles, though they remain authenticated users.

Thank you for looking into this


texts: How do I print results after submitting a Drupal form?

texts:
I have a simple Drupal Module setup which has a single textbox.

I can return what was typed in the textbox using drupal_set_message():

function firstmodule_form1_submit($form, &$form_state) {
    drupal_set_message(t("The user is $username"));
}

However echo $username; will not work for me, nothing is printed. How can I return results without using drupal_set_message()?


texts: Is it possible to import custom XML files with the Feed Import module?

texts: With the feed import module I see that you can import CSV files and RSS feeds. But what about custom XML files that follow our own defined format. Is it possible to tell the Feed Importer to import these files?


texts: What could cause user_hash_password() to crash this severely?

texts:
After making some major, but seemingly unrelated, changes to my login module (changes related to updating an LDAP with data from Drupal users), one of my uses of user_hash_password() is failing so badly, that the website returns with:

  Server error The website encountered an error while retrieving
  http://mybusiness.net/content/mywebsite?destination=node/1. It
  may be down for maintenance or configured incorrectly.
  HTTP Error 500 (Internal Server Error): An unexpected condition was
  encountered while the server was attempting to fulfill the request.

No other errors. No hint as to what I'm looking for. I just figured out which line of code by chance, as it was originally part of the construction of an array.

The immediately relevant code I'm using (after deconstructing it) is:

terralog('Test step 18');
terralog('Pass '.$pass);
$passHash = user_hash_password($pass);
terralog('Test step 18.5');
terralog('hash '.$passHash);

It only prints the first two logs, so I can see that there is no other line of code that could be killing it. $pass proves to be the password in plain text, just as I expected. It is set once from the login form, and never modified again (unless ldap_bind() modifies it, but I can see that it does not). Something hidden must be affecting it, because I can't see anything besides $pass interacting with it on the surface. This function is one of the API functions (7 onwards), and a fairly simple one. What could possibly cause it to fail so badly?


texts: How to write a db_query with condition on a datefield with enddate - value1 and value2

texts:
Trying to do following select query on a node with datefield with endvalue:

  SELECT nid FROM {node}
  WHERE uid = $uid
  AND type = $type
  AND field_mytime(value) > $daystart
  AND field_mytime(value2) < $dayend;

  db_query('SELECT nid FROM {node}
     WHERE uid = :uid AND type = :type AND field_mytime['und'][0]['value'] > :value, field_time['und'] [0]['value2'] < :value2',
    array(':uid' => $u, ':type' => 'mycontenttype', ':value' => $daystart, ':value2' => $dayend))->fetchField();

This do not work of cource:
  field_mytime['und'][0]['value']
  field_mytime['und'][0]['value2']

But what will work? Please help.


texts:
I have an array, that I want to retrieve the values from.
When I test the array with a print_r, it says that it has the right values. But when I want to show them  in their right places, it says that it has no values.

function employees_items($nodeid, $language)
{
  $query  = db_query(//SOME QUERY);
  $rows   = array();

   foreach ($query as $row) {
    $rows[] = array(
        $row->nid,
        $row->title,
        $row->field_service_nummer_value,
        $row->field_support_email_value,
        $row->uri,
    );
}

    return $rows;

}

Here I want to retrieve the values...I want the value in $row->uri. The errormessage: Trying to get property of non-object i employees_block_view()

  function employees_block_view($delta = '')
 {
 if (array_key_exists($brandpage_id_page, $medarbejder_brandpages))
    {
     switch ($delta)
    {

        case 'employees':

        $employees = employees_items($brandpage_id_page, $lang_name);

        foreach ($employees as $row)
            {

              $block['content'] .= '
';
              $block['content'] .= 'uri). '" alt="Vores support medarbejder" />';
   }
  return $block;
 }


texts: How to get work Internationalization module with l function?

texts:
I am using Internationalization module to translate content.
How to get work this module with l function?

for example, when I create programatically link to content:

l(t('About us'), 'node/22');

I would like to achieve, that path 'node/22' will change when I switch website to another language. With Internationalization module, each translation of node creates another node, so I need to change paths in links on website.

For this time,
I can create just if-else condition:

<?php
if ($language->language == 'en')
$output = l(t('About us'), 'node/22');
elseif (($language->language == 'de')
$output = l(t('About us'), 'node/23');
?>

IS it possible to use l function in that way, that I don't need to write else-if condition?


texts: How to find where view mode is used for a content type?

texts:
We inherited a site where some content types have several view modes per content types. We are using the out of the box View modes from Drupal 8 and Display Suite is not an option.

How would we find out where each View Mode is used?


texts: Hook form alter to check date field is empty or not

texts:
First of all I'm new to custom modules, I'm using hook_form_alter to do some custom validation, in the middle I have to check if a date field is empty or not, if empty I will display an error message.

Problem:
I don't know how to get the value from date field after a form is submitted and check it with empty() function.

I have tried:

$form_state['input']['field_start_date']['und'][0]['value']
$form['field_start_date']['und'][0]['#default_value']['value']
$form_state['values']['field_start_date'] # no use of these.

What am I doing wrong?


texts: Expose (other) user's role to anonymous using views

texts:
Setup

On my site I have created two new, different roles (say role A and B). New users get assigned one of these roles.

Using Views I have generated a user listing, i.e. a view showing all users having either of role A or B. This overview listing shows some user information, including the role that the respective user in the listing has. The role is pulled in using a field making use of user relationship: (Owner: User) User relationship: Roles

The anonymous user also has View user information permission.

Issue

The user listing view works fine, if the user viewing it is authenticated (i.e. logged in).

However, if the user is anonymous (i.e. not logged in), the role does not get displayed in the user listing view.

Desired outcome

I would like all users, including the anonymous user, to be able to view the roles in the user listing.

Question(s)

How can this be achieved using Views?
If this can not be achieved using Views, then how?


texts: Passing arguments from Panels to Views in Drupal 6

texts:
I'm attempting to use The "It's Common Sense" guide to passing arguments from Panels to Views but I'm running into an issue at step 7:

  At the Configure Panel pane form, make sure you choose "No context" as the Taxonomy Term, check the Send Arguments box. In the Arguments field there, type in %term

That sounds very reasonable... but I can't find any such checkbox.

I tried just muddling through the tutorial without doing that step, but it doesn't work. I end up with a weird, long URL and it just redirects back to the root of my site.

For context, I'm trying to create an archive of nodes by year. When there's no arguments, I get a list of years from 2009-2012. If I click, say, 2009 (coming from a page with path /?q=archives), I get the following URL:

/?date[value]=&date[min]=&date[max]=&date_filter_1[value]=2012-11-14 00%3A00%3A00&date_filter_1[min]=2012-11-14 00%3A00%3A00&date_filter_1[max]=

I'm hoping for something like, /?q=archives/2009 instead. (Not that that currently works either.)


texts: How do I apply loop into node twig template?

texts:
This is code I am using.

{{ content.field_article_main_content[0] }}

{{ content.field_article_main_content[1] }}

How can I change that code to make it loop over content.field_article_main_content?


texts: Skip Guest checkout step - go straight to checkout form

texts:
Is it possible that when you click on "Checkout" in the shopping cart view you go straight to Guest Checkout?

In this case you skip the "login as existing customer" or "checkout as guest" step.

Using DrupalCommerce 2 for Drupal 8.

I tried this solution but it didnt work for me because on the "Review" step the filled-in fields are not being displayed.


texts:
I am facing a problem that in my drupal web site, I am having menu depth level is more then 15. By default drupal 7 provides depth level is 9. Is it any way to increase it's menu depth level?

In short :- I need to add more then 15 childrens in my single menu item.

Expamle:-

Menu

-1

--2

---3

----4

-----5

------6

-------7

--------8

---------9

===========Drupal doesn't allow to add more childrens =====


texts: Entity Form --> Submitted Data With Comments

texts:
I am trying to create a site that has the following workflow.

Users (A, B, C...) can submit an item/product for review (if the product isnt already in existence in our site) using an entityform.

Upon approval by the moderators, the submission data needs to become published content. This published content can now be reviewed and commented upon by all users of this site.

The problem resides in the fact that, at the end of the form submission and mod approval, that node needs to allow comments so that more people can review our website (using fivestar) in the comments field as well as a text field for leaving a text comment.

In Drupal 6 I could easily do this with Webform because it was a node. However, Entityforms are just that, an entity. You cannot attach comment fields to an entity. After viewing this page, it seems there are a few other people who would have the same need I do, but there is no solution (maybe Drupal 8)?

I have subscribed to Convert comment settings into a field to make them work with CMI and non-node entities in hopes of seeing the direction Drupal will take with all the new entity methods incorporated into Drupal 7.

At this point, I can only think of one solution to get the submitted form content into a place on my site where it can get further reviews/ratings -- manually move over the data submitted in the form and put it into a content type/node so that I can get the comment functionality. It would be a bit of a PITA but Id rather do that than try and work with the reply module (reply module is not recommended on production sites).


texts: Why am I getting "Your browser does not support iframes" in multiple browsers?

texts:
I want to display a third party page within my theme and thought an <iframe> should do. However, I added the <iframe> to my basic page, selectingFull HTML but all I'm getting is Your browser does not support iframes with multiple browsers while I can use the iframe on the W3School website just fine. Why is this?

The link: http://spabc.com/drupal/content/store


texts: Multiple URL for one Drupal 8 website configuration

texts:
I want create one Drupal 8 website (one database) with changing contents depending of the URL the user used, I mean:

If the user goes to the main URL http://foo.com, the main page of the website is loaded and contains some content generated for the http://foo.com URL
If the user goes to the main URL http://faa.com, the main page of the website is loaded and contains some content generated for the http://faa.com URL

I can manage that with Apache settings. But how can I configure Drupal? If a user uses the URL http://foo.com and then, he goes to the subpage /test, the URL must become http://foo.com/test.
But, if a user goes to the site with the URL http://faa.com and then, he goes to the subpage /test, I want the base URL still http://faa.com (http://faa.com/test).


texts: hide repeated data from my view table for some specific field

texts:
****how can hide repeated data from my view table. i want to print employee Id and name field only once for each group.
can you please help me out.****

I am fetching two table in view using JOIN.So few data gets repeated with respect to foreign key. So I need to hide those field value...
    Suggest me any solution...distinct and aggregation mixing up my data..


texts: How to show parent and child term in autocomplete exposed filter?

texts:
I created a view with autocomplete exposed filter and this is working fine. However, I need to show autocomplete in hierarchical mode.

For example, I have two locations:

phase-1
phase-1

The first phase-1's parent is Chandigarh, and second phase-1's parent is Delhi. But autocomplete filter shows only one phase-1.


texts: How do I avoid "geo:" is removed from links?

texts:
I need to place on my site link with geo scheme:

some location

But drupal cuts schema from link and i have following result:

some location

Is there any way to disable geo scheme filtering?

I'm using drupal 8.3.5, basic installation without any additional extensions(except autoinstalled during setup process).

UPD.
I using view that displays some fields of custom nodes as HTML list.
Most of fields marked as "excluded from output" and for one field i'm using html output override like this:

{{ field_linktitlefield }}

field_somefield and field_linktitlefield is a simple text.


texts: How to display only the years that have content in view filter?

texts:
What I have done

I have created a view.
I have added a content type to display .
I have added a filter to filter by node date content and have opted to display the post date as year in the filter.

What I want actually

I wanted to display only the years that have content. I am using Drupal 7.

Which are the ways to do this?


texts: got a Parse error webform.install in drupal 7

texts: Hello guys i have got an parse error Parse error: syntax error, unexpected T_FUNCTION in /sites/all/modules/webform.install on line 1917 what i suppose to do please help me out this trouble. Due to this i am hot able to install any module or access my site.


texts: how can I identify sidebar blocks in my theme

texts:
I am working on a theme that I inherited and somehow the sidebar blocks are only coming out on the front page although I have set them up to come out in all of the pages in the block setup.
The programmer has made many template pages which is where I believe he has blocked the sidebar block from coming out but I am not sure where that code is.
Where can I find the code that would disable a sidebar block from coming out.
If I switch templates I can make the blocks come out but I need to do it with the current template.


texts: Programmatically do something when a node is updated

texts:
I want to do something when a node gets updated. To keep it simple, lets say display a drupal message.
hello_world.routing.yml
hello_world:
    path: /node/{node}
    defaults:
        _controller: Drupal\hello_world\Controller\HelloWorldController::hello_world_entity_update
    requirements:
        _permission: 'access content'

Not sure if the path should be /node/{node}/edit instead.
HelloWorldController.php
<?php
/**
 * @file
 * Contains \Drupal\hello_world\Controller\HelloController.
 */

namespace Drupal\hello_world\Controller;

use Drupal\Core\Controller\ControllerBase;

class HelloWorldController extends ControllerBase {

  public function hello_world_entity_update(Drupal\Core\Entity\EntityInterface $entity) {

    drupal_set_message(t('Something @var just happened.', array('@var' => 'cool')));

  }
}

Since hook_node_update() was depreciated, I assume we now have to use hook_entity_update().
I am not getting the message upon updating a node, what I'm I missing or doing wrong?

Update

Just so I don't confuse anyone.
I was brainwashed into thinking I needed a routing file and a
controller. All the D8 examples out there use them.
Since I was not creating any pages,
turns out I did not need a routing.yml file nor a Controller.php file
nor the /src folder. All I had to do is approach this like Drupal 7,
all that I needed was the .info.yml file and a .module file
to put the hook.


texts:
I am trying to install drush on my new computer and it's a mess
I'm on Mac Os High Sierra, with Mamp 5.3, PHP 7.2.14

I'm mainly interested in Drupal 7
On my previous computer, it was simple i just had to be on the htdocs folder and type : drush dl to download the latest Drupal 7 release

Now i had to install composer (v1.8.4) and then installed drush  using this command : composer require drush/drush:dev-master
I ended up with this version of drush (v9.7.0-dev)
When i type drush dl i get this message :

dl has been deprecated. Please build your site using Composer. Add new projects with composer require drupal/[project-name]. Use https://www.drupal.org/project/composer_generate to build a composer.json which represents the enabled modules on your site.

I'm no advanced user (obviously), i just need drush to have persmission to execute basic commands to install a new drupal 7, install, enable, disable modules..

Here's the result of $PATH

Mac:htdocs Mac$ $PATH
-bash: /Users/Mac/.composer/vendor/bin:/Applications/MAMP/bin/php/php7.2.14/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin: No such file or directory

Thanks


texts: Drupal 7 same token showing twice in token available admin page

texts:
I have a simple question to understand if I made a mistake (during my migration from Drupal 6 or so ...).

In admin page, when I can use token in fields, in "Browse available tokens." popup I'm seeing same token twice, once with "_", once with "-"

Eg :

Nom [current-user:field_last_name]  Texte field.
Nom [current-user:field-last-name]  Field "field_last_name".

(here the real field machine name is "field_last_name")

Did I miss something ? Tokens are working good but I don't know is this behaviour is normal ?

Regards.


texts:
I can't see a content of custom block (making by clicking on "Add new block").

I try to add block in region, but region doesn't show the block content. I use different kinds of block("Search form", "Powered by Drupal", etc.) and it doesn't help.

What should i do?


texts: What's inside "print render($page['content'])"? I want to style my front page in Omega subtheme

texts:
I'm using an Omega sub-theme in Drupal 7.
In my front page, I have some sort of "river of news" with all content that has the "promote to the front page" checkbox checked.
I would like to create a special front page, so I've copied my page.tpl.php into a new page--front.tpl.php.

I would like to add a special CSS class to that list of content. (The list is filled with all teasers by default.) When I try to target that specific piece of content, I get only this:

<?php print render($page['content']); ?>

Inside that is the content section, and the sidebars sections.

How do I target only the list of teasers?


texts: Display comment count of referencing nodes

texts:
I have two content types, Forum and Discussion (urelated to the core forum module). The content type Discussion has a node reference to the Forum it belongs named field_forum.
I would like to create a views list which show nodes of Forum with no. of comments of nodes Discussion referencing to it.

Apparently, not a problem:

Just create a view of Forum with a reference "Entity Reference: Referencing entity" (A bridge to the Content entity that is referencing Content via field_forum) and then add a "Content: Comment count" field using this reference, set aggregation to on and set aggregation type for this field as sum.

However, my problem is that, even if I DO NOT check the option "Require this relationship" when I create the relationship, still adding comment count field make forums without any discussion to be excluded from the view, while I want all forum to be there, with or without discussions.

If I remove the "Comment count" field, all forums are visible. Strange enough, using the same techniques for counting the discussions works without problems.

This MAY be related to #1349080 but unfortunately it works with or without the patch in #231 (that solves similar problems in other contests).


texts: What causes the errors in the rules that come with Commerce Coupon?

texts:
I am trying to use Commerce Coupon module in my project. The problem is after download and enable this module, rules created by this module got error. And I can't find out what happened to this errors.

commerce coupon - 7.x-2.0-rc2+14-dev
commerce version - 7.x-1.11+39-dev
inline Conditions - 7.x-1.0-alpha7

Any suggestion is greatly appreciated.


texts: Getting error "Table 'drupal.watchdog' doesn't exist" during install

texts:
I'm a Drupal newbie and haven't been able to find this problem posted elsewhere online, so I'm hopeful someone here can help.

I have just set up php/mysql on a shared hosting environment and copied drupal 8.0.5 over to begin the installation (I changed some file permissions and copied settings.php and .htaccess over to the correct locations as per the instructions).

The server seems to be running MariaDB 10.0.23-MariaDB~trusty (debian maybe?) and ostensibly php 5.6. However, when I run php --version on the server I get PHP 5.5.32-nfsn1 (cli) (built: Mar 11 2016 21:11:51). However, Drupal hasn't complained so it seems to agree that they're running 5.6.

Where I'm getting stuck is during the installation phase, where it breaks about half way through with the following error message:

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /core/install.php?rewrite=ok&langcode=en&profile=standard&id=1&op=do_nojs&op=do
StatusText: OK
ResponseText: Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'drupal.watchdog' doesn't exist: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array
(
[:db_insert_placeholder_0] => 0
[:db_insert_placeholder_1] => DrupalKernel
[:db_insert_placeholder_2] => Container cannot be saved to cache.
[:db_insert_placeholder_3] => a:0:{}
[:db_insert_placeholder_4] => 3
[:db_insert_placeholder_5] =>
[:db_insert_placeholder_6] => http://www.mysite.info/core/install.php/?_format=json&id=1&langcode=en&op=do&op=do_nojs&profile=standard&rewrite=ok&rewrite=ok
[:db_insert_placeholder_7] => http://www.mysite.info/core/install.php?rewrite=ok&langcode=en&profile=standard&id=1&op=start
[:db_insert_placeholder_8] => 43.247.118.190
[:db_insert_placeholder_9] => 1459041023
)
in Drupal\dblog\Logger\DbLog->log() (line 84 of /home/public/core/modules/dblog/src/Logger/DbLog.php).

clicking the link to the error page takes me to this:

  Catchable fatal error: Argument 1 passed to
  Drupal\Core\Routing\CurrentRouteMatch::getRouteMatch() must be an
  instance of Symfony\Component\HttpFoundation\Request, null given,
  called in
  /home/public/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php on
  line 92 and defined in
  /home/public/core/lib/Drupal/Core/Routing/CurrentRouteMatch.php on
  line 104

I can't make a lot of sense of this message. A quick google search lead me to a bunch of pages for similar errors, but I couldn't find this same issue.

As this is the only database in the mysql instance I have simply given drupal the admin user/password, so I don't see how this could be a permissions issue.

I have not made any modifications to any files, other than copying default.settings.php -> settings.php.

What am I doing wrong here?

As per another user's request, I tried upgrading to drupal 8.0.6 and am now getting a 500 internal server error, with the following in the logs:

[Fri Apr 08 14:11:53.710451 2016] [core:error] [pid 54807:tid 34478458880] [client 172.17.240.6:45115] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

I've posted another question to resolve this issue: https://drupal.stackexchange.com/questions/197400/500-server-error


texts: Rules - Check if coupon has been added to an order

texts:
I need to check in Rules if a coupon has been added to an order as a condition.

I have tried using the ENTITY HAS FIELD option in Rules and then a data selector of

Commerce-order

and to then look for the field commerce_coupon_code

But this fires a negative, I have also tried to look for commerce_coupon_fixed_amount

But this also fires a negative.


texts: Filter token module not replacing tokens in custom editor

texts:
I have created a form with form element

class MyForm extends ConfigFormBase {
public function buildForm(array $form, FormStateInterface $form_state) {
    $form['thankyou_paid] = [
            '#type' => 'text_format',
            '#title' => $this->t('Thank you'),
            '#format'=> 'full_html',
            '#default_value' => $config->get('thankyou_paid),
          ];
}
public function submitForm(array &$form, FormStateInterface $form_state) {
    parent::submitForm($form, $form_state);
    $config = $this->config('subscription.form');
    $config->set('thankyou_paid', $form_state->getValue('thankyou_paid')['value']);
}
}

In this editor I add a token [site:name] and in text formats config, I enabled checkbox for  Replaces global and entity tokens with their values for full_html format, but this token is not getting replaced with site name.

Anyone can help figuring out what's being missed?


texts:
I am trying to find a way out about five hours now, i have studied and tried a lot of different things but i couldn't find the right drupal way to do what i want... Please help with the following.

I have the search-block-form which displays a search input text field and a button. The markup for the button now is the following (produced by drupal core):

<button class="form-submit" id="edit-submit--2" name="op" value="Search" type="submit">Search</button>

I want to add extra markup inside the <button></button>, like the following:

<button class="form-submit" id="edit-submit--2" name="op" value="" type="submit"><i class="fi-magnifying-glass"></i></button>

I know of course how to set the value=' ' and i have to say that i've already tried #prefix and #suffix parameters. I don't want to add markup prior to the button element or after that. I should put markup inside, between the element's tags.
I tried also change the hook theme_button($variables) but my problem is that i want to change only the button for search-block-form and not all the button elements.

As some of you have already understand, i use foundation 5 framework and i want to make the search button like this:


texts: How do you create a block that contains fields from the User Profile?

texts:
I tried using the method described in one of the answers here: How to put user profile in a block

I created a block and used the following PHP code as a test;
<?php render(user_view($account)); ?>

It didnt work. So the question remains, How can you create a block and call user profile fields into it using PHP?


texts: Is it mandatory to apply every minor Core upgrade step by step?

texts:
I have a site in drupal 6.26 and I need actualize it.

I have two options:

6.26 to 6.27 to 6.28

or

6.26 to 6.28 directly

What is the best method? Thanks


texts: I'm kind of confused with the product types. Lets say I have 2 products, a laptop and a desktop PC. Both have "brand" as a field. Would I have to create 2 product types or is there a way to have a default product type and apply the extra product typ


texts: Checkboxes Defaulting to Selected When Not Desired

texts:
This is going to be sound like a real stupid question, but for the life of me I don't know how to fix it. I have inherited some code that I need to maintain, and the issue I am experiencing is that a form containing checkboxes is displayed, and they are always all selected. The code for the checkboxes is as follows:

$license_result = db_select('licenses')
  ->fields('licenses', array('code', 'name'))
  ->execute();

foreach ($license_result as $license) {
  $licenses[$license->code] = htmlspecialchars($license->name);
}
$selected_licenses = array();
return array(
  'selected_licenses' => array(
    '#type' => 'checkboxes',
    '#title' => t('Licenses to Display'),
    '#description' => t('Select which licenses the student should be able to select'),
    '#options' => $licenses,
    '#default_value' => $selected_licenses,
  ),
);

I though that by having an empty array for #default_value would deselect all checkboxes. Am I reading the form API wrong in this regard? Eventually I would like to set the default values but right now I want to make sure they start off as unselected.

Thanks.


texts: Redirect anonym user after click on link

texts:
i have preprocess function

function THEME_preprocess_views_view(&$vars) {
    global $user;
    $view = $vars['view'];

    if ($view->name == 'questions_by_category' && $view->current_display == 'page') {
        $vars['header'] = '<div>' . l('Ask your question', 'node/add/question') . '</div>';
        if($user->uid == 0) {
            //this code not working
            if($_GET['q'] == 'node/add/question') {
                $path = drupal_get_path();
                drupal_goto('user/login', $path);
            }
        }
    }

i need to redirect anonym user to login page when he click on the link node/add/question, i also tried with arg(0) == 'node' && arg(1) == 'add' && arg(2) == 'question' but this wont work.

The code inside if($user->uid == 0) { } works fine, i can redirect, but i need to redirect on click only. Also i need to redirect user back on the page after login, and this code :

$path = drupal_get_path();
drupal_goto('user/login', $path);

seems not working too.


texts:
$(function(){
  $('.slider').mobilyslider({
    content: '.sliderContent',
    children: 'div',
    transition: 'horizontal',
    animationSpeed: 500,
    autoplay: true,
    autoplaySpeed: 9000,
    pauseOnHover: true,
    bullets: true,
    arrows: true,
    arrowsHide: true,
    prev: 'prev',
    next: 'next',
    animationStart: function(){},
    animationComplete: function(){}
  });
});

I am integrating the above JavaScript file in a Drupal theme, but it is giving me the "$ is not function" error. I googled it, and changed the code bro the below, but it doesn't work either.

(function($) {
  $('.slider').mobilyslider({
    content: '.sliderContent',
    children: 'div',
    transition: 'horizontal',
    animationSpeed: 500,
    autoplay: true,
    autoplaySpeed: 9000,
    pauseOnHover: true,
    bullets: true,
    arrows: true,
    arrowsHide: true,
    prev: 'prev',
    next: 'next',
    animationStart: function(){},
    animationComplete: function(){}
  });
})(jQuery);

The above code gives me following error:

  $('.slider').mobilyslider is not a function


texts: How to create a multi vendor Drupal commerce website?

texts:
What is the best way to create a multi vendor Drupal commerce website in which every vendor has the option to create:

Their own store.
Their own menu/vocabulary.
Every vendor have access to its own menu/vocabulary.

A hint would be enough.


texts: Site map module assigns random frequencies to content

texts:
I just created an XML sitemap in Drupal 7. As I click on the 'rebuilt links' button, all my content pages are assigned random frequencies and the module does not give me an option to edit content frequencies.

For eg: I have 15 content pages and all these pages share the same content type. I assigned priority of 0.9 to this content type. As I hit 'rebuilt links', few pages were randomly assigned daily frequency, where as rest of the pages were given monthly frequency.

Is there a way I can assign uniform frequency to all my content pages? or edit individual page frequencies? What exactly is making the XML site map module assign two different sets of frequencies to the same content type?


texts: Get currently active 'simpletest' user during test

texts:
How do you retrieve the current 'simpletest' user during a simpletest.

During a simpletest is the $user GLOBAL from the test environment or the live environment?


texts: Is it possible to import one single configuration file by specifying its path, or a group of Yaml files contained in a specific module?


texts: jQuery clone of an select form with ajax event

texts:
I'm trying to clone with jQuery the block which contain a form with an ajax event.

function module_api_change_currency_form($form, &$form_state){
    $form['currencies'] =  array(
        '#type' => 'select',
        '#options' => array(1 => 'GBP', 2 => 'EUR' , 3 => 'USD'),
        '#default_value' => $_SESSION['currency']['id'],
        '#ajax' => array(
            'callback' => 'ajax_callback_change_currency',
        ),
    );
    return $form;
}

function ajax_callback_change_currency($form, &$form_state){
 //...other code before
    $commands = array();
    $commands[] = ajax_command_invoke(null, 'changePricesPrincingPage');

    return array('#type' => 'ajax', '#commands' => $commands);
}

which give this code:

"ajax":{
    "edit-currencies":{
        "callback":"ajax_callback_change_currency",
        "event":"change",
        "url":"\/system\/ajax",
        "submit":{"_triggering_element_name":"currencies"}
    }
}

The original works fine but the clone which I copy with jQuery.clone(true, true) doesn't get the ajax events:
It should get inplemented with those arguments: clone([withDataAndEvents] [, deepWithDataAndEvents]) but it doesn't work :(

The 2 forms (select) are exactly the same.
Any Idea how I can get the ajax event working on the clone?


texts: Clear input field after click without attach any external script

texts:
Are there any helper functions contained in Drupal core or Ctools to perform popular tasks such as clearing input field after an event occurs ?
I know how to do it using external js (javascript) file, but I was wondering whether an alternative way for this exists or not  ?


texts:
I try the asset module.

But wonder if there is a way to import a bunch of images (and other types)?

Cannot figure out, I have all submodules enabled.

There is way in drupal5. I use d7


texts: How do I tell Drupal not to aggregate my css file

texts:
I have enabled Drupal's Aggregate and compress CSS files. What should I do in order to exclude certain css files from being aggregated and compressed?
Thanks.


texts:
We have 4 type of users -

Admin   -  can view and manage all other users
Parent  -  Can view and manage students but own child
Teacher -  Can view and manage students assigned to him
Student -  Can view and manage own profile & details

So it's clear that everything is around students can be accessed by 3 other roles as per rules.

I am trying with different role and users modules but not getting exactly how to setup this structure in drupal.

I am sure there is definitely a way to do this because it's a general requirement and drupal has a way to implement this. But I am newbie and trying from couple of hrs but not able to set this.

Anyone please guide me on this or share any link where I can get exact information regarding this.

Thanks is Advance


texts:
How should I name the tpl file for "training" content type webform?

I've tried webform-form-training.tpl.php and webform-training.tpl.php and it doesn't work.


texts: Image field: make source image private, but thumbnails public?

texts:
Is it possible to set uploaded images to be stored in the private folder, so that the source files are protected (only accessible for authenticated users) but to make the derived images (generated through the image styles, e.g. thumbnails etc) publicly visible for anonymous users?

My idea would be to have a gallery where the medium-size version of the images are visible to anonymous visitors, but only registered users would have access to the full-size images (source file).


texts: Any other ways I can stop the  page from being cached by boost?

texts:
My drupal 7 site has Boost module (7.1.beta1, the version previous to the current release) installed and I didn't change any settings from the stock install. I saved the settings configuration with the <front> exception, generated the htaccess code, added it to my root htaccess file, turned Drupal core cache for anonymous users off... Everything works, ie, pages get cached to the boost cache directory and anonymous browsing is served from the boost cache. Only problem is that the front page is being cached even when my boost setting exception using the default <front> should be preventing the front page from being cached. I apologize if this is a redundant thread,I searched but mostly people have the opposite problem (ie, they want the front page cached-whereas I don't). I've also cleared the cache via /performance tab after enabling it and made sure there wasn't a boost cache for the front page .

Does anyone know why the boost exception setting isn't working for the front page? Is there perhaps another way to hack boost for this one page to not be 'boosted'? Thanks.


texts: How to add button to a form that calls custom JavaScript when clicked?

texts:
I want to create a button on a form that when clicked:

Calls some custom JavaScript
Does not submit the form

Is this possible with Drupal 8 Forms?


texts: Webform entity select submission displaying different result than element

texts:
I have a webform in Drupal 8 with an entity select element. The element is populated from an entity reference view. I have a book content type with information about the book such as title and author. I also have a field collection in book containing more specific details such as ISBN and format. The entity reference view displays title-isbn-format. For example:

Dune - 9780441013593 - Paperback

Dune - 9780143111580 - Hardcover

I applied the view entity reference patch posted here. The form correctly displays the output of the view. How do I get the same display in the form submission? If I set the form display to value and select Dune paperback the result is "MyBookFieldCollection 0 of Dune (9)."

I tried using tokens but I can only get the field collection info, not the book info.

Here is the source for the element:

book_title:
  '#type': entity_select
  '#title': 'Book Title'
  '#select2': true
  '#format': custom
  '#format_html': '[webform_submission:values:book_title:node:title] - [webform_submission:values:book_title:entity:field_isbn_13] - [webform_submission:values:book_title:entity:field_format]'
  '#format_text': '[webform_submission:values:book_title:node:title] - [webform_submission:values:book_title:entity:field_isbn_13] - [webform_submission:values:book_title:entity:field_format]'
  '#target_type': field_collection_item
  '#selection_handler': views
  '#selection_settings':
    view:
      view_name: entity_reference_for_form
      display_name: entity_reference_1
      arguments: {  }

This correctly displays the ISBN and book format but not the book title.


texts: What is the basic structure required to create a custom database driver?

texts:
I need to create a custom database driver, and the documentation was never completed.

Can someone provide a list of the classes that need to be implemented to realise this, and a brief description of what each should contain?


texts:
I need to create a HTML email, and someone suggested Swiftmailer. I installed that module, but it's not clear to me how to create HTML.

I enabled SwiftMailer as the sitewide default in the Mail System module, and I added a message like this:

$string = "This is a defined message: You have been send a message - \n" .$params['message'] . '\n click here<button type="button">Click me</button>';

But the HTML isn't picked up. The a tag is a link, but the button is not a button. I also can't apply inline styles.

Additionally, I will need to know how to create multiple email templates, which apply to different email types (I only saw online how to create one, swiftmailer.tpl.php)


texts: How To Enter Data Into A Custom Drupal Entity?

texts:
I have a question regarding entering data into custom entities

I have a usage case I believe is better for Drupal Entities than Content Types and Nodes.  I have installed Entity Construction Kit and used it to set up the structure for my entity.

What is not clear to me is how I go about getting data into my entity.  I assume we could do a mass CSV import via Feeds.  But what about making individual entries?  I'm looking for a way to enter the data through the Drupal Administration forms (i.e. Add Content > Entity Name) but that does not appear to be the case.

Are there additional modules out there that would give me the ability to do this?

Thank you for your time and assistance.

-- Chris


texts:
In Drupal 7 there is a section to add a custom language

But in Drupal 8 that section does not exist,

How can I add my custom language in Drupal 8?


texts: I'm wanting to add a custom form field to the DC cart page - not the add to cart page but the cart page. It wants to be specific to the cart rather than specific to individual line items which will then save to the order information to be available later. I've looked at dozens of questions and answers on the internet and done some digging of my own and haven't figured out even what would be the right hook to use. Any suggestions?


texts: Custom exposed filter to select expired nodes

texts:
In my Drupal 7 website I have a content type called "offer" that has a date field called "deadline".

When the current date is greater than deadline, then the offer is expired.

I would like to make a form with Views where I can put a radio button like this:
Expired: yes   no

Is it possible to do that?

I know that a solution could be to make a new field, to call that "expired", and finally to make a cron to set the value on yes when the node deadline is lesser than the current date.
I was looking for something easier...

I made some steps forward.
The solution should be using the grouped filters, but it doesn't allow me to chose the relative date:


texts: Hooks and preprocessor confusions. A few important questions

texts:
I've been using Drupal now for a pretty long time, but this whole hooks and preprocessor thing still gets me confused. And I can't seem to really find a structured documentation to help.

Intuitively it feels like changing a contrib module is not part of theming, but more of module extending / modifying, but it is also theme-specific, so it's confusing to know if this topic is indeed related to the above or not.

Here are some of my questions that I am still left with:

1. are function hooks used in modules the same as theme hooks used in the theme?

2. if a contrib module uses a "hook" is this something i can override or extend in my theme?

*3. if a contrib module uses a hook, say: hook_block() can I then hook the hook to change the module's output?*

example:
inside the contribmodule.module file:

contribmodule_block() { $variables['foobar_item'] = 'foobar item'; }

can this be overriden by the following in the template.php file?

contribmodule_preprocess_block() { $variables['foobar_item'] = 'new item'; }

Is there a guide for all the fundamental concepts? All i can find is the API for hooks, but that says really nothing at all about it other than giving a list of available hooks; zero theory there.

4. if a contrib module has a function which I can NOT override with a hook onto a hook, then how do i change what the contrib module does for my theme? am I forced to hack the code of the contrib module?


texts: How to create a global language selector page at domain root with i18n when the global language has a prefix?

texts:
I am looking for a solution to create a language selector at www.domain.com. My site has multiple languages (en, de, fr). All the languages are using a domain prefix. This results in:

www.domain.com/en (default language)
www.domain.com/de
www.domain.com/fr

Now I want a global language selector at www.domain.com without any redirects. The module https://www.drupal.org/project/language_selection_page is almost what I'm trying to accomplish, but this is using a redirect. I was told this is bad for SEO (redirect).

What is the best way to accomplish this?


texts: How get Drupal Alias from given node NID inside a module function?

texts:
I am trying to get the Alias from a given system path node NID (node/nid), inside of a node_insert function in a custom module.

I already tryied:

drupal_get_path_alias('node/866'); // return node/866 in watchdog dblog

and

url('node/866'); // return node/866 in watchdog dblog

and

drupal_lookup_path('alias', 'node/866'); // return NOTHING in watchdog dblog

and

drupal_get_normal_path('node/866'); // return node/866 in watchdog dblog

It should return seo/preparedUrl, but I can´t find a way to do this.

I need this to change a path before the node is saved.

In URL alias (admin/config/search/path) the Alias(seo/preparedUrl) and System (node/866) are there!

THE ANSWER

First of all, Thanks to @arpitr with the help with devel/php path sugestion! Really fast  debug this way!

The answer in my case is that is two languages. The path was in language, but my user was in another so, when I use dpm it continues to print the node/nid, but when I changed my user language to be equals to content language it began to work the way I want!

(I can´t answer my own question or vote up nothing here because I am a new user, so I putted here!)


texts: Display the content of particular content type in side a block?

texts: I tried to create a block called contact details. I already created a content type called contact. I wanted to add the content of each contact content type in my custom block. I researched a lo abd I'm confused.


texts: set a entity reference field programmatically

texts:
I have a node form, with an entity reference field.

I'm trying to hide the reference field from the node form and automatically reference an entity created by the node author.

Im using code like the following to fetch the entity to be referenced.

  $query = new EntityFieldQuery();
  global $user;
  $query->entityCondition('entity_type', 'node_ref');
  $query->fieldCondition('cmp_ref', 'target_id', $user->uid);
  $result = $query->execute();
  $storeids = array();
  foreach ($result as $ref) {
   foreach ($ref as $ref_id){
    $refids[] = $ref_id->id;
   }
  }
  $entity = entity_load('node_ref',$refids);
  foreach ($entity as $ref) {
    $ref_id = $ref->id;
  }
  return $ref_id;

I think its a long way of doing it but I just modified some code I found in a module.

Now upon save of the node I would like the entity reference field to reference $ref_id

So something like

  $node->entity_reference_field[$node->language][]['target_id'] = $ref_id;

How do I call this on node submit? If I unset the field on the node form will the value still be set?

Thanks for any help


texts: How do I add an image for each menu column?

texts:
I have 4 columns in the footer, and am displaying a different menu in each block(column). I would like to add an image above the menu items for 3 out of 4 menus. What is the best way to do this? Is it possible to add a field to the menu content type as such? If this was possible I could then create a view for each block/column, by pulling in the menu items and images...

What would be the best way to do this?


texts: Display comment form without the comment thread

texts:
What are some ways of rendering a comment form without also displaying the comments?

What about creating a block contains the form?  If that's possible, what are some links to documentation touching on that?


texts: How to use Feed importer to import content type in which one of the field is node reference field type?

texts: I have a content type, in which one field has multiple values and they are referred from another content type. How can I upload this content type from a .csv file with the help of feeds importer?


texts: Capture generated Drupal 7 html output into a variable

texts:
Trying to hook into Drupal 7 from an external php file by using various variants of ...

define('DRUPAL_ROOT', getcwd());
require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
ob_start();
menu_execute_active_handler();
$contents = ob_get_clean();
return $contents;

However, it seems D7 just spits out the HTML to the browser on the menu_execute_active_handler() call.

Any ideas how to get the html output into my variable?


texts: Can I specify the location of a .tpl.php while using preprocess hooks?

texts:
If I override the template file using the code below, can I specify the location of page-ajax.tpl.php? I wanted to leave page-ajax.tpl.php inside my module's directory rather than to place it inside the current theme's folder.

function my_ajax_preprocess_page(&$vars, $hook)
{
    if (isset($_GET['ajax']) && $_GET['ajax'] == 1)
    {
        $vars['template_file'] = 'page-ajax';
    }
}


texts: How to limit a custom views filter to a certain display type?

texts:
I'm creating a views filter, and I would like to limit it by display type.  How do I do that?

I'm creating a custom filter for the entity_browser view display (entity_browser/src/Plugin/views/display/EntityBrowser.php).

Since it's only relevant for this display, I would like it only appear in the list of filters when on that display.  How do I do that?


texts:
Drupal core has the Drupal\Core\Utility\TableSort class which can be used to create tables with sortable columns. All examples in core however are based on Drupal\Core\Database\Query\TableSortExtender which providers table sorting for data coming from a database query.
I am looking to display data that is generated by custom code and is not originating from a query. How can I use the TableSort code directly in my controller?
This is the Drupal 8 version of the same question for Drupal 7. See the answers there for additional insights.


texts: How to change all iterations of a string to another word?

texts:
I noticed that most of my Russian clients afraid "Таксономия" ("taxonomy") word, because the word sounds like something very complex and incomprehensible for them:)

I want to change all iterations of "Таксономия" to another word, for example to "Классификация", because this word is familiar to everyone in Russia.

So how can I change one word to another in ALL iterations of the word in translate system ON EXISTING site. In other words, how can I bulk update translation by some algorithm instead of edit each string manually?


texts: How to change a field value with a Rules Action?

texts:
I'm trying to set up a Rules  Action that can change the value of a field. I created an Action Set with a data type of Node. When I go to create a Rules Action, I have access to every default Drupal node field, but no fields.

Is this simply not possible? Do I need some other module to make this work?


texts: Is there a site as good as Smashing Magazine geared towards drupal rather than wordpress?

texts:
As the title says, I'd like to find a site that is similar to the Smashing Magazine site that caters more to drupal users.

I love this site. I have yet to find a Drupal centered one that keeps me checking the feed so often for quality content.

I'll try any suggestion.


texts: Making a custom views field handler click sortable (getting an error when clicked)

texts:
When I make my custom handler click sortable and subsequently click the label in the table heading of the view I get the following error:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'unknown' in
  'order clause'

My handler is defined as below. This is a render only handler that performs a calculation on some other field data and outputs.

UPDATE:

Am I right in thinking that because this data is not stored in the database that I can't make it click sortable because there is no column to order by in the SQL statement that is generated?

Is there a way around this? Any help appreciated.

function rate_calc_views_data() {

$data = array();

$data['node']['rate_calc_handler_result'] = array(
    'title' => t('Standard Deviation'),
    'help' => t('Calculates the voting result standard devaition'),
    'field' => array(
      'handler' => 'rate_calc_handler_result',
      'click sortable' => TRUE,
    ),
    'sort' => array(
       'handler' => 'views_handler_sort',
     ),
     'filter' => array(
       'handler' => 'views_handler_filter',
     ),
);  return $data; }


texts:
A while back I upgraded from D6 to D7 using the Drupal upgrade script. A bug that's lingered in my system is broken menus.

For example, on /admin I have a link for both "People" (/admin/people) and "User management" (/admin/user). The link for "User management" is dead, it goes to /admin, and I believe it is a carryover from the D6 install. I can give many more examples if necessary.

Is there a way to remove the broken menu items without affecting my working D7 menu items?

Thanks in advance to anyone that helps!


texts: How to fix the variable names in a simplenews subscription confirmation mail?

texts:
I have a Simplenews subscription block for the anonymous users of my site. When they enter their name and email address and hit subscribe, a mail is sent to their email ID for confirmation. It is a single confirmation email.

When i see the mail it displays the variable names that i am using.
For eg :

  1) The subject of the mail is Confirmation for !newsletter_name.
  2) please use the link below, then click "Subscribe" on the web page that
  will open: !confirm_subscribe_url

How can it be fixed?


texts:
I have build a view with a HTML-list were all my images are listed. Goal is to create a JQuery Cycle with those images, but for some reason, my custom Javascript isn't working...

Here is the HTML generated by Drupal:

And here is my custom Javascript I wrote:

(function ($) {
    Drupal.behaviors.initFrontPageSlider = {
        attach: function(context, settings) {
            $('body').once('initFrontPageSlider', function() {
                $('.homepage-slider').cycle({
                    fx: 'fade'
                });
            });
        }
    }
}(jQuery));

But for some reason, my image-list isn't picking up my javascript. What's missing on this?


texts:
I installed MailChimp module and i am using Rules module to send emails to subscribed users. For gmail this emails are going in spam. But when i send an email from mailchimp, it's ok, no spam. There are 3 ways i see now -

Use rules and fetch subscribed users, then send email to them
programmaticaly(worst)
Configure rules to send emails from mailchimp.
Find another way to send emails and not get to spam.

Can i somehow make campaigns for mailchimp and send them with rules automaticaly, or you can suggest another mail module for such task?


texts: User account and Commerce addressfield bug

texts:
I found out that when I enter a "Full name" in the commerce shipping and billing address information, the [user:name] value will be changed to the "Full name" entered.

As you can see the user name in the first picture is different from the value of the [user:name] token.

However, when I enter a different "Full name" for subsequent orders, or change the username it doesn't modify the value of the [user:name] token.

Is there a way to stop the commerce shipping and billing to modify the [user:name] token or to change the value of the token manually?

Thank you for your help.


texts: How to redirect to top level domain and not relative value

texts: Under admin/config/system/site-information, the startpage is configured as /home. So when you go to www.domain.com, the content of /home is displayed. However, when a form is submitted, it automatically redirects to www.domain.com/home. Is there any way to prevent this?


texts:
Im using ImageCache but I've since modified some of the original image files in my Drupal site. The reason being I needed to modify images uploaded to nodes but don't want to manually add them all again. Can I now manually flush ImageCache's cache?

Thanks


texts:
Building a view that has a few filters and i would like to have a sidebar block with them inside, just like an "eshop" with the sidebar filters.

The default behaviour is a get request. How i can make the exposed form block work with ajax?


texts: How can I make it so that users can add content to my site?

texts:
I have created a custom content type for my site that takes three fields. I then created a view that displays only that content type in a grid form. I need to know how to allow users to add content based in the form of my custom content type so that they can add things that will directly be added to the custom view I made. (Essentially the view makes a grid that displays rows of 3 images in each row. The images when clicked on will then take the user to a page that gives a description of what the image is along with a few other things.) Does anyone know what I can do with this, or if there is a much easier way to do this that I am totally missing?

Thanks for the help!


texts: jQuery code is loading content in an unpredictable way

texts:
I've got a view of teasers; each teaser has 3 clickable  elements:

"morelink" toggles an extra row in a table.
"noderef"  loads the referenced node into a div.
"ajaxview" sends the node id as an argument to ajax load a view into a
. This view contains  a view of teasers which in turn each have 3 clickable  elements thus creating a nested view of teasers which in turn each have 3 clickable  elements.

This is the JavaScript code.

Drupal.behaviors.morelink = function(context) {
  $("a.morelink").click(function (e) {
    e.preventDefault();
    $('.xtrarow').eq( $('a.morelink').index( $(this) ) ).toggle();
  });
}

Drupal.behaviors.ajaxview = function(context) {

    $("a.ajaxclick").click(function(){
    var nid = $(".mynid").eq($('a.ajaxclick').index( $(this) )).val();
    $('.container').eq($('a.ajaxclick').index( $(this) )).load(Drupal.settings.basePath + 'myajax/' + nid);
    return false;
});
}

Drupal.behaviors.noderef = function(context) {

    $("a.nrefclick").click(function(e){
      e.preventDefault();
    var nref = $(".mynref").eq($('a.nrefclick').index( $(this) )).val();
    $('.container').eq($('a.nrefclick').index( $(this) )).load('node/' + nref );
    return false;
});
}

This is the HTML code.

<input type="hidden" class="mynref" value=<?php print $node->field_noderef[0]['nid']; ?> />
<a class="nrefclick" href = "<?php print url('node/' . $node->field_noderef[0]['nid']); ?>">

<a class="morelink" href = "<?php print url('node/' . $node->nid); ?>">

<a class="ajaxclick" href="<?php print url('myajax/' . $node->nid); ?>">

The behavior is erratic: The "morelink" works consistently and is fine; the ajaxview works intermittently, and seems to load ok for the first few clicks, but once you've clicked a few, the JavaScript stops working.

Can anyone spot the problem?


texts: Before I install this module I want to better understand this note

texts:
I want to install the Autosave module.

In the module's page there is the following note. Can someone please clarify it for me in more simple words? I wonder if it could clash with other modules that also use jQuery.

  Autosave uses a modified version of the jquery.field plugin (modified since it doesn't support Drupal field naming conventions very well).
  This version of the plugin was based on jquery 1.2 and does not work with jquery 1.3. Rev 6.x-2.7 DOES support jquery 1.3 and should still support jq 1.2. Please raise an issue if you find that it doesn't.


texts:
I am having a problem with this function, it simply is now working. I have a module with just a basic form and im using the date module to get the datepicker to pop up and that works fine, but when I select a date from the datepicker the alert is not firing.

this is what i have in my theme js file.

//id for nay_date input field
$('#edit-nay-date-datepicker-popup-0').datepicker(function() {
              onSelect: function(selectedDate) {
              alert(selectedDate);
            }
        });

and this is the field i have in my module

$form[['nay_date'] = array(
    '#title' => 'Date',
    '#type' => 'date_popup',
    '#description' => '',
    '#required' => TRUE,
);


texts: Youtube Media with Media Module, won't render

texts: I'm using the WYSIWYG module and I enabled the media browser button for it. When I add a youtube video, only the thumbnail shows... Why is this?! (I'm using ckeditor.)


texts: List items through view based on list of terms from field

texts:
I have started making all my content and now I just need to figure out one more thing and I have played around but can't get anything to work without it being overly complicated and I'm sure there is a much simpler way.

I have a "Lesson" content type which right now has the fields:

Title
Body
Vocabulary

I also have a "Dictionary" content type which has the fields:

Title
English
Audio
Part of Speech

I manually create an HTML table of the vocabulary learned in the lesson in the Vocabulary Field which I manually link to it's dictionary content entry.

I figured there has to be a better/smarter way to do this through a view or maybe another module. Is there a way to make a list of words in a "Lesson Node" and have a view pull those words from "Dictionary" in a view?

Ultimately this is what I would want displayed:

Navigation Bar

Lesson Node Title

Lesson Node Body text will go here explaining the lessons and everything else that is in the body of the "Lesson" content type

(This section is the words pulled from the "Dictionary" which is based on the words used in the Lesson)

--------------|--------------|------------|

Foriegn Word  | English Word |   Audio    |

--------------|--------------|------------|

Foriegn Word  | English Word |   Audio    |

--------------|--------------|------------|

Foriegn Word  | English Word |   Audio    |

--------------|--------------|------------|

Foriegn Word  | English Word |   Audio    |

--------------|--------------|------------|

So let's say that "Lesson one" teaches us the words cat, dog, mouse, house. I want only those entries from the "Dictionary" to be displayed underneath the body of "Lesson one"


texts:
I'm a brand new Drupal user and I just installed and started configuring a Drupal 8 instance.  I've had no problem tweaking the theme, and creating text content, but I can't seem to find the button to upload a file.  I doesn't exist on admin/content/files where I would expect it, and Googling quickly points me to modules I could include.

I was hoping to upload a few images to use on some of my "basic page" content entries.

Is there not a simple "file upload" button in this CMS?


texts: flowplayer - stream from file:///fodler/video.flv possible?

texts:
I have converted my made in drupal into HTML with blue crab (spider)
I have to give to my clients a USB stick with the site made in drupal and all pages have to work

there is only one problem
- the videos won't work offline
Does flowplayer only work with a HTTP server??


texts:
I'm overriding drupal /blog path with a views. Created a new view page display and set path to blog. Created views-view-unformatted--blog-page.tpl and trying to output view fields this way:

<?php
print $fields['title']->content;
print $fields['body']->content;
?>

But all what i get is nothing, tried to output <?php print 'Hello, world!'; ?> == it outputs Hello,world. But i can't print Views fields...

PS in another view display - printing fields this way works perfectly. Blank fields affects only blog page view display