texts: Ajax callback (not triggered) on content added by ajax

texts:
The only post I've found about this question is sadly unanswered, so here's my situation.

I have a custom form that I made in MyModule. On the send button, I set an ajax call that loads a list of entities. This works fine.

My problem : In that entities list, at the end, I add a "load more" button. I'd like to add an ajax call on it to load more entities, but the ajax callback is never called. I guess it's because it's in another class, but I can't figure out how to fix this. If you need more precision, please ask. Thank you!

Form

namespace Drupal\MyModule\Form;
use Drupal\MyModule\FormatDbQueryResults;

class MyForm extends FormBase {

  public function buildForm(array $form, FormStateInterface $form_state, $options = NULL) {

    // [...] Stuff

    $form['actions']['send'] = [
      '#type' => 'submit',
      '#value' => 'Search',
      '#ajax' => [
        'callback' => [$this, 'submitModalFormAjax'],
        'event' => 'click',
      ],
    ];
    return $form;
  }

  public function submitModalFormAjax(array $form, FormStateInterface $form_state) {
    $response = new AjaxResponse();
    $output = new FormatDbQueryResults();
    $value = $output->getFormattedContent($form_state->getValues(), 1);
    $response->addCommand(new ReplaceCommand('#results', $value));
    return $response;
  }

}

An other class in the same module

namespace Drupal\MyModule;

class FormatDbQueryResults {

  public function getFormattedContent($form_values, $loadMoreIndex) {

    // [...] Database EntityQuery stuff

    //
    // MY PROBLEMS ARE HERE
    //
    // The callback is never called.
    // Also, I would need to send parameters to that callback
    $output['load_more'] = array(
      '#type' => 'button',
      '#value' => 'More',
      '#ajax' => [
        'callback' => 'loadMoreEntities',
        'event' => 'click',
      ],
    );
    return $output;
  }

  public function loadMoreEntities($form_values, $loadMoreIndex) {
    $response = new AjaxResponse();
    $value = $this->getFormattedContent($form_values, $loadMoreIndex++);
    $response->addCommand(new AppendCommand('#results', $value));
    return $response;
  }
}


texts: An illegal choice has been detected. Please contact the site administrator in drop down list

texts:
when i am selecting values from dropdown list the corresponding values showing first time. but when i am again selecting the another value its not showing value instead of the error msg displaying An illegal choice has been detected. Please contact the site administrator. can anyone suggest me where i did wrong in the following code

<?php

function form_test_menu()
{
  $items['mark_entry'] = array(
    'title' => 'Mark Entry',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('form_test_form'),
    'access callback' => TRUE,
    );
  return $items;
}

function form_test_form($form,&$form_submit)
{

$dept = $_POST['dept'];
$batch = $_POST['batch'];
$month = $_POST['Month'];
$year = $_POST['Year'];
$semester = $_POST['semester'];

$query = db_select('student_master');
$query->fields('student_master', array('reg_no','name','dob','dept_code','degree','batch_year'));
$query->condition('dept_code',$dept,'=') AND $query->condition('batch_year',$batch,'=');
$results = $query->execute();
 $options = array();

foreach($results as $student_result)
{
$options[$student_result->reg_no]=t($student_result->reg_no);
}

  $form['roll']= array(
  '#type' => 'select',
  '#title' => t('Registration Number'),
  '#options' =>$options,
  '#required' => TRUE,
  '#ajax' => array('callback' =>       '_ajaxfunction','wrapper' => 'subjectsdiv'),);

 $form['month'] = array('#title' => t('month'),
    '#type' => 'hidden',
    '#value' => $month,
'#required' => TRUE,);

 $form['year'] = array('#title' => t('year'),
    '#type' => 'hidden',
    '#value' => $year,
'#required' => TRUE,);

 $form['semester'] = array('#title' => t('semester'),
    '#type' => 'hidden',
    '#value' => $semester,
'#required' => TRUE,);

 $form['subjects'] = array('#prefix' => '
','#suffix' => '
');

$form['submit'] = array('#type' => 'submit','#value' => 'Submit');

return $form;
}

function _ajaxfunction($form, $form_state)

{

$key = !empty($form_state['values']['roll']) ? $form_state['values']['roll'] : 1;

$month = !empty($form_state['values']['month']) ? $form_state['values']['month'] : 1;

$year = !empty($form_state['values']['year']) ? $form_state['values']['year'] : 1;

$semester = !empty($form_state['values']['semester']) ? $form_state['values']['semester'] : 1;

$query1 = db_select('semester_appear');
$query1->fields('semester_appear',array('subject_code'));
$query1->condition('reg_no',$key,'=') AND $query1->condition('semester_appear',$semester,'=')AND $query1->condition('month',$month,'=') AND $query1->condition('year',$year,'=');
$query1->orderBy('sub_serial_no','ASC');
$results = $query1->execute();

while ($record_res = $results->fetchAssoc())
{

$subject_name = $record_res['subject_code'];

$query = db_select('subject');
$query->fields('subject', array('subject_name','subject_code'));
$query->condition('subject_code',$subject_name,'=') ;
$subject_results = $query->execute();

foreach($subject_results as $sub_result)
{
$options[$sub_result->subject_code]=t($sub_result->subject_name);
}

  $form['subjects']['name']= array(
    '#type' => 'select',
    '#title' => t('Please Select Subject'),
    '#options' => $options,
'#required' => TRUE,);

$form['subjects']['inter'] = array(
  '#type' => 'textfield',
  '#title' => t('Internal Marks'),
  '#size' => 60,
  '#maxlength' => 128,
  '#required' => TRUE,);

$form['subjects']['exter'] = array(
  '#type' => 'textfield',
  '#title' => t('External Marks'),
  '#size' => 60,
  '#maxlength' => 128,
  '#required' => TRUE,);

}

return $form['subjects'];
}


texts: Howto print out the pagination for EntityFieldQueries?

texts:
I have this code that uses an EntityFieldQuery object:

$query = new EntityFieldQuery;
$query
  ->entityCondition('entity_type', 'node')
  ->entityCondition('bundle', 'yacht')
  ->propertyCondition("status", 1)
  ->pager(3, 1);

// […] switch case defaulting to:
$query->fieldOrderBy("field_bautyp", 'value', "asc");
// […]

$query->execute();
$nodes = node_load_multiple(array_keys($result['node']));
return theme('yacht_display', array('nodes' => $nodes));

And in the yacht_display.tpl.php

<some HTML-Code and iteration over the $nodes>
<?php var_dump(theme_pager()); # => NULL ?>

It apparently works; when I add ?page=2,5 to the URL I get different results.
Now I need to render the pager. Simply calling theme_pager() does not work; calling theme('pager', array("element" => 1)) always returns NULL.

What am I doing wrong?

UPDATE: updated the code to its current state


texts:
Sorry if this has been asked before (although I've been looking and haven't found quite what I'm looking for).

It's not currently possible to present the server-side validated messages (specifically required fields) inline on forms built with webform, is it? If not, is is something that I could realistically code myself? Looking at this ticket:

https://www.drupal.org/project/webform/issues/2889272

The line: "Form validation messages will not be moved because contrib modules and theme expect this information to be displayed in specific region." Makes me wonder if it would even be possible.

Be nice, this is my first question on here.

Thanks.


texts: share field template between node display and views

texts:
Is there an easy way to share the same field template for both node display and views output?

Perhaps this requires a template.php template_files candidate addition?


texts:
I have a form updating with AJAX on select element change. Easy so far. The problem is that I need to return the form & also an ajax command at the same time.

If I need the form, I just return the $form array and if I need to return an ajax command I use return array('#type' => 'ajax', '#commands' => $commands);. Both works just fine.

The problem is that I don't get it how to combine both of them in the same return object.

Any ideas how can I do that?


texts: How do I include a custom class file in a module?

texts:
In Drupal 7 module development, I could include a custom inc, api, or php class file using the file[]= directive in the module.info file or the drupal_load_included() function.

With D8 using PSR, what is the proper way to package up a "plain ole PHP object" and reference it in DefaultController.php? Think something like: $a = new POPO();.

Is just giving the PHP file containing the class a namespace sufficient? How does the controller (or module in general) know to reference or scan for that class?


texts: Views contextual filter using entity reference field

texts:
I have two content types.  An image content type and a photographer content type.  I have linked the photographer to the image content type by using entity reference, so that each image has a reference to a photographer.

I have created a view which shows all the images.  I want to be able to use a contextual filter so that when I add the photographer title field into the URL it only shows images for that photographer.  I have got this to work by adding a relationship in the view to the photographer and then using the photographer title field as the contextual filter.  However, it doesn't work if any spaces in the title are replaced with dashes.  Is it possible to make it work so that I can replace the spaces in the photographer title field with dashes?

So for instance the URL "photos/john smith" works, but the URL "photos/john-smith" does not, and I would like the last URL to be able to work.


texts: Theming select file button in managed-file formfield

texts:
I use a straight forward upload button (form-field of type 'managed-file), my site runs under the bootstrap theme.

The result is shown below (the blue button I added myself after the managed file field)

This does not show for customers. How can I theme this??


texts: Field type that is an integer, but accept some strings that means no value is provided?

texts:
I have a field named "Price" that should allow anything from 0 - no maximum value, so I set it as an Integer and set 0 for the minimum value (and put a suffix to show up for the price).

However, the field contented is generated by parsing a JSON feed, and the feed owner sometimes puts "on demand" for some items, meaning the price can be negotiated on demand or the price is private and only shared when a client shows enough interest to buy.
The Feeds JSONPath Parser module parses the text string and doesn't import the fields with text for the Price field as it's not an Integer. Therefore resulting in a blank field input.

Should I replace all empty values with a 0 and then on view results set 0 to be rewritten to the "on demand" text? Or is there another way that I should explore?

I need to keep the Price field as an Integer since I use it for a range filter in my view.


texts:
I have a menu link that is a link to another client site. This uses a single-sign-on. The users info(in Drupal) is sent via SOAP to create a URL with a authenticated ticket for them to use to login. The ticket is a one use ticket. I can't figure out where to implement this,  I feel like this is something that needs to be done between jquery and hook_menu maybe? The problem is that this SOAP code needs to be called every time a user clicks this link.

Anyone have any suggestions? I'm using drupal 7.

thanks
-fw


texts: How to programmatically save a block's title?

texts:
Nice Menus is a custom block module that was created by another devleoper and I am trying to go in programmatically and change the title to "<none>" with this code:

function nice_menus_block_view_alter(&$data, $block) {
  if ($data['content']['module']['#value'] == 'nice_menus'){
    $data['content']['settings']['title']['#value'] = "<none>";
  }
}

Here is the issue I am running into. If I am on the block configuration page, it does display the text "<none>" on the title-field, but it does NOT insert this data into the database. Only AFTER I hit save, does it record "<none>" into it. Here is a screenshot example:

As you can see on Nice Menus 2, that is the one I clicked "save" and it set it to the database. However, my code is suppose to set "<none>" to both nice_menus 1 and 2. I do not want to have the user click "save", but rather have it already set with my code. How does one go about "saving" their changes in my function? I already have other fields saved on this block by using the variable_set function, but the title field is restricted to the official block_module.


texts: Undefined variable - base_url in include() in Drupal 7 html.tpl.php

texts:
I am getting this error, but everything else is fine; even that variable is getting printed. Then why does the error appear?

Notice: Undefined variable: base_url in include() (line 26 of htdocs\atins\drupal\sites\all\themes\live\html.tpl.php).
Notice: Undefined variable: base_path in include() (line 26 of htdocs\atins\drupal\sites\all\themes\live\html.tpl.php).

This is my code:
<a href="<?php print $base_url;?>"><img src="<?php print $base_path . $directory; ?>/img/logo.png" height="35" width="211" alt="AtinsLive Logo" title="Home" />


texts: 'serialized' field in schema still needs manual unserialization?

texts:
I've modified my schema so that I can store an array of items in one field:

"required_product" => array(
  "type" => "text",
  "length" => 'medium',
  "not null" => TRUE,
  "default" => "",
  "serialize" => true,
),

This works great when using drupal_write_record, as the array data is correctly serialized before putting it into insert/update query and executing.

However, I still have to manually serialize when I extract the data - example:

$form_state["values"] = db_fetch_array(db_query("SELECT * FROM {amh_shop_discounts} WHERE discount_id=%d", $discount_id));
$form_state['values']['required_product'] = unserialize($form_state['values']['required_product']);

This is less useful - shouldn't it do both?

Currently running Drupal 6.22


texts:
I have a website with LOTS of nodes and LOTS comments. I have lesser space in the hosting plan and don't wont to buy more. The cache_field table of the site keeps on growing due to caching.

I disabled "Cache pages for anonymous users" in admin/config/development/performance and kept
"Cache blocks" enabled. The current performance and load time with the current settings and after a cache clear is at an OK level. But still the cache_field grows. Same with the "Cache blocks" disabled.

Due to the size of the site I feel that caching of nodes and comment are not necessary.

How to stop cache_field table from growing?

More:

I'm ok with coding
I have a VPS with 20GB Disk, and 60% filled when cache is cleared. Once I cleared the cache when it was 75% filled and growing (with the cached data).
Sorry for the late data I have 512MB ram.


texts: How do I access attributes from within a block?

texts:
So I'm calling a block within a HTML container in Drupal 7.x with a shortcode. There is an option for a Dynamic Shortcode as well but alas there is no documentation in the code base.

[block admin_url = "admin/structure/block/manage/block/244" hello="World" ][/block]

This pulls the Block to the page and I can see output from PHP within its content.

However! I was wondering from within the block if there is any way to access the attribute "hello"  Or if this is impossible?

Basically I'm trying to create a single block which can take a parameter for a tag name that calls a View and displays the top 3 blogs from that tag.  It's all so easy, until you try to do it in Drupal 7.x.

The only other solution I can think of is to create a Block for all 20 tags which then call the same view to retrieve the 3 blog posts.


texts: Is there a way to limit where a block displays based on a query in the URL?

texts: I have a page with a pager that displays a certain block at the top. I only want that block to be display on the first page but right now it display when I go to Page 2, 3, etc.


texts:
I am a bit confused. I understand what teaser does(shows the title and a preview and maybe some other things of an article). How do I not show a preview of the article.

I just want title and possibly author. My aim is to have a frontpage/homepage that only shows a list of titles.

I don't like the look of the article preview.

Still sorta new to Drupal hoping for an in depth explanation as well.


texts: How should I store a static key pairs list?

texts:
I wish to store around 200 static key value pairs.

A few ways i can think of, are the following:

 - Using `variable_set()`
 - Using a custom table
 - Using a cache
 - Defining a constant in code
 - hard-coding the key pairs

The list will be referenced on every node. I am using the Views module as well.

How should I store the key pairs list in my case?


texts:
Is there any way to include an if condition in views footer. I have to check the total rows

{% if [view:total-rows]  > 6 %}

View AllEvents

{% endif %}

But this is not working.


texts: How to move a field to a different region using Omega sub-theme / D7?

texts: I used to be pretty good at theming Drupal sites, but I haven't done it much since D7. I added a custom field to my Basic content type and I want to put it in a Sidebar if it exists. What's the best way to accomplish that?


texts:
I am using the Field Validation module to validate a date field that will contain a user's birthday. I want to make sure the person is 18 years of age or older. Here are the settings I was thinking of using in my validation rule. Are these correct?

Column: value

Minimum Date: now - 18 year


texts: Something I can't understand in Acquia Marina theme

texts:
I have downloaded the Acquia Marina theme yesterday.

I cannot understand well the following code; there is a lot of code like the following, in page.tpl.php.

<?php print theme('grid_block', $search_box, 'search-box'); ?>
<?php print theme('grid_block', theme('links', $secondary_links), 'secondary-menu'); ?>
<?php print theme('grid_block', $primary_links_tree, 'primary-menu'); ?>
<?php print theme('grid_block', $tabs, 'content-tabs'); ?>
<?php print theme('grid_block', $footer_message, 'footer-message-text'); ?>
..............

Acquia Marina theme version is 6.x-3.1. I didn't find a template.php file between its files. Where is the variable declared? Why doesn't the code use $primary_links_tree directly?


texts: Using Entity Reference to show a view within a node

texts:
I have a content type of Authors that I want to attach to the bottom of article content type. One person will be entering all the content and they need to be able to select which author box will show at the bottom of the article.

I have been able to do this with entity reference and the display shows the rendered entity. But I have a view I would like shown instead of the rendered entity and I can not make that happen. I was able to associate the author view using the Entity Views Attachment but it associated with the UID of the account signed in when the post was created how can I instead associate it with the entity reference select list field?


texts: Different Theme for Current URL - Using Javascript?

texts:
I know that you can have different themes for different parts of the site, assigning specific URLs to different themes by using hook_custom_theme() or the themekey module - I've used both solutions to do this at one time or another.

However, is there a way to modify/update what theme is being used on the current page by using Javascript?

I'm asking because I want to A/B test an upcoming UI fix. In my test, 50% of visitors in the control group would see "old pages using theme A" (without fix) and the other 50% would see "new pages with theme B" (with fix). Then I can see whether the fix improves performance/conversion and by how much.

The thing is the testing tool I use needs to have a way to change the theme for that latter group only. That tool (Optimizely) doesn't have access to the PHP hooks and functions, but it can alter the on-page JS code for the control/treatment groups.

Any advice would be much appreciated. If this is a bit confusing, I can clarify any questions ...


texts:
I want to do something very simple - create a content of a specific type when a user joins a group.

Unfortunately I can not find a simple way of how it should be done.

It can be done with rules so I've been thinking about triggering one, but the details would be awfully complicated.
I thought about having a template node that I would clone and edit, but how should I go for it? There are number of modules that do that in a strange way, while saying "it might sometimes not work properly", some people use things like drupal_execute(), I have found that node_save() has an option $node->is_new = TRUE.
I found someone suggesting a use of forms, but they were always very simple and were not working with complicated/custom fields. I figured that maybe something like this could work:

$form = drupal_get_form('my_content_node_form');
$form_state = array();
do_some_edits($form,$form_state);
drupal_form_submit($form->id, $form_state);

What is a proper/simple way of dealing with this issue? What I would expect see is something like $node = node_create($content_type) but for some reason I can not find it.


texts: Custom Search Page Filtered by Content Type

texts:
Is it possible to have custom search pages that filter based on content type? I attempted adding a hidden input to the search form like so:

<form class="search-block-form" data-drupal-selector="search-block-form-7" action="/search/node" method="get" id="search-block-form--7" accept-charset="UTF-8" data-drupal-form-fields="edit-keys--7">

<input title="Enter the terms you wish to search for." data-drupal-selector="edit-keys" type="search" id="edit-keys--7" name="keys" value="" size="15" maxlength="128" class="form-search">

<input data-drupal-selector="edit-submit" type="submit" id="edit-submit--8" value="Search" class="button js-form-submit form-submit">

<input type="hidden" name="type" value="blogpost">

</form>

But the search results page ignores the 'type' variable in the GET request and displays all results instead of just the results of the content type I want. I also noticed that you can create multiple custom search pages in the configuration page, but there doesn't seem to be any options for filtering by content type.
Is there anyway to have a search page that filters based on content type? Preferably without creating a view page.


texts: How to Determine view type (content, user taxonomy, etc)

texts: I have inherited a site and I am trying to customise and replace some of the views. I have been told that there are views of various types, content, user, taxonomy, search index, etc. Where in the view after it has been created does it indicate the type of view.


texts: Continue odd/even striping across grouped fields?

texts:
I'm using Drupal 7 and views 3.20, unformatted list, choosing a grouping field and selecting Add striping (odd/even), first/last row classes .

My views output is currently grouped by first letter:

A
 aa (odd)
 ab (even)
 ac (odd)
B
 ba (odd)

but i'd like the striping to continue across the grouping, so "ba" is even - i can resort to js but i'm sure there's a proper way i should be doing this.. thanks!


texts: How to make method entity_uri work when $entity_type is taxonomy_vocabulary?

texts:
I have a table with entities of type content, taxonomy_vocabulary and terms. For content and terms, I can show a link to each detail page by using the method entity_uri.

But for entities with type taxonomy_vocabulary this does not work, entity_uri returns null.

What is the best way to get the url for a taxonomy_vocabulary entity?


texts: Modal window open once when user visits website

texts:
I'm trying to build simple modal window using jquery ui implementation in my custom module. I want to show this modal once when user visit my website. I choose implementation with cookie.
How to make this modal appears once to user when he visit my website? should I use hook_init?

this is my codes:

mymodule.module

/* menu callback */
function mymodule_menu() {
    $items['mymodule-popup'] = array(
        'title' => 'Join Club',
        'page callback' => 'mymodule_ajax_register',
        'page arguments' => array(1),
        'access callback' => TRUE,
        'type' => MENU_CALLBACK
    );

    return $items;
}

function mymodule_ajax_register() {
    $path = drupal_get_path('module', 'mymodule');
    drupal_add_library('system', 'ui.dialog', false);
    drupal_add_library('system', 'ui.draggable', false);
    drupal_add_js($path.'/mymodule.js');

    $output = '';
    $webform_nid = 30;
    $node = node_load($webform_nid);
    $submission = (object) array();
    $webform = drupal_get_form('webform_client_form_'.$webform_nid, $node, $submission);
    $output .= '
';
    $output .= drupal_render($webform);
    $output .= '
';

    return $output;
}

mymodule.js

(function ($) {
$(document).ready(function(){
    $('#popup').dialog({
        height: 'auto',
        width: 700,
        autoOpen: false,
        modal: true,
    resizable: false
    });

    $('a').click(function(){
        var status = false;
        if(this.className !== 'lightbox-processed'){
            if(!getCookie('newspopup')){
                setCookie('newspopup', 'true', 1);
                $('#popup').dialog('open');
            }else{status = true;}
            if(this.className === 'ui-dialog-titlebar-close ui-corner-all ui-state-hover'){
                $('#popup').dialog('close');
                status = true;
            }else{
            }
        }
        if(this.id === 'bottomNavClose'){
            $('#popup').dialog('close');
        }
        return status;
    });

    function setCookie(name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }

    function getCookie(name) {
        var nameEQ = name + "=";
        var ca = document.cookie.split(';');
        for(var i=0;i < ca.length;i++) {
            var c = ca[i];
            while (c.charAt(0)===' ') c = c.substring(1,c.length);
            if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length,c.length);
        }
        return null;
    }

    function deleteCookie(name) {
        setCookie(name,"",-1);
    }
});
})(jQuery);

with those codes, when user visit myweb.com/mymodule-popup then click any link/url, modal window (pop up window) will appears.

How to make modal window appears once every time user visit my website?

I need advise from you guys, Thanks before.


texts: Search result to show link to the page not to the pdf file

texts:
I am using the Search file attachments module (which searches for text from pdf files after they are indexed), and everything works fine.

But I would like in Search result to display link to the content (where I uploaded the file) not link to the PDF itself, so that the user goes to that page and from there he can choose to see the PDF.

I am still new to Drupal, but from what I have read that I have to alter $search_results in search-results.tpl.php and use template_preprocess_search_results() to display what I want (not sure if this is the right way) or is there another way to this?

EDIT:

I found that I could edit search_file_attacments.module and there is the link attribute in $results[] I just have to figure out how to get nid (so I can get the url) from fid


texts:
How would one go about trying to accomplish the following under Views in D7:

Say I have four different content types (apples, oranges, kiwis, and mangoes) which are culminated into one view listing them all on a single page.

I'd like to try and add a CSS class to both apples and kiwis that is unique to each (for example, all apples having a class of "red" and all kiwis having a class of "fuzzy") but I do not want to add classes to mangoes or oranges.

How would I let Drupal know to add these classes based on their content types?


texts: Importing Bootstrap CDN-mediated styles into the Sub-theme's Style.css

texts:
I've opened a fresh Bootstrap sub-theme. This sub-theme is empty of any styles. What is the right way to import the CDN-mediated style sheets into the (now-empty) Style.css of the sub-theme?

It's a long story why I don't want to use the Bootstrap CDN in that particular case but I really just want everything to be local.

How could I import the basic Bootstrap Stylesheets into my Sub-theme's Style.css file and finally use everything local?

Thanks,


texts: How to create a table in second database with hook_schema

texts:
I want to use two databases, that works following: How can I setup multiple database connections in Drupal 8? .

I can set the connection in the settings.php file, access it by injecting a different database connection.

But how can I use a my .install file with hook_schema to create the tables in the second database?


texts:
I read:

Best way for including javascript/jQuery OnLoad in EVERY page on my site
How to get jquery working on Drupal 7 - for Newbies
How to include jQuery UI on a page without PHP?

I'm using jQuery Update module. Tried different versions of jQuery.

I have theme tao_test (that is subtheme of Tao). In tao_test.info I added:

scripts[] = scripts/ranger.js

And inside of this js file is this code:

(function($){

    Drupal.behaviors.tao_test = {
      attach: function(context, settings) {

          $("input#edit-field-range-test").before("

");

          $(".range-slider").slider({
              range: "min",
              value: 1,
              step: 1000,
              min: 0,
              max: 5000000,
              slide: function( event, ui ) {
                  $( "input#edit-field-range-test" ).val( ui.value );
              }
          });

      }
    };
}(jQuery));

Now problems:

When logged in as admin, slider kinda works, but looks strange:

There is no knob and overall it looks graphically broken. Also it only works if I set "CDN jQuery and jQuery UI" in jquery_update settings to some value.

When watching as anonymous user, I'm getting in firebugs console:

  TypeError: $(...).slider is not a function

What I'm doing wrong?

Added: Oh, I realized that this slider is supposed to be unusable without theming. However the problem with anonymous user is still current.


texts: Passing product info to PayPal using Comment1 and Comment2

texts:
We need to pass information to PayPal using their Comment1 and Comment2 fields for accounting purposes.  We have several units using the cart for different fees and our finance team needs to be able to see and sort by the units in question on the PayPal Manager website.  The Comment1 and Comment2 fields seem to be the ideal place to pass this information to PayPal, but we can't figure out how to populate and pass these fields to them in the module code.

How would you recommend accomplishing this?


texts: how to show views for particular language

texts:
I have simple problem - there is a view that is aggregating some info and it has a link in the main menu. I'm also using i18n and would like to have that particular view only in one language, but it looks like that it's impossible to make it - I can't find any option how to make the view just in one language - the main menu item appears in both languages and I can't figure out how to disable it.
I'm using D7 and newest Views.


texts: Sometimes shipping and/or billing address is missing

texts:
Unfortunately I have to ask a pretty vague question, and I can't provide much background because I can't reproduce.

Working on a Drupal 7 Commerce install with Domain Access we are (seemingly) randomly missing shipping and/or billing information on orders.  Sometimes the order has a billing name (or shipping name) but no address information.  Others, either shipping or billing is completely missing from the order view.

This is happening on ~1% of orders and I can't find any way to link them with consistency.  It has happened on PayPal Express Checkout orders, Authorize.net orders, orders with different shipping methods, orders from different domains, etc.  The stored API responses from the payment processors are normal.

In testing (on production), I can't reproduce; I've tried both payment methods, anonymous accounts, existing accounts, etc.  I can't even get past the Billing/Shipping form without completing all the information, no matter what I've tried.

Hopefully someone has experienced this before; if not, I'm totally open for "try this" or "look here" suggestions.

Thanks


texts: How to allow access to Webform Submission Grid results to Role

texts:
Giving admin privileges to sales dept seems bad.

The Webform Customized submissions is super!  However I am unable to create a link for my Sales manager to view the same data without giving admin privileges. (D8 Webform Version: 8.x-5.4)

  //mycompanysite.com/admin/structure/webform/manage/sales_appts/results/submissions

Since we cannot select Grid as the format in Views for webform submissions data, the unformatted layout is inferior to the customized version of the Webform/manage layout.


texts: How to use Block Access with specific Block?

texts:
I am using block access module to restrict block administration permission. I want to give permission to a role on specific block to edit that block. When I changed the permission firstly it permits only change title and description not body. Second it gives permission on every blocks I added manually.

I only want to allow one single block should be edited by site editors. How to do it?


texts: Best practice, removing admin access from many websites

texts:
hopefully this is not a repeat question, not sure how to search for this.

I run over 50 websites, not all are on the same server but some do hold many users together. Not all our servers are ours, some are ones we inherited.

Now say you have a developer who is admin on a dozen of these sites, is there an easy way to add/remove developer access to multiple servers across many domains in a low-effort manner? I'm looking at Drupal access but also SSH/cpanel access, database passwords and many other related passwords [LAMP systems].

It is a pain, as you know, to have to change all passwords on all systems when someone leaves and I was wondering how other people/organizations deal with this issue?

Thanks for any recommendations or thoughts you might have towards this!


texts: How to get views machine name in `block--views-block-html.twig` file?

texts: I've create views as block. Then i tried to theme my views block by altering block--views-block-html.twig file. I've struggled to get views machine name in this file. I need views machine name for some reason. So any other solutions to get views machine name?


texts:
I use drupal 7.26 and try to install Rules(7.x-2.6) with drush (drush en rules -y)

I can not visit my drupal site Now.

I install Xdebug. this follow is error detail:

Fatal error: Class name must be a valid object or a string in /Users/tangmonk/MyGit/Drupal/daxuebao/includes/common.inc on line 7837

#   Time    Memory  Function    Location
1   0.0011  240392  {main}( )   ../index.php:0
2   0.0155  656312  drupal_bootstrap( ) ../index.php:22
3   0.2055  5039280 _drupal_bootstrap_full( )   ../bootstrap.inc:2260
4   0.6304  21000048    module_invoke_all( )    ../common.inc:5158
5   0.6328  21061544    call_user_func_array ( )    ../module.inc:895
6   0.6328  21061744    rules_init( )   ../module.inc:895
7   0.6343  21098688    rules_invoke_event( )   ../rules.module:12
8   0.6343  21099144    rules_get_cache( )  ../rules.module:969
9   0.6666  22764416    RulesEventSet::rebuildEventCache( ) ../rules.module:333
10  0.7564  25670784    rules_config_load_multiple( )   ../rules.plugins.inc:764
11  0.7564  25670872    entity_load_multiple_by_name( ) ../rules.module:804
12  0.7564  25670936    entity_load( )  ../entity.module:252
13  0.7564  25671016    entity_get_controller( )    ../common.inc:7804


texts:
I've gone ahead and installed Localization Update, Localization Client, Language Switcher Dropdown, and the Language Icons modules. I've also enabled the Locale and Content Translation modules.

I've added two languages to my site (Finnish and French). According to the Translate Interface (Configuration --> Translate Interface), all of my modules are up to date for translations. However, the Drupal Core (7.24 it says, even though I haven't updated to 7.24 yet, still on 7.23), says "No available translations found" for both Finnish and French.

Just wondering if anyone has any idea on how to fix this? I haven't tried manually downloading and installing the .po files yet, as that's not really a solution for me, as I will be unable to do this manually for all of our clients.

Just wanted to add that I've tried this now on a few different setups and I still get the same thing happening on each one. I also tried one machine from a fresh install using 7.24, and still get the problem.


texts: More Stories appears when a user scrolls on a half page

texts:
More Article Box (More Stories) appears when a user scrolls on a single post at least 400px. The box appears in the right bottom corner and it can show one or more posts related with the current one.

Is there a module like this for Drupal 7?


texts: How to, in a View, get list of links up against each other (concatenated without line breaks when displayed)?

texts:
I have a Drupal 7 view that gives me a list of links to recently added content of a specific type. For what it's doing, it's working fine.

However, it puts every content item in a separate
 causing it to appear on a line of its own. I'm using the Unformatted list output format with all fields set as inline.

I want to simply list all the items concatenated.

Currently the view renders as approximately the following HTML:

          DATE1         -
          TITLE1

          DATE2         -
          TITLE2

...

I can get rid of the DATEs easily enough; that's just one of the fields being displayed. I was able to add the separating commas (using Custom text), and can easily use CSS to hide the last one if there's no better way. The problem is that I want the view to then basically render in the browser as something not entirely unlike:

  TITLE1, TITLE2, ...

for the specified number of entries, where each TITLE is a link to the relevant LINK, the browser displaying them all in one normally-word-wrapped line.

How do I accomplish that?

Seemingly no matter what I try, the newlines remain in the browser-rendered output. Google was decidedly unhelpful, although I'm not ruling out that I searched for the wrong terms.

Just in case it makes a difference, I am using the MAYO theme.


texts: How to solve the "The following module is missing from the file system" error?

texts:
I am getting the following error in a Drupal 8 site.

  The following module is missing from the file system

It looks as if a custom module was installed and deleted without uninstalling it.

How can I fix this error?


texts: Entity Field Query OR condition,between node title and a custom field

texts:
I am executing a query for searching in the node title and a field using LIKE.How do I use the OR condition?
`function hook_somefunction($keys) {
$query = new EntityFieldQuery();
  $query->entityCondition('entity_type', 'node', '=')
  ->entityCondition('bundle', 'product_display_one');
  //$query->addTag('customproductstag');
  $query->addMetaData('keys', $keys);

//both conditions below are working fine individually ,but I need to use OR in between them
  //$query->fieldCondition('field_usage_number', 'value','%'. $keys .'%', 'LIKE');
  //$query->propertyCondition('title',$keys .'%', 'LIKE');
  $result = $query->execute();
  return $result;
}

//This part below is not working
function hook_query_customproductstag_alter(QueryAlterableInterface $query) {
  $keys = $query->getMetaData('keys');
  $or = db_or()
    ->fieldCondition('field_usage_number', 'value','%'. $keys .'%', 'LIKE')
    ->propertyCondition('title','%'.$keys .'%', 'LIKE');

$query->condition($or);
}  `

Thanks.


texts: What is the difference between creating fields programmatically and by exporting settings?

texts:
We are developing a custom app with decoupling approach. There are going to be many custom entities with fields. What is your preferred way to create fields programmatically, so we have all information in the code and can build our custom logic on it? So far I have identified three ways how to do it:

using the BaseFieldDefinition::create in the entity class.
using .yaml files in the modules config/install directory
using Features

With the first option, there is a problem that Workflow modules, which would be helpful, does not support the creation of the entity fields in the code (see https://www.drupal.org/project/workflow/issues/2960185). However, we can still replace Workflow module with custom entities and logic.

With other two options I am not entirely sure what are the pros and cons of using them. They just seem to me quite difficult to add custom logic, and/or methods to entities or create new field types (plugins).

Any suggestions will be much appreciated.


texts: Custom save message for site information form

texts:
Folks,
I need to alter the site information form. I used api_form_system_site_information_settings_alter hook to do so. After submitting I need to print a custom message. I used one submission handler, but the data not saved. My .module file is given below.

use Drupal\Core\Form\FormStateInterface;

function api_key_form_system_site_information_settings_alter(&$form,
 FormStateInterface $form_state, $form_id) {
 if($form_id != 'system_site_information_settings') {
    return;
}
$site_api = \Drupal::config('api_key.settings')->get('siteapikey');

$form['api_settings'] = array(
    '#type' => 'details',
    '#title' =>t('Site API settings'),
    '#open' => true
);

$form['api_settings']['siteapikey'] = [
    '#type' => 'textfield',
    '#title' => t('API Key'),
    '#default_value' => $site_api,
    '#description' => t('Enter the API key for making the site
        protected on API calls'),
    '#maxlength' => 32,
    '#required' => true,
    '#placeholder'=> t('No API key yet')
];

$value = !empty($site_api)? t('Update Configuration'): t('Save Configuration');
$form['api_settings']['actions']['#type'] = 'actions';
$form['api_settings']['actions']['#type'] = 'actions';
$form['actions']['submit'] = [
    '#type' => 'submit',
    '#value' => $value,
    '#button_type' => 'primary',
];
$form['actions']['submit']['#submit'][] = 'api_key_form_submit';
return $form;
 }

function api_key_form_submit(array $form, FormStateInterface $form_state) {

$site_api = \Drupal::config('api_key.settings')->get('siteapikey');
//Reads the new value form the form instance.
$new_value = $form_state->getValue('siteapikey');
//Changes the success message based on the condtions.
if(!empty($site_api)) {
        //Sets update message.
    $message = t('Site API key is changed from @old_value to
        @new_value', [
            '@old_value'=> $site_api,
            '@new_value'=> $new_value
        ]);
} else {
        //Sets success message.
    $message = t('@new_value is set as site API key.',
        ['@new_value'=>$new_value]);
}

//Prints the message.
drupal_set_message($message,$type='status', $repeat=true);
}


texts: I am searching for a way to have the drupal search pull up pages from the drupal site PLUS search results from google in general (not site specific search). Does anyone know some direction how to accomplish this?


texts: How to get price to update when changing attrubutes within a View

texts:
I have a view and have a relationship so I can display the product price. When I change an attribute option, the price field doesnt dynamically change.

I think I will have to do something with the style settings and change to DIV, check create a CSS class and add a tokenized CSS class so it will change when the product id changes? but i cant get it to work.

What I've done so far:

Add relationship Content: Referenced products
I have 3 fields: 1.
content nid (excluded from display) 2. product add to cart form. 3.
commerce product price field.

At this point i can display the price but it doesnt update when i select various attribute options

Style Settings, Customize field HTML --> DIV --> Create a CSS class

I think under the create a CSS class i need to print a CSS class with a product id token or something like that, but cant find the correct token or CSS valule.


texts:
The following command clones the field with the same label.

drush field-clone field_tags newtags

As you see, the cloned field has the same title Tags.

So how can I clone the existing field with desired label?


texts: How to skip first row in a dynamic query?

texts:
I've not yet found the right way to use ->range($offset,$limit) in a dynamic query to skip first result, but without limiting the resultset (LIMIT clause).

The only workaround I've found is to use an high value for LIMIT, for example:

->range(1,99999999);

(see my comment in Drupal API documentation: https://api.drupal.org/comment/49938#comment-49938)

What's the right sintax?


texts: What does "path has not been overridden because the menu item does not exist." mean

texts:
I've noticed the following error message in a few different situations.

  Path has not been overridden because the menu item does not exist.

Cases in witch I have seen the error message

Trying to override admin/commerce/orders/% with a panel.
Also using "Views PDF Display" + "rules link" to send a pdf to a user's email.

The downside I see so far for this message is that I cant override the url with a panel.

I Think it is because a module has already taken control of that path.

Is there a way to see what is causing the error message?


texts: How to create a field that references a Views Block display in D8?

texts:
In D7, using the blockreference contrib module, you could add a field to a node (say) that allowed the user to reference a block. When viewing the page the referenced block's rendered content would be included.

This was great for including widgety stuff on a per-page basis, especially when combined with the Paragraphs module.

I have a View which defines a number of Block displays. I want to reference a particular one from a node and I'm struggling to do this in D8.

When creating the reference field, I'm offered various things under the "References" optgroup, but none include Block. I tried "References » Other..."
which seemed to be the generic entity reference that I thought would work.

Next I'm asked what type of entity to reference, which is split between content and config. I suppose this is config since a view is config, even if its config that provides content (ouch my brain). Under Config I see block. Great! I want it to reference a block.

However, after selecting that I cannot seem to reference the block created by my view - switching the form display to select list to see what is available I see all sorts of stuff (some, like "primary admin actions" apparently repeated 4 times?!) but NOT the view's blocks.

The other option that looked relevant for "which entity to reference" is View. But if I do that I just get a link to the view's edit screen.

I've since found that if I place the block in the disabled section, then I am able to reference it.

So is there a better way to reference a block or do I have to do this odd thing of create a block » place as "disabled" » reference. Alternatively, is there an explanation why having to do things this really confusing way brings an important benefit to site building that I ought to understand?

Thanks in advance.


texts: Special code for .htaccess and robots.txt files

texts:
My client was noticing that his site was extremely slow yesterday morning so he contacted his WiredTree host, who suggested that we add the following code in the .htaccess file:

Options +FollowSymlinks
RewriteBase /
SetEnvIfNoCase User-Agent "^SemrushBot" bad_user
SetEnvIfNoCase User-Agent "^DotBot" bad_user
SetEnvIfNoCase User-Agent "^AhrefsBot" bad_user
Deny from env=bad_user

Options +FollowSymlinks is already in the file and RewriteBase / is currently commented out and I'm not sure if I should uncomment it, not knowing what affect that would have. Then I would add the 3 set commands and the deny command below it. Is it OK to uncomment this line and add the extra commands?


texts:
drupal_validate_form is not validating required validation when i was creating a node programatically .

Can any one say, it is design like that or am i doing something wrong .

        $node_form = (object) array(
            'type' => 'MY_CONTENT_TYPE',
            'language' => LANGUAGE_NONE,
        );
        $form = drupal_get_form('application_node_form',$node_form);
        $old_fs = @unserialize($r->form_state);
        $form_state = array();
        $form_state['values'] = $old_fs['values'];
        $form_state['values']['op'] = t('Save');
        $form_state['submitted'] = 1;
        $form_state['complete form'] = array();
        $form_state['triggering_element'] = array('#parents'=>array('next'),'#button_type'=>'submit');
        unset($form['#token']);
        drupal_validate_form('MY_CONTENT_TYPE_node_form', $form, $form_state);


texts: Drupal Views: Get all of x categorised by y

texts:
Is this possible?

I have products and each product has a list of associated downloads. I would like to output all downloads (an index of downloads if you like) but split by headings of each product.

Product A
• Download A
• Download B
• Download C

Product B
• Download D
• Download E
• Download F

Can I get this through Drupal Views?

Update:

Just to give anyone seeking the same solution a helping hand...
In views Advanced turn Use Aggregation on.

Add the fields you would like to use.
The aggregation settings automatically pop up after adding a field. For Associated Product, I chose Group By.

Then in the Format (HTML List) settings, choose group by Associated Product.


texts: Adding users to organic groups in CiviCRM

texts:
I have a site which uses Organic Groups, specifically with CiviCRM. I want to add a user to a group and I am having issues. The group is marked as closed. I want to how to either

add a user to a existing group
open up a closed group

I haven't been able to figure out how to do either of these.


texts: It is my understanding that in Drupal 7, breadcrumbs are primarily (core) formed from the menu. Thus what happens with nodes (pages) which are not menu related? Are the breadcrumb derived from the title node?


texts: Webform 'add element' and 'addpage' buttons do not appear

texts:
I am new to Drupal. I have Drupal 8 and installed Webform 8.x-5.1 module.
I can create a new webform but 'add element' and 'add page' do not appear so I cannot add any elements to the form as I see on tutorials online.
Any ideas?


texts:
Im trying to create a product page, but my boss wants different css for every next photo and text. I need 2 different css styles, that will aply on where the image is. Like the first block will have the image at the left and the second block will have the image on the right.

This is basicly what im trying to do :

I think I could do this with css and some custom classes? So that every added block with text and image will align itself properly without having to edit the css for every block everytime you create a new block. If someone could point me in the right direction on how to achieve this, that would be great !:)


texts: Create a percentage discount coupon with a maximum value

texts:
Need to have a coupon that follows this basic logic:

IF (Commerce % Coupon Granted amount > Max Value) THEN
    Commerce % Coupon amount = Max Value
ELSE
    Commerce % Coupon amount = % of ORDER

For example:

10% with a max of $100.

  Order value = 500, Discount = 50 (10% of 500)
  Order value = 1000, Discount = 100 (10% of 1000)
  Order value = 1500, Discount = 100 (flat 100)


texts: Add a column to a Views table display conditional on argument

texts:
I have a custom View defined in a module which provides a table display of data which takes a Node ID as an argument.

------------------
| Col 1  | Col 2 |
------------------
| A      | B     |
------------------

I want to be able to check some data from the node that is the argument to see if a certain field is set to either 0 (no extra column) or 1 (an extra column).

Using hook_views_default_views_alter() I can add an extra column to the table using:

function MODULE_NAME_views_default_views_alter(&$views) {
  if (isset($views['VIEW_NAME'])) {
    // Add an extra field to the rider times view
    $handler = &$views['VIEW_NAME']->display['default']->handler;
    $handler->display->display_options['fields']['nothing']['id'] = 'nothing';
    $handler->display->display_options['fields']['nothing']['table'] = 'views';
    $handler->display->display_options['fields']['nothing']['field'] = 'nothing';
    $handler->display->display_options['fields']['nothing']['label'] = '';
    $handler->display->display_options['fields']['nothing']['alter']['text'] = 'Download';
    $handler->display->display_options['fields']['nothing']['alter']['make_link'] = TRUE;
    $handler->display->display_options['fields']['nothing']['alter']['path'] = 'download/[nid]/[number]';
    $handler->display->display_options['fields']['nothing']['element_label_colon'] = FALSE;
  }
}

But this adds the column to all the tables regardless of the argument.

I guess there should be a way to add the column through hook_views_pre_render() but I can't figure out how.

The alternative would be to set up 2 views. One with the extra column and one without and conditionally show the correct view based on a Context/Panel visibility filter.


texts:
I have been messing around with data migration and I ended up with a rather corrupted taxonomy with the wrong terms in it.

I would like to completely delete the terms inside the taxonomy. I have not found any drush command for doing it. A module search was also unsuccessful, in fact I found a dead one named cleantaxonomy.

I can try to build a SQL query to do this but I am sure someone stepped into this before.


texts: Is it possible to organize template files?

texts:
As I've gotten more familiar with Drupal, I've been utilizing template files more and more. However, the naming conventions for template files make them difficult to organize. Is it possible to organize template files into different directories within the primary templates directory? I'm using Drupal 7.

If it isn't possible, are there alternative methods to organize template files?

Thanks!


texts: Why does user_load($id) NOT return FALSE when an invalid id is passed in?

texts:
I'm making a module that lets users manage database records for various organizations.  I'm using Drupal 7 and an very new at it.  I'm logged in as the admin user. I have a menu item 'cb' that checks args and returns content generated by various functions, here it is in the menu:

function org_menu() {
  $items['org'] = array(
    'title' => 'My Orgs',
    'page callback' => 'org_show_orgs',
    'access callback' => TRUE,
  );
  $items['org/create_org'] = array(
    'title' => 'Create New Org',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('org_create_form'),
    'access callback' => TRUE,
  );
  $items['org/search_orgs'] = array(
    'title' => 'Find Orgs',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('org_search'),
    'access callback' => TRUE,
  );
  $items['org/cb'] = array(
    'type' => MENU_CALLBACK,
    'page callback' => 'custom_callback',
  );
  return $items;
}

And this is the cb function that determines what I am trying to do, and calls the appropriate content function:

function custom_callback () {
  if ( arg(2)=="edit" )
    return org_edit_org();
  if ( arg(2)=="view" ) {
    return org_show_orgs();
  }
  return "
Invalid callback function: '".arg(2)."'";
}

and the actual org_get_orgs function:

function org_show_orgs() {
  global $user;
  $acctid=arg(3);
  if ( !$acctid && $user->uid==0 )
    return array('my_content' => '
My Orgs
Please log in to view your orgs.'.
                    '

Find Orgs
', drupal_get_form('org_search'));

  if ( $acctid ) {
    //return "case1 arg0=".arg(0)."
arg1=".arg(1)."
arg2=".arg(2)."
arg3="
    //              .arg(3)."
arg4=".arg(5)."
acctid=$acctid

";
    $account=user_load($acctid);
    //return "case2 arg0=".arg(0)."
arg1=".arg(1)."
arg2=".arg(2)."
arg3="
    //              .arg(3)."
arg4=".arg(5)."
acctid=$acctid

";
    if ( $account===FALSE )
      return "
Invalid acctid "+$acctid+"
";
    else
      return "
account was not FALSE
";
  }
}

cb() gets called correctly and the org_show_orgs() function gets called as expected.  arg(3) is the user id, so I can allow a user to view another user's orgs.

I hit the url
http://example.com/?q=org/cb/view/1
and it works - I see admin's orgs.  If I pick a userid for another user, it works - I see their orgs as well.  The problem is when I tinker with the url and pass in an id of a user that doesnt exist - then I get all kinds of weirdness.  For example, if I hit

http://example.com/?q=org/cb/view/4

If I uncomment that case2 line, I clearly see all my variables are correct:

case2 arg0=org
arg1=cb
arg2=view
arg3=4
arg4=
acctid=4

but if I try to test if $account===FALSE, I get the maintenance page.  If I change the id to 3, I get an 'access denied' page.  If I change the id to 2, I see a 'page not found' page.  If I try return print_r($account,TRUE); I get the menus and a completely blank content cell.  No error, which I'd get it it was a non-array object.  If I try get_class($account) after I retrieve it, I get the menus but no css, and everything is just listed down the left side, no regions, themes, nothing.

Besides the $account issue, is there a better way to be doing this than that callback menu, or is that the drupal way?


texts: Where can I find where this content is being loaded from?

texts:
Helping out a friend with a Drupal based site. On one page, he has a series of images with a lightbox displaying info once clicked.

This however doesn't function, and instead shows as an image title.

I was just wondering where I'd find the file with the descriptions?

Thanks


texts:
I'm using a theme called Danland, and I want to change the Recent Posts block to show only post title and publication date. As it stands it shows 3 columns, one of which is post title, and the last two of which are blank when you are not logged in and say "edit" and "delete" when you are logged in. I also want to kill the table border.

I can't find the right css file to edit. Using firebug to ID the td and other tags to kill to get rid of the extra columns, but I can't find them in the theme files. Firebug IDs them as being in style.css, but there's nothing there. Where does this code live?


texts: I'm using the Slick Carousel module in my D7 layout and it's awesome. My carousel view is currently set to Grid, and to display 9 slides at a time. That said, how can I set the view to display a different number of slides (at different sizes) when the site is being viewed from a mobile device? For example, if the browser is open on a phone and only 414px wide, I want to display 1 slide in the carousel instead of 9 slides with their current image style.


texts: Loading cck fields from nodes of a content type

texts:
I have created 4 nodes by a content type called insert_item using CCK; now I am trying to load all CCK fields into a template of a new node where I would use the CCK field value of the insert_item content type.

What I have written is the following code:

$nodes = array();
$result = db_query("SELECT nid FROM {node} WHERE type = 'insert_item'");
while ($row = db_fetch_object($result)) {
  $nodes[] = node_load($row->nid);
  print $nodes;
}

What I got is the following:

  ArrayArrayArrayArray

I really don't know what to do.


texts: Allow editing of user content by account creator

texts:
I have to create a set of user roles and permissions for sets of teams.

Users with a "coordinator" role would be able to create and manage a set of subordinate accounts.

The 'coordinator' role should also be able to edit content created by one of their own subordinates - but no one others.

If the coordinator were to change, it should be possible to assign their existing permissions and privileges in regards to their subordinates to a new user.

Is this easy to do with Drupal 8?


texts: Why cannot I print $form in my template file?

texts:
I have a "video" content type. I want to customize the template file for edit form,
page--node--add--video.tpl.php, but when I render (or print) $form, it returns NULL.

What is the problem?


texts: Is it possible to declare a Javascript library dependency at Hook.info?

texts:
Below is my module.info file:

name = myid
description = Creates an ID template, Inputs ID form, Prints an ID and View System Statistics .
core = 7.x
package = CSU

;Jquery Library
dependencies[] = jquery_update (>=7.x-2.5)

;Needed to create text editors.
dependencies[] = imce (>=7.x-1.9)
dependencies[] = wysiwyg (>=7.x-2.2)
dependencies[] = imce_wysiwyg (>=7.x-1.0)

I know required module of my custom module can be declared in my module.info file to inform module users that it depends on it. How about javascript library like TinyMCE? Is it possible to declare it at hook.info? How will I inform that the user must also download TinyMCE.

I was thinking of including it using drupal_add_js but Tinymce is always stored at drupal\sites\all\libraries\. Please enlighten me in my problem. I'm a bit lost.


texts: Register a new namespace for autodiscovery

texts: I'm using a vendor library that isn't managed through composer. I want to register the namespace for the library so that it will be discovered through PSR-4. I'm not sure how to go about doing this in D8 though. Can anyone point me at something?


texts: How can I see what visitors are searching for?

texts:
Are visitor search terms stored somewhere in Drupal 6? I see a search_total table that might hold that info but the data in there looks kinda weird.

I'm using search module in core.


texts: Is possible for a module to know when one of its blocks is being output on the dashboard, and change the content of that block?

texts:
Drupal 7 has a new core module (dashboard.module) that allows users with the right permissions to add blocks defined from third-party sites to the dashboard, which is shown as overlay on the current page.

Is it possible for a module that implements blocks to know when the block is being rendered on the dashboard?
The idea would be to change the content of the block, and make it smaller (for example).


texts:
Now have set up multi-sites is it possible to just cp database.sql to other databases so the site is duplicated but running independently?

I remember when I first set up multi-sites I got it wrong so that when changes were made to one database , it would translate to other until I separately created databases for each.

I know there are other ways of saving settings for a commonly created site in features which I have yet to try but isn't it easier to just copy the mysql over
to other database and make small changes from there?


texts: How can I create a panel/page/view that shows a list of nodes, and on the other side of the screen details about that node?

texts:
Below is the generally layout of what I want to do. A list of nodes/items of a fixed content type with a custom view on the other side.

On the left hand side we see a list of nodes, shown as squiggles. One is selected (highlighted with a red border).
On the right hand side we see the details of this node: The Title, The Description and so on.

I've looked into Views and Panels. I think what I want is a View that is specific to the listed content type. And then to include that in a panel that has the list?

I've tried several times but gotten mixed up in what I need to do.

Is there a simple non-video (blocked at work) guide to doing this sort of thing?

All the examples I've seen either use pure php or make too many assumptions about knowledge of drupal.


texts: Pathauto patterns produce segment duplicates

texts:
I have set up a pathauto pattern for a wiki-section that looks like this:

wiki/[node:menu-link:parent:url:alias]/[node:menu-link:title]

I want it to produce links such as wiki/page and wiki/page/subpage and it works fine for first level links, but for sublinks it duplicates the first segment and produces links such as wiki/wiki/page/subpage.

What is the correct pattern I should use?


texts:
I have a series of nodes which are published on up to 7 different domains on the same single Drupal 7 install. Whilst I can use url('node/12345'); for nodes published to the current domain, I would like to create href links to the these nodes and have them link to the correct domain path.

At the moment, nodes that are not published to the current domain are just giving me href="/12345".

How do I get the URL for nodes that aren't in the current domain?


texts: How to set a specific date (fixed value) as default value on a date field?

texts: I have a commerce order on which I have added a date field. The options for the default value are Now or Relative. How can I add a fixed default value, f.x. 20 Aug 2016?


texts: Alter a field by select list in entity form

texts:
I have a problem with Ajax and some fields in my entity form. i have a select list in my form and when i change the selected option i wanna increment another field. To explain better, i can create some entity called "modification", in this entity i have a select list with options "option 1, option 2, option3". When i will create an entity with "option 1", my field incrément will be "1", in a create a second entity with "option 1" the incrément will be "2". But if i create a third entity with "option 3" my increment will be "1".

The first thing i need to do is to collect the element list choosen automatically and do an EntityFieldQuery. When i got the count of result i just want to put the count in my field "increment".

Here is my code in hook_form_alter (field_pjt_phase is my list) :

$form['field_pjt_phase']['und']['#ajax'] = array(
     'event' => 'change',
     'callback' => 'projetcreate_modification_callback',
     //'wrapper' => 'field_event_1_role_replace',
);

And my callback :

function projetcreate_modification_callback($form, $form_state) {
      //$valeur = $form_state['values']['list_eltmission'];
      //My EntityQUery to take the last increment....
      //return $form['field_event_1_role'];
      var_dump($form);
}

And here a picture of my fields :

How can i execute the Query when i change the select list ? How to put the result of my coult entityquery in my second field ?

Thanks for your help.


texts:
Drupal out of the box comes with a page (which is the default homepage) that is assigned to the node path.

How do I avoid users reach it, and redirect them to the actual homepage of the site?


texts: Node Edit Form and twig template - confusion on where some values come from

texts: I'm still pretty new to Drupal and had a question about the node-edit-form twig template. In them template, you can render {{form}}, {{form.advanced}}, and {{form.actions}} but when using xdebug, the form variable doesn't actually have those values in the array. How are those being processed? I'm curious now i'f I've missed this in other twig templates for other arrays/objects.


texts:
I'm wondering if it's possible to override a contributed modules hook_menu function.

/**
* Implementation of hook_menu().
*/ function jquery_ajax_load_menu() {   // Admin settings.   $items['admin/config/development/jquery_ajax_load'] = array(
    'title' => 'JQuery AJAX Load',
    'description' => 'Shows any page on a AJAX link',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('jquery_ajax_load_admin'),
    'access arguments' => array('administer site configuration'),   );   // Only to generate a TAB   $items['admin/config/development/jquery_ajax_load/link'] = array(
    'title' => 'JQuery AJAX Load',
    'type' => MENU_DEFAULT_LOCAL_TASK,   );   // Prefix for AJAX requests   $items['jquery_ajax_load/get'] = array(
    'page callback' => 'jquery_ajax_load_callback',
    'type' => MENU_CALLBACK,
    'access arguments' => array('access content'),
    'delivery callback' => 'jquery_ajax_load_delivery_callback',   );   return $items; }

Essentially I want to override the 'delivery callback' => 'jquery_ajax_load_delivery_callback',  So that it calls a modified version of the same function, as apposed to hacking the module.  'delivery callback' => 'mymodified_jquery_ajax_load_delivery_callback',


texts:
We got site written on Drupal.

We want to make Nginx caching but there is one problem we met.

Nginx caching works perfect, but if user A will go to page http://domain.com and nginx cache it. User B use mobile theme http://domain.com/?theme=mobile and went to http://domain.com/ , he will see desktop version instead of mobile version.

I want to make something like http://domain.com/any/url/path for desktop version and http://domain.com/mobile/any/url/path

Is it possible? Where can I found information about how to do it?


texts: Missing FieldItem properties while in entity::preSave()

texts:
I have a custom FieldItem that has a single 'value' property that is also a custom TypedData.

This TypedData property holds an object. The \Drupal\Core\TypedData\TypedDataInterface::getValue() on the property(TypedData) returns a string fetched from the represented object and \Drupal\Core\TypedData\PrimitiveInterface::getCastedValue() returns the represented object.

All is working fine but one thing. In my entity which has this FieldItem attached, I update its value in the entity::preSave() operation.

And Drupal started to complain Notice: Object of class ... could not be converted to int in drupal_schema_get_field_value().

And I couldn't figure out why was the represented object used instead of the "plain" value.

After a bit of debugging I have found that when I set the FieldItem's value(I pass an object) in the entity::preSave() the FieldItem's properties are not loaded which will cause the \Drupal\Core\Field\FieldItemBase::__get() fetching the value from FieldItem values array instead of getting it from properties.

Any idea why the properties are not loaded? I was thinking that it has something to do with performance maybe but since the field item is just a wrapper around data types it makes no sense that field item would handle the data itself.

Edit:
Looking more closely at entity values and properties it seems that only computed properties are initialized by default. But real properties are initialized only when \Drupal\Core\TypedData\Plugin\DataType\Map::get() is called. The values are meant for plain values when creating a new entity for example, if I understand it correctly, but I don't get why the properties are not utilized yet.


texts:
I copied the twig file from the user view in my theme.

I want to display:

"Online" if the user is logged in.
"Absent" if the user has not had any activity for more than 15 minutes.
"Offline" if the user is disconnected.

How to do this with twig ?

{#
/**
 * @file
 * Default theme implementation to present all user data.
 *
 * This template is used when viewing a registered user's page,
 * e.g., example.com/user/123. 123 being the user's ID.
 *
 * Available variables:
 * - content: A list of content items. Use 'content' to print all content, or
 *   print a subset such as 'content.field_example'. Fields attached to a user
 *   such as 'user_picture' are available as 'content.user_picture'.
 * - attributes: HTML attributes for the container element.
 * - user: A Drupal User entity.
 *
 * @see template_preprocess_user()
 *
 * @ingroup themeable
 */
#}

    {{ content.user_picture }}
    {{ user.label }}

    {% if logged_in %}
       En ligne
    {% else %}
       Hors ligne
    {% endif %}

The preceding code displays the status of the current user.

For example for comments I want to display the status of the author of the comment (not the node). I have this line of code in the comments twig file.

Can I reuse the code to obtain the status of the author of the comment ?

{{ drupal_entity('user', comment.uid.target_id, 'comment') }}


texts:
I'm trying to load a production site in a dev environment using the site's codebase (core 8.3.7, contrib and custom modules and vendor folder) and the current database.

After struggling a bit with it, I managed to import the DB (it's PGSQL with a lot of extensions), and the site was up. I looked into the status report page and besides a few update warnings, there are no errors.

First time I try to clear cache, the site breaks and starts complaining about missing modules (one of them made sense, the other is the basic_auth module, which is in core). I manually cleaned up the missing one from the DB, but I'm getting a log of PluginNotFoundExceptions, which to me, says I must have done something wrong. I've tried importing the DB again and I traced the caching issues down to router cache and views cache. All of the other caches are cleaned with no issues, but these two throw the above exceptions.

I've tried to install the codebase again via composer, respecting the .lock file with composer update --lock, and it says there is nothing to install/update.

I'm a bit lost, and the only way I can make the site work (even if momentarily) is by importing the DB again, but it breaks after cache clearing and/or configurations being exported, either via drush or via backend.

AFAICT, even if the codebase was in fact missing something (ie, someone installed something in production not managed by composer), it would show up in the contrib folder and by importing the DB it should be fine, right?

Does anyone have some suggestions on where to start looking for the problem?


texts: Print preview and Printer-friendly version look different

texts:
I am using a Print module with a bartik subtheme. I am trying to override the print module styles by using my theme's print.css file. Is this correc tway of doing this?

Both the print preview and preview via the printer-friendly version generated by the print module look different...

How would I go about overriding the print module styles?

This is how the print stylesheet is being called in my theme:
stylesheets[print][] = css/print.css


texts: drupal_set_breadcrumb() function doesn't work on "Add content" pages!

texts:
I have written a custom block and put it inside the panel of "Add Content" page, but it can not change the breadcrumb. Actually the code in module includes drupal_set_breadcrumb() function, which doesn't work on “Add content” pages. My code is working on the others pages!

I need your help to change only the breadcrumb of each "Add content" page without using the available modules for drupal breadcrumb. Because I have written my code and the customization level is so high which can not be obtained with those modules.


texts:
How one can get a field auto loaded with node title by passing nid. I mean instead of getting the selectllist of all available title i want it to be auto loaded with corresponding node title.

NOTE: I have passed nid to that content type. Now have to fetch the corresponding node title into a field.

Thanks in advance ,
Manju


texts: Render variables printed by {{ dump(user) }} in a template?

texts:
I have the following code in node.html.twig.

{{ dump(user) }}

I get this output.

object(Drupal\Core\Session\AccountProxy)#523 (4) {
["account":protected]=>
object(Drupal\Core\Session\UserSession)#91 (16) {
["uid":protected]=>
string(1) "1"
["roles":protected]=>
array(2) {
  [0]=>
  string(13) "authenticated"
  [1]=>
  string(13) "administrator"
}
["access":protected]=>
string(10) "1513942493"
["name"]=>
string(5) "admin"
["preferred_langcode":protected]=>
string(2) "en"
["preferred_admin_langcode":protected]=>
NULL
["mail":protected]=>
string(18) "noreply@imi.org.uk"
["timezone":protected]=>
string(13) "Europe/Berlin"
["langcode"]=>
string(2) "en"
["pass"]=>
string(55) "$S$E7IRVipuFHHectBpj8GkGZGPHlFWNQKG9ydDoRpwBDcCbzklpVaj"
["status"]=>
string(1) "1"
["created"]=>
string(10) "1513920795"

I want to render value of ["created"]=>string(10) "1513920795" and ["uid":protected]=>string(1) "1". What is the syntax or code to output them from the template?


texts: Restrict vocabulary on entity_autocomplete form field targeting taxonomy terms

texts:
I'm creating a form with an entity_autocomplete field targeting taxonomy terms, and I would like to restrict it to a certain vocabulary. Is there a way to do that with '#selection_settings'? I can't find any example.

This is the code I am using.

$form['p_cat_ac'] = array(
    '#type' => 'entity_autocomplete',
    '#title' => t('Product Category'),
    '#target_type' => 'taxonomy_term',
    '#selection_settings' => [
        'include_anonymous' => FALSE,
    ],
);


texts: Controlling node's content using field setting

texts: In a module I am developing I wish to control display of a link in node's content depending on user's choice. I want to display this option to user(whether he wants to display the link on particular node) when he is on a path like this /node/{node}/edit with other options(menu settings, comment settings) available on that page. On doing some research I managed to find out that usage of field plugins would be required. This I am saying because comment module implements FieldType plugin and displays option of type open, close, hidden comments. But now I am not able to move further because I am not able to understand how will I keep track of option selected by user for different nodes. It would be great if any one can throw some light on this, some code or reference to similar usage by other custom module would be  of great help. Thanks.


texts: Set CSS class for a View programmatically in a hook

texts:
I want to set an extra class for the first page of a paged View.

/**
 * Implements hook_views_pre_render().
 */
function my_module_views_pre_render(ViewExecutable $view) {
  if ($view->id() === 'my_view' && $view->current_display === 'page_1') {
    // Somehow set/override the css class here.
  }
}

How can I change the CSS class set in the advanced settings of the View?


texts: Remove the "Advanced search" form on the result page?

texts:
On Drupal 8, how can I remove the "Advanced search" form on the result page ?

I can hide it with css :

#edit-advanced,
#edit-help-link {
    display: none;
}

But I would prefer to do it with php or even better with a parameter in admin but I didn’t see any parameter related to Advanced search in

/ Administration / Configuration / Search and metadata


texts: Find out the user's IP address given their UID?

texts:
I'm running Drupal 7 web site with a Russian multiplayer card game and have to block some very annoying players every 4-5 days.

Before Drupal I was using phpBB 3. When these persons would come from a small city/village I'd just add their IP-network to the firewall rules, so that they can't re-register with a new mail address. This worked well in my case and my question is not about this policy.

My problem is that with Drupal, I can't find the last IP address used by a user id. I.e. the abuser is reported to me by other users and I know his uid, but I can't find his IP address in the logs, because:

I've enabled syslog-logging and see the Drupal messages in /var/log/messagess but there is rarely a message about a user logging in, probably because sessions are long by default, and I'd like to keep it this way for user comfort.
I've also enabled "database logging," but don't know where to see it (which database table).


texts: custom module to display content (nodes and fields) from another database

texts:
we are trying to somehow show fields from nodes existing in a different drupal database than the default.
Eg. in the site the module is installed (drupal2) we have the following settings.php

$databases = array (
  'drupal1db' =>
  array (
    'default' =>
    array (
      'database' => 'drupal1db',
....
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'drupal2db',
...

is there a way to override views so that it displays content with specific type "eg news" from the drupal1db and/or from both the databases?

Thank you


texts: Why does advancing/retreating the month remove all events from the calendar in FullCalendar?

texts:
http://bit.ly/1jrzpIx

Visit the link noted above.  See the calendar.  See the calendar events.
Now advance to the next month using the arrow buttons near the top left.
Now go back to the current month.  Observe that the calendar events have disappeared. This is not expected behaviour.
Now change the view so that you are in week or day mode.
Now return to the month mode and observe that the events have re-appeared on the current month.

Objective: Fix this calendar so that it retains its current functionality but does not lose the events when the months are paged through.

More information: This is Drupal v. 7.26.  (latest)

And you can find the Drupal FullCalendar module here: https://drupal.org/project/fullcalendar

And here is a bug report that I think deals with this issue, at least they seem to be related. My post is near the bottom of this thread. I've turned off AJAX so I don't think that's the problem.

https://drupal.org/node/1864992

Here is an answer on StackOverflow on (maybe) how to fix it. I don't know how to run the eventsRender method after fullCalendar instantiates in Drupal.

https://stackoverflow.com/questions/2665469/fullcalendar-cannot-display-the-new-event-when-switch-month-back

Here is another one (maybe):
https://stackoverflow.com/questions/20195156/when-switching-months-i-want-to-stop-fullcalendar-from-removing-events


texts: Internationalization and pay.nl does not seem to work properly together, any idea how to fix that one?

texts:
I am working on a website with four languages.

We use Ubercart with external payment facilities. We have Paypal and the following specific to Netherlands: eBanking, iDEAL, MisterCash. That works fine.

Now we are trying to get pay.nl to work. This one offers more methods of payments.

The request uses /nl/ as expected with a path that looks like this:

http://www.example.com/nl/order/paynl/notify/?...snip...

But the i18n module seems to change that to /en/ instead:

http://www.example.com/en/order/paynl/notify/?...snip...

And that prevents the payment from being accepted.

Any idea what could be happening? Would there be a way to prevent translations from happening when hitting /order?


texts: How to add another form by using #ahah field?

texts:
I have created one drupal form as following :

function add_action_item_and_alert_createalert_form($form_state){

     $alertahah = 'alertwithahah';

     $form = array();
$form['manual_alert_fieldset'] = array(
        '#title' => 'New alert for reservation',
        '#id' => 'manual_alert_fieldset',
        '#type' => 'fieldset',
        '#collapsible' => TRUE
     );

    $form['booking_id'] = array(
        '#id' => 'booking_id',
        '#type' => 'hidden',
        '#value' => $_GET['bid'],
     );

    $form['manual_alert_fieldset']['manual_alert_note'] = array(
        '#id' => 'manual_alert_note',
        '#title' => t('Enter Alert Note'),
        '#type' => 'textarea',
     );

    $form['manual_alert_fieldset']['submitalert'] = array(
        '#type' => 'submit',
                '#ahah' => array(
                'path' => FSACLIENTSERVICE_ACTIONITEMS_ADD_ALERT,
                'wrapper' => $alertahah,
                'method' => 'append'
            ),

        '#value' => t('Create New Alert'),
    );

   $form['#redirect'] = FALSE;

    return $form;
}

On callback function of the above form, I want to render another form using

    $html_form = drupal_get_form('fsaclientservice_alert_comment_form',$alert_id);
 print drupal_json(array('status' => TRUE, 'data' => $html));
  exit();

The above code is working fine and rendering another form without refreshing the page.

The only problem is that the Form which I am rendering ('fsaclientservice_alert_comment_form' ) is having #ahah field and it should add html to a page on submit button of the form without refresh.

Currently the action of a comment_form which is rendered using ajax is wrong and it  not going to the callback function that form and page get refreshed on submit button of comment_form(generated by ajax).

I have tried to change the action like below :

$html .= str_replace("/admin/fsacs/fsaclientservice/action-items-and-alerts/createalert", '/fsaclientservice/viewreservation?bid=63822', $html_form);

But still the page is get refreshed.

Can I render a form with #ahah in a callback of one form ?


texts: Release notes for Drush 10 claim that most of the Drush 9 commands will still run on Drush 10. So I wonder what is the alternative for drush_backend_invoke_concurrent() from backend.inc?


texts: Determine front page for specific language

texts:
I'm using I18n and I am trying to choose which front page to use for each language.

I actually get the following message for every page :

  The requested page "/en" could not be found.

Same for /de (deutch).
Has anyone met this problem before ?


texts:
My forms dont seem to have  tags wrapping them in my templates.
What am I doing wrong here?

I have a template whith some calls to theme() inside it.
Two of these are forms with their own template.
This template is called from a block_view().

my modules block function:

$form = drupal_get_form('stappenoverzicht_appointment_form');
  $reset = drupal_get_form('stappenoverzicht_reset_form');

  $block['content'] = theme('overzicht', array('status' => $status, 'links' =>$links, 'form' => $form, 'reset' => $reset));

my modules theme function:

$return['overzicht'] = array(
'variables' => array('status' => array(), 'links' => array(), 'form' => null,
 'reset'      => null),
'template' => 'templates/dashboard--stappen-overzicht',
    'render element' => 'form',

);

$return['appointment'] = array(
        'arguments' => array('form' => NULL),
        'render element' => 'form',
        'template' => 'templates/form--appointment',
    );
$return['reset'] = array(
    'arguments' => array('form' => null),
    'render element' => 'form',
    'template' => 'templates/form--reset',
);
return $return;

base tpl:

   <?php print theme('appointment', array('form' => $form));?>

   <?php print theme('reset', array('form' => $reset));?>

form--reset:

       <?php print drupal_render($form['submit']);?>

  <?php print drupal_render($form['description']);?>
<?php
print drupal_render_children($form);
?>

I came across this Render form in template answere here, but I want to manipulate the wrapping html as shown in the reset template.


texts: Can you set the directory from which the Media module populates its Library tab?

texts:
I would like to know if it is possible to set the directory from which the Media module populates its Library tab in the Media Browser.

For instance, when the newest version of the Media module is installed, the directory its Library tab is populated from seems to be /sites/default/files/field/image/. If another directory is already created on a server which contains a set of images I would like to choose from, is it possible to modify the Media module to look in that directory?

I've spent a fair amount of time digging through the module code and haven't found where the directory default is being set. Has anyone ever attempted this?


texts:
I installed Drupal 8.1.2, but I can't install modules of the category "core (experimental)". No problem with other modules or themes for example. I get no logs and no error message. Hitting the install button just redirects me to the extend page.

I have been able to install Migrate by installing Migrate Plus, which requires Migrate, but this does not solve the issue, in particular not for the other modules in "core (experimental)". Is there anything I have to do to be able to install experimental modules?


texts: How to embed plugin configuration form elements into another form?

texts:
I have a form that lists entities and each of the entities has a checkbox.
The form also contains a list of actions(Action plugin) that can be performed on selected entities as a select list.

I would like to be able to configure actions that extend the \Drupal\Core\Action\ConfigurableActionBase class, which means they are configurable, right in my form since some actions can have very different settings and creating action entity for each variation of those setting is just impossible. I would create a new action entity from those settings, without saving it, and use it to perform the action(although I could do it just with the plugin, but that's not important right now).

I am able to retrieve the form elements for those configurable actions and display them in my form. The issue I have is that incorporating those elements into form is tricky on its own, but validating and submitting them is on another level since I cannot just encapsulate those form elements under some specific form array/key because the validation and submit handler for those plugins will not work with that.

The \Drupal\Core\Plugin\PluginFormInterface::buildConfigurationForm() is not a proper D8 form but it just holds the form elements so it's not like I am trying to embed a form within another form, but it is stillquite impossible as I am seeing it right now.

So how can I do this? Or can you recommend a different approach?

This is the initial design: http://pastebin.com/b8SCFvUQ


texts: Domain Access and Domain Admin giving access to all subdomains

texts:
I've set up a multisite drupal 7 install with domain access and each subsite has an assigned admin who is only supposed to see content and edit own domain. I want to allow each domain admin to also change theme of the subdomain by going to Structure->Domain->Click on edit domain of own domain -> Theme tab

I am able to do this, however, the subdomain admin is able to see all subdomains under Structure->Domains, I only want to allow him to view only the assigned subdomain.

i've been playing around with permissions but can't seem to get this working. Any help would be appreciated.

Thanks...


texts:
I'm using Drupal 7.

I would want to add a page to my nodes, with the comment form (only), and a link in the tab menu to reach it :

I tried with views but I did not arrive there.

Do you know the simplest way to reach there?


texts: Trying to embed a video in a Views Header

texts:
I am trying to embed a video in the header of Drupal 7 View. I have the header text format set to full HTML. The full HTML text format is set to: (X = checked)

_ Limit allowed HTML tags
_ Display any HTML as plain text
X Convert line breaks into HTML (i.e.
 and
)
X Convert URLs into links

The code below is what we used to embed the video in our Drupal 6 site but it was in an article not a views header. No video is showing up in the header and view source shows that the code is getting stripped out.

<embed id="mainFlash" width="550" height="440" quality="high" name="mainFlash" src="http://www.oursite.com/main-video-en.swf" type="application/x-shockwave-flash">

Is it possible to embed the video? Do I need to use the <object> tag instead?


texts:
I'm currently trying to setup a picture gallery with Drupal 7. The Gallery module is set up and works, but it needs pictures added to an image field.
Since I have thousands of pictures to add, I don't want to add them one by one. The best solution for me would be uploading them via FTP and then adding the whole folder into the image field.
I found a script (http://drupal.org/node/1266646) which would do this for me, but it's for Drupal 6 and it doesn't work anymore.
I also tried IMCE with FileField Sources, but I can't add files I uploaded via FTP.


texts: How do I move a site from a server to another one?

texts:
I am trying to move a Drupal 8 site, but I get the following error:

The website encountered an unexpected error. Please try again later.
InvalidArgumentException: Class "\Drupal\system\Controller\Http4xxController" does not exist. in Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (line 29 of core/lib/Drupal/Core/DependencyInjection/ClassResolver.php).

How do I properly move a Drupal 8 site from a server to another one?
What I did was importing the database, moving the files, and changing the database connection settings.


texts: Command "generate:module" is not a valid command name

texts:
I have this problem when I run command drupal generate:module. I don't know why, despite everything I did was suggested on the documentation for Drupal Console.
I don't see all the possible commands, when I run drupal list.
Available commands:
  about                      Displays basic information about Drupal Console project
  chain                      Chain command execution
  check                      System requirement checker
  exec                       Execute an external command.
  help                       Displays help for a command
  init                       Copy configuration files.
  list                       Lists all available commands
 debug
  debug:chain (dch)          List available chain files.
  debug:settings (dse)       List user Drupal Console settings.
  debug:site (dsi)           List all known local and remote sites.
 develop
  develop:contribute         Download Drupal + Drupal Console to contribute.
 generate
  generate:site:alias (gsa)  Generates a site alias.
 quick
  quick:start                Download, install and serve a new Drupal project
 settings
  settings:set               Change a specific setting value in DrupalConsole config file
 site
  site:new                   Download a new Drupal project


texts: How do I get rid of  tag in manually created block?

texts:
I'm trying to remove a <p> tag from a manually created block. This block only contains an image and nothing else. I have kpr() function outputting block variables but am not seeing where, or how the unnecessary <p> tag is being generated.

Would the modification occur in theme_preprocess_block function? It seems it's not possible to get rid of within the block template file.

Another thing is that my tried was getting turning on themes info, clicking the element in hopes of finding some override function, but themer_info only shows me block info instead of some function info.

Any help would be greatly appreciated, thank you.


texts: Where to modify feed status to change number of created and updated nodes

texts:
i want to change the message after a feed is completed that shows the number updated and created.  What file in the feeds module is the one that outputs this message? using Feeds 7.x-2.0-alpha9

the progress is in  feeds.pages.inc
but I still cannot find where  the number created and updated is


texts: How to wrap / manipulate element outputs on a form's checkboxes html?

texts:
I have the following form that contains a big list of checkboxes. The first checkbox is the parent of the children below it. In my case it is called "Africa" and the ones below it are "Africa-child" checkboxes. I was able to manipulate the classes, but I can't seem to find a way to add a wrapper div around the "Africa-child" elements. I mean I can do it via javascript, but I was wondering if there was a Drupal hook to add in extra html to the select options html before it gets outputted.

The code below is it form data used to build the form. The prefix and suffix is wrapping ALL of the checkboxes, but I only want to wrap certain ones.

function hotsite_filters() {

  $form['offices'] = array(
    '#type'       =>  'checkboxes',
    '#title'      =>  '',
    '#options'      =>  get_office_options(true, '', 'local_alias ASC', false, true, true, false, true),
    '#default_value'  =>  filter_get_keys('browse-offices'),
    '#prefix'     =>  '

' . variable_get_value('hotsite_filter_offices_header') . '
',
    '#suffix'     =>  '
',
    '#size'       =>  11,
    '#multiple'     =>  true,
    '#required'     =>  false,
  );


texts: How to show contact profile and membership details in one Civicrm report?

texts:
I had a new profile called "Registration details" for contacts, and the profile fields can be edited in account page.

In my contribution page, membership form is enabled as a sign up form for my members, and the new profile  "Registration details" is included in the form.

I would like to have a report to show a summary of contact details, including  "Registration details" profile, and filter by membership status.

If I'm using Constituent Summary Report, I can get all the contact details summary, but I can't filter the report to show those with active membership only.

If I'm using Membership Details Report, I can filter the membership status accurately, but can't show the new profile fields of "Registration details".

Is there anyway I can configure it so that I can show both contact details and filter by membership status? Or should I make any changes to the profile?

PS: I'm using drupal 7, with CiviCRM 4.4.6.


texts:
I installed Drush  with composer global require drush/drush:dev-master but it has some problems. I am using Xampp and Windows 8.

How can I downgrade Drush from 8-dev to 7?


texts: How can I look up the number of items in a Drupal View?

texts:
I have several views on my Drupal site. I also have a page that links to those views. I would like to see the number of items (e.g. the number of pages) that are listed in each view:

link to foobar view [5 items]
link to other view [0 items]

Is there an easy way to do this. I suppose I will need embedded PHP for this, but I would like to avoid huge SQL statements embedded in my linking page.


texts: how to use panel to display content types but using condition?

texts:
I have two content types.

Liquor product which have fields [Title, origin, effects, side effects, price, how to drink, etc.. ]
Liquor store fields are [store name, address, contact no.]
I am used panel to display Liquor content.I want to display all content of liqour if they have in store.
For e.g If I am click on absolute vodka then panel display absolute vodka info comes(i.e Title, origin, effects, side effects...) but now i want add condition show all stores which have absolute vodka

How to do this?