texts:
When click on any term, content related to that term should be displayed on the right hand side of a page. I have my taxonomy tree on left sidebar using Drupal API function.

What I had done is:

Created view with content type, containing all products related to
taxonomy terms.
Add a field in that content type with field type "term reference"
and widget type "simple hierarchical select" module.

Now what should I do in order to filter the term based content? Any Ideas?


texts: Is there a way and/or reason to unload a node after node_load?

texts:
I have a custom module that loads one specific node to get its field value, and then uses that field to make a bunch of calculations. I've seen several comments  like this one that node_load is a resource hog...

My question is if there is a significant benefit to unsetting the node object once I've retrieved my field value, and if yes what is the best way to unset it? I've googled for some time but only can find references to deleting nodes, not unsetting the object. Thanks!


texts: How do I provide one-time access to a downloads page to anonymous users?

texts:
Our company wants to have a secured downloads area for software.  We want to send a link to a customer via email, after they have purchased a license for the software.  We don't want to create a site account for every customer; we just want them to click the link to get one-time access to the downloads page.  All the modules I have seen for one-time use links either assume that the link is something used for password reset, etc., or the module is not ready for prime-time.

Any ideas?

Thanks!


texts:
I've noticed in views when displaying colorbox content images (post per gallery)the css never translates from the css displayed of that type in page or node.

In the page the colorbox thumbnail images have a white border but displayed inline within the view there is no border.

I've inspected the element as a field item but I can't work out how to

add the white border around thumbnails in the view?


texts: Removing main content block on frontpage

texts:
I'm new to Drupal 7 and I'm looking to replace the frontpage's default main content block with an equivalent block generated from Views (gaining more control over the block in doing so).

I have successfully generated the new frontpage block in Views and added it to the content section however now the homepage displays both the original and the new views block.

Attempting to remove the main content block by configuring it to not display on <front> does not work and for now the only workaround I have found is the following CSS:

.front #block-system-main {
  display:none;
}

I'd prefer a less hack-like solution. Can anyone suggest one?


texts: I am attempting to make a contact form in Drupal 8 using "Contact forms" included in core.  I'm struggling to figure out how to really customize it, like adding radio buttons or check boxes - does this have to be done through the theme_name.theme file?  If so, can someone give me an example of adding elements to the page? I'm new to Drupal so thanks for helping out.


texts: Pass a multi value argument to a panel view

texts:
Is there a way to pass a multi value argument from panels to a panel view?

I have a node with an entity relation field on it and load this node as context in page manager.

I have also a view which accepts a multi value argument (contextual filter). Not multiple arguments I mean an argument where you have multiple nids normally separated by comma if you would enter them in the url.

I want to pass the nids from the entity relation field on the node loaded as context to the view I load in a panel on the same page.

Maybe it is more understandable by describing it step by step.

I created a page manager page with a path /admin/something/!nid
The node identified by !nid is loaded as a context so I have all the
field values on the node.
The node has a field that stores a small amount of other nodes as references.
I want to pass the nids of the referenced nodes to a panel view as argument number one.
I have done this with one nid but have no idea how to do it with multiple ones.

Any ideas? Thanks!


texts: Upgrading complex content types from D6 to D7

texts:
I have a Drupal V6 website with some complex content types that I have created using CCK and Contemplate. That is, the content types have fields of type Text, Integer, Link, Node Reference and so on. I've been unable to upgrade this website to Drupal V7.

I have a few Drupal websites without complex content types and I've been able to upgrade those so I think I understand the general upgrade concepts and procedures. However I'm having trouble with this particular site. The process seems to complete normally, but nodes with complex content types have not migrated and only their basic fields can be displayed and edited. Checking the DB, the raw data appears to be there.

I've read the standard upgrade procedure and the CCK upgrade procedure but with no luck. Has anyone done this themselves and can you outline the steps you took.


texts: Enter presence and assign marks for multiple students at once

texts:
I'm building a teacher register web application with Drupal 7 for our school. I have a Chair entity, which references the Class entity and the Teacher role. The Chair entity references also a taxonomy vocabulary to select the available Mark types for that subject (written, oral, practical and graphical, or any combination). I've also created the Lecture entity, which references the Chair entity and allows the Teacher to note the day, the time and the argument of a particular lesson.

Now the hard part: I would like to have a list of students, possibly in the same page of the Lecture entity, where I could note who was absent and the marks the student(s) got during that lesson. The presence will probably be just a numerical field, the Mark is an entity type with a reference to the available Mark types for that Chair and the mark value.

I already looked for a lot of modules to create multiple nodes, but I didn't found anything that would fit my use case. I'm interested in having a table, in each row a student of that class and next to the student the fields of the Mark entity. If the fields will be populated, the new Mark entities for that students will be created, if the fields will remain empty the Mark entities won't be created. Same thing for the absence.

If this isn't possible I'll fall back to something simpler, but this setup would allow teachers to fill marks and absences more quickly (and spare me some rants :) )

Thank you!


texts:
I am trying to hide some views (and their menu links) from anonymous users and some other roles i have created, how this can be done ??
Thanks.


texts: How to skip (not ignore) some rows in migration?

texts:
I want to skip some rows in my migration, so that rows will imported on the 2nd attempt. for this am returning false in the prepare row function.

public function prepareRow($row) {
if($parent) {
      return TRUE;
    }
    else {
      return FALSE;
    }
}

but this ignore that rows and then I am unable to import the data again.
Is there any option to skip some rows so that I can import them on 2nd attempt?


texts: Differences between Location and Location CCK?

texts:
Location has three modules: Location, Node Locations and Locations CCK

What are the primary differences between them? Are there any advantages to using Node Locations over the Locations CCK?

Thanks!


texts: How do I define a template file for a specific node paragraph ID?

texts: I would like the ability to override a template for only 1 paragraph.  Is it possible to override just one paragraph like we can with nodes node-{nodeid}.html.twig?


texts:
Which Drupal module support spatial filtering with apache solr module.
like either Location,geofield,geolocation,getlocation or any other.


texts: I disabled a module and my website turns into code

texts:
I am working on an old Drupal website. I disabled the Electric Embers subscribe module - to get rid of a newsletter subscription option to a dead list.    Previously my website was in off-line mode, but otherwise worked.    Now the website looks like pure text or code.

www.rachel.org

I checked the database and the ee-subscribe module is still enabled.

Unfortunately I didn't make a backup before turning off this module.  However, I've never seen turning off a module cause so much havoc.

I currently cannot use my admin log in or do anything directly through drupal.

Update
When does Drupal 5 change the filename field in the system table? The problem occurs when it sets the "filename" field to "modulename.info" (or .install or .js) for 10-20 modules.  I can manually set it to "modulename.module" but the fix only lasts an hour or so.

I don't think that cron is running as there are no cron jobs scheduled and I do not use poormanscron.  However I don't know how to test this.


texts: Shipping county value showing as a number

texts:
Using Drupal 7 with Drupal commerce.

During the checkout in the shipping section I can choose a county from a drop-down list (a string value).
However, on the review order phase it is represented as a number (please see attached image). Moreover, it is printed as a number on the order pdf.

Any ideas on why is it so?


texts: Getting info from an external database - Base table or view not found

texts:
Currently working on getting some info from an external application's database onto my user profile page as a test.

I've run into a snag that I can't seem to get past. This is probably something so simple, but I'm pulling my hair out over it.

I have 2 databases - one is Drupal, and the other is from SocialEngine. These are both hosted on the same server(not localhost).

My error is this: Base table or view not found: 1146 Table 'uitv.engine4_users' doesn't exist: SELECT email FROM {engine4_users} WHERE enabled = :enabled; Array ( [:enabled] => 1 )

Awesome. Okay, well I think I can see the issue here... engine4_users is actually in the uitv_social database, while my Drupal installation is in the 'uitv' database. I've used db_set_active($social); which relates to my database settings in settings.php - and I've set it back to the default database after I query the social one.

What am I missing here? (Drupal 7 database documentation seems to be blank on this subject)

[EDIT: I did something silly - use db_set_active('yourdbkey'); - and make sure your query is right. Hope this helps a Googler. Curiously, I had done this several times before, but since the query was incorrect it wasn't giving me anything, obviously.]


texts: common.inc error in newly downloaded Drupal 7.69

texts:
I just downloaded drupal 7.69 and tried to configure it.  It gives me a page full of the same error:

  Notice: Trying to access array offset on value of type int in element_children() (line 6656 of /Applications/MAMP/htdocs/KSnew/includes/common.inc).

Here's the relevant part of the code in common.inc, with line numbers:

6648 function element_children(&$elements, $sort = FALSE) {
6649   // Do not attempt to sort elements which have already been sorted.
6650   $sort = isset($elements['#sorted']) ? !$elements['#sorted'] : $sort;
6651
6652   // Filter out properties from the element, leaving only children.
6653   $children = array();
6654   $sortable = FALSE;
6655   foreach ($elements as $key => $value) {
6656     if ($key === '' || $key[0] !== '#') {
6657       $children[$key] = $value;
6658       if (is_array($value) && isset($value['#weight'])) {
6659         $sortable = TRUE;
6660       }
6661     }
6662   }

Is this a Drupal error??


texts: finding unexpected looping in cron queue process

texts:
I'm trying to find unexpected looping result from my codes, I'm stuck and confused cuz of this :( , I hope someone might give me suggestion to solve it. here's my codes:

function budhapest_cronsync() {
    $jconfig = variable_get('budhapest_params');
    $jurl = $jconfig['budhapest_url'];
    $rids = budhapest_rental(); // get about 200 data in array (array('01' => '201'),..., array('200' => '401')) e.g
    $jsyncobject = new LiveBudhapest($jurl);
    $jstate = $jsyncobject->Sync();

    if ($jstate) {
        $jstatus = 1;
        syslog(LOG_DEBUG, "Getting budhapest data ok");
        $jdata = $jsyncobject->getSyncData(); // get about 300 data in array (array('01' => array('alphabet' => array('a','b','c'))),...,(array('300' => array('alphabet' => array('a','b','c'))) e.g

        foreach ($jdata as $key => $value) {
            if (array_key_exists($key, $rids)) {
                $jitem = array(
                    'nid' => $rids[$key],
                    'format' => 'budhapest',
                    'url' => 'http://budhapest.com?prop_id=' . $key
                );

                if (!empty($value['alphabet'])) {
                    enterBudhapest($rids[$key], $value['alphabet']);
                    $jmessages = array(array('messages' => 'Budhapest oke successfully'));
                } else {
                    $jmessages = array(array('messages' => 'No Budhapest available'));
                }

                BudhapestStatus($jitem, $jmessages, $jstatus); //this is log and saved to table
            }
        }
    } else {
        $jstatus = 0;
        syslog(LOG_DEBUG, "Getting budhapest data not ok");
    }
}

function budhapest_cron() {
    $items = array();
    // Put everything in a queue for processing.
    $queue = DrupalQueue::get('a');
    $queue1 = DrupalQueue::get('b');
    $queue3 = DrupalQueue::get('Sync Budhapest');
    $queue->createItem($items);
    $queue1->createItem($items);
    $queue3->createItem($items);
}

function budhapest_cron_queue_info() {
    $queues['a'] = array(
        'worker callback' => 'a', // This is the callback function for each queue item.
        'time' => 600, // This is the max run time per cron run in seconds.
    );
    $queues['b'] = array(
        'worker callback' => 'get_rm_month_id', // This is the callback function for each queue item.
        'time' => 180, // This is the max run time per cron run in seconds.
    );
    $queues['Sync Budhapest'] = array(
        'worker callback' => 'budhapest_cronsync', // This is the callback function for each queue item.
        'time' => 600, // This is the max run time per cron run in seconds.
    );
    return $queues;
}

question: from my codes above, I expected about 200 logs or less saved to table from this function (BudhapestStatus($jitem, $jmessages, $jstatus)) , but in fact i got thousands of log write to table for once process. why? how could it be?, please help me..

thanks I hope someone will give me suggestion about it.

may be can be clue:
I just saw cron log, end it's written there at message colum "Proccessed 18 times" . so now it's possible, total log is about 3500, 3500/18 = about 196.

why it's processed 18 times and not once?


texts:
I do a lot of Django development and I like their templating language.
Twig, the new templating engine in Drupal 8, looks very much like it.

How can I use Twig in Drupal 7 or even Drupal 6?


texts: Git cloning a project asks for git@git.drupal.org password

texts:
I'm trying to switch to SSH keys as the password authentication is now deprecated and I am having an issue. I've created a new key pair and entered the public key in my account and setup my Git Bash to use the private key.

When I try to clone one of my projects, I get a password prompt asking for "git@git.drupal.org' password.

However, when I run  ssh git@git.drupal.org -v, it asks for my private key password and the output log says that I was authenticated.

  debug1: Authentication succeeded (publickey).
  Authenticated to git.drupal.org ([140.211.10.43]:22).

Why does the above appear to authenticate but running something like the following does not?

git clone --branch 8.x-1.x git@git.drupal.org:project/MY_PROJECT.git

EDIT: I'm using Git Bash on Windows.


texts: How to create a view which lists all OG groups and count of og memebers

texts:
I have created a Group called School, When user registers to site he will join to a School Group.

After registering to a school i need to show All Groups and Count of Group members joined in a Group.

So instead of writing a Query, can we create a View to get this list ??


texts:
I am working on a system that will be used at least partially by students some of which will likely be grade schoolers.  The old system that we are replacing with a Drupal site would allow mass creation of user accounts all with the same email address.  They did this so that the teacher could just use her email for all of the students and if they needed a password reset the info would just get sent to the teacher.  Also, many very young students do not have their own email accounts.

I need import these accounts into my Drupal site but I am going to have trouble because Drupal 7 does not allow different accounts with the same email.  After a quick Google search I did not find much that was to promising, I found a dirty hack for Drupal 5 but nothing that seemed like it might work with Drupal 7.  Is there any way around this?


texts:
I have a content type that has multiple file fields depending to allow the content editor to upload different file types. Only one of the file fields is ever used per content type.

I have a view built that has a relationship to "File Usage: File" to display "File: Size" in the view.

After I modify the file on a node, I start to see duplicates of the node in the view, where the filesize is different but everything else is same. Leading me to believe the File Usage relationship is causing it to be different.

I followed this to no avail, I think the issue is because I have multiple file fields - Duplicated results using fields from relation File Usage: file

Does anyone have any other potential solutions?

Edit:
File Usage is definitely the cause here and the fact that I'm utilizing the Size field from File Usage. After a new upload, File Usage creates an additional relationship in the file_usage table between the new file and the node, but also retains the old relationship.

So it all makes sense why there's a duplicate because there is a second unique relationship. Leading me to believe the only way around this is to re-structure that view.

Temporarily we've removed the Size field and the File Usage relationship.


texts: How do i deactivate "Your comment has been posted." after user posted a comment

texts:
How do I deactivate -Your comment has been posted- after user posted a comment.

Is it possible to deactivate the message above with out touching the core?


texts: Want to delete some custom user data while delete any user in Drupal8

texts:
Is there any Hook available for user delete in Drupal8.
I have some custom data in a custom table and I want to delete those data while I delete any user in Drupal8. Can anybody help me out of this?


texts: View showing both main entity and related entities

texts:
I need a view that shows (certain fields of) both the main entity (pointed to by the url) and all of the entities that have a certain relationship with it.
For example:
my entities IDs are 1,2,11 and 21.
Entities 11 and 21 have the relationship "member of" with 1.

I want the URL mysite.com/entity/1 to show this list

entity 1  //(the entity from the url)
entity 11 //(related to entity 1 via "member of")
entity 21 //(related to entity 1 via "member of")

whereas mysite.com/entity/2 should show only entity id 2.

contextual filters should be the answers, I tried using the OR tweak
https://www.drupal.org/node/1451218#comment-6136692
and
https://www.drupal.org/project/views_contextual_filters_or

but when both the contextual filters (the one without relationship, and the one via the 'member of' relationship) are present, only one of them is being set to the query (the 1st one) or hook_views_query_alter is not being called at all.


texts: What is the equivalent of calling drupal_lookup_path()?

texts:
drupal_lookup_path() have been remove in Drupal 8. However, I cannot find a way to achieve the same functionality. All, I'm trying to do is to provide Drupal with a path and he is going to look to see if exist, if exist is going to provide me the node id. If does not exist that path he going to give me an error or null/0.

How can I achieve this on Drupal 8?


texts:
The database contains a mcms_field_data_field_cage_id_vbc table, which has more than 6000 records. I am using the following code to get the content of that table.

function hello_db() {
  $query = db_select('mcms_field_data_field_cage_id_vbc', 'tb');
  $query->fields('tb', array('field_cage_id_vbc_target_id'));
  $result = $query->execute()->fetchAssoc();
  foreach($result as $record) {
    drupal_set_message($record);
  }
}

The code doesn't show all the records in that table, but a single value.

Why doesn't the code work as expected?


texts: Is there a git repository for Drupal releases only?

texts:
Having cloned drupal from the git repository using

git clone --branch 7.x http://git.drupal.org/project/drupal.git

I noticed that I'm actually running 7.9-dev when what I want to be running is the most recent stable. Is there a git repository or branch that I can pull from to run the most recent stable release? I've seen references to git.drupal.org/project-stable/drupal.git around the net, but that doesn't seem to be a valid repository anymore.


texts:
I added images to my blog in Drupal 7 and they loaded fine. But one of the images shows up at the bottom of every page of the site. How to I delete it?

Appreciate any help!


texts: Manage photo default settings in Node gallery module

texts:
I am using Node Gallery module to work with albums and photos uploaded by user. When a user views his album there is a tab called Manage Photos which displays table with headings Delete, Preview, Edit and Cover.

I want to  change the text of 'Cover' as 'Album Cover' and display 'Delete' column at the end.

How to do this??


texts: Print a text if a view result is equal to a certain value

texts:
In a template file, how can I use PHP to print some text if a view has a certain value?

The view uses the node ID, so I guess this argument needs to be passed to the view (as it would be if the view was embedded onto the page).

Here is my attempt:

<?php
  $view = views_get_view('hide_weight_2');
  if ($view->execute_display('default', $args) == 'Yes' ):
?>

Result of view was yes

<?php endif; ?>


texts: Exposed filter in view should display all available values in select box

texts:
I added an exposed filter to my view where users can enter the desired value to filter the results accordingly. But I want to make it easier for them by changing this filter to a select box style dropdown where they can select a value out of all available values.
To make this more clear; I'm talking about a year, so each article has a field "year" and because there are many articles published in many years, I want to group all available years from all articles and show them to the user in this select box.
But I can only make this possible by adding the years in the grouped filters manually, that means each year I have to add a new option to the filter manually. And if there are articles added later which originally were published earlier than years available in the options, I probably will never cover all years in this set of static options.
So is there a way to get all years of all articles and showing them in a select box?


texts: Delete records from database pressing a button in twig

texts:
Drupal version: 8.7.x

I created a module that retrieves meals based on the given ingredients. I display the ingredients with a delete button and the meals underneath them. However I don't know where to start when it comes to deleting the ingredients using the button in the template.

templates/block--recipe-search-block.html.twig:

    {% for ingredient in ingredientList %}

        {{ ingredient['ingredient'] }}
        <form id="delete-ingredient" action="" method="post">
          <button value="{{ ingredient['pid'] }}" type="submit">

          </button>
        </form>

    {% endfor %}

This is how I pass them: src/Plugin/Block/RecipeSearch.php:

class RecipeSearch extends BlockBase {

  public function build() {
    /*
     * RETRIEVE ALL GIVEN INGREDIENTS FROM THE DATABASE
     * WHERE THE ID EQUALS THE CURRENTLY LOGGED IN USER.
     */
    $current_user = \Drupal::currentUser();
    $current_user_id = $current_user->id();
    $uid = $current_user_id - 1;

    $connection = Database::getConnection();
    $ingredients = [];

    $result = $connection->select('ingredient_list', 'il');
    $result->fields('il', array('ingredient', 'pid'));
    $result->condition('uid', $uid);
    $data = $result->execute();
    $results = $data->fetchAll(\PDO::FETCH_OBJ);

    foreach ($results as $field) {
      array_push($ingredients, ["ingredient" => $field->ingredient, "pid" => $field->pid]);
    };

    return [
      '#theme' => 'recipe_search_block',
      '#ingredientList' => $ingredients,
    ];
  }
}

recipe_search.module:

function recipe_search_theme() {
  return [
    'recipe_search_block' => [
      'template' => 'block--recipe-search-block',
      'base hook' => 'block',
      'variables' => [
        'ingredientList' => NULL,
      ],
    ],
  ];
}

If someone could point me in the right direction, that would be much appreciated!


texts:
I actually would like to start a website in which users can register and each registered user will get a subdomain. Each subdomain will be a drupal installation. I can share the files between installations and keep different databases for each of them (or table prefixes). I checked Drupal multisite, but it is mostly for the administrator who is maintaining the website. I need this functionality for the users as it is there in drupal gardens. I also checked Aegir and seems like its also for admin only. Basically I need the kind of functionality that Wordpress multiste plugin has have. Anyone know any drupal module which will allow the creation of multiple sudomain based websites on the fly ?

BTW, I am new to Drupal so my assumptions may not correct. It will be helpful if someone can guide me in right direction.


texts: How can I list all Twig functions and filters with their description?

texts:
I want a list of all available Twig filters and functions and for each one of them I need to have a description of the function/filter so the user can see what functions and filters are available and how to use them in templates.

I know how to get the list of functions and filters(How to get all filters and functions available in Twig templates?) but I don't know how to get their descriptions.

I don't know how to find out in which file the filter/function resides so I can parse it for the description of the function.


texts:
I have a huge taxonomy vocabulary (over 5k terms) and I'm using a shared hosting account.

Whatever I try to delete the vocabulary from drupal I get the error

Fatal error: Maximum execution time of 30 seconds exceeded in /home/username/public_html/drupal_site/includes/database/database.inc on line 2179

Anyway after looking online I found that with shared hosting I can't change the max_execution_time .

My next bet is to delete it from the database level in phpmyadmin.

How would I go about doing that? Are there any other ways for me to accomplish what I'm trying?


texts: Can't translate the messages of the flag module

texts:
I'm using Drupal 7.20 with Commerce. I installed the following modules:
 - internationalization module
 - translation helper
 - flag module

I have customized the text for my flag links to be 'add to my favorites' and 'remove from favorites'. I want to translate them, but they don't appear in the translate interface.

Does anyone have a clue?


texts: Drupal Commerce does not allow any payment if payment pane is not in review order page

texts:
If I do not put the Payment pane in the Review Order page, then no payment method works and it just goes to checkout complete. Even if I check Require a payment method at all times it makes no difference.

Is this a bug or is it something I'm missing?

The attached image works but not when payment is in payment when it is it skips payment entirely.


texts: how to get the original entity on hook_entity_presave?

texts:
i actually need it for the content_moderation_state entity

 function hook_entity_presave(Drupal\Core\Entity\EntityInterface $entity) {
if ($entity->getEntityTypeId() !== 'content_moderation_state' ) {
    return;
}
$moderation_state = $entity->get('moderation_state')->getString();

 //code to get the original entity moderation state


texts: How to concatenate all token values of a list in a single field within a Rules loop?

texts:
I am attempting to send a list of uploaded files on a newly created node via email.

In a content type, I have a File Field that allows unlimited values.

Within Rules, I created a loop calling the current item "current_file".

I am trying to concatenate all of the values into one longtext field called "file_list".

I intend to use the token for the value of "file_list" in the body of an email.

Unfortunately, I am unable to do so.

While in Data Selection mode, I can access the tokens created by the loop:

However, while in Direct Input mode, the tokens are not available to me. They are not listed in the "Replacement patterns" section.

When I attempt to fill the value with the following, I have no success:

[node:field-file-list]
[current-file:file:url]

What can be done to make the tokens available to me in Direct Input mode?

If I am doing this incorrectly, is there a different way for me to concatenate all of the URLs of each file so that I can put it in the body of an email action?


texts: Allow only the users with the access code to browse the website

texts:
I am building my site on Drupal 7.

I want to restrict the usage of my website only to certain people who I have sent the access code to. I don't want to put my website into maintenance mode because I want those users to fully use my site (including registration form etc.).

So how can I build a page with a simple form where users will enter the access code and then get allowed to enter the website? And also whenever somebody types in another URL in the website without actually entering the access code first, they must be redirected to the security page to enter the code; then they will be allowed to proceed to that URL they wanted to go to.

I would prefer to be able to remember their sessions and if the user has a session on the website (such that they have entered the code before) they shouldn't be sent to the security page the second time (until their session time ends maybe?).

How can I achieve this?


texts: Can't get form_state['values'] from a form on a custom checkout pane

texts:
I created a custom checkout pane with Drupal Commerce so if a user checkouts as anonymous they can create an account on the checkout completion page.  The problem is that when in my form's submit function the form_state values are not passed and I get an undefined index error.
Here is the code for the checkout form:

function commerce_checkout_complete_registration_pane_checkout_form($form, &$form_state, $checkout_pane, $order) {

      $form['new_email'] = array(
        '#type' => 'textfield',
        '#title' => t('Email'),
        '#element_validate' => array('_validate_the_email'),
      );

      $form['pass'] = array(
        '#type' => 'password_confirm',
      );

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

      global $user;
      if($user->uid == 0){
        return $form;
      }

    }

And here is the submit function:

function commerce_checkout_complete_registration_pane_checkout_form_submit($form, &$form_state, $checkout_pane, $order) {
  dpm($form_state);
  $email_address = $form_state['values']['new_email'];
  syslog(1, $email_address . 'TEST');
}


texts: Is there a way to trigger an image crop dynamically?

texts:
I have a Flag setup for an image content type which allows users to Flag an image that they want to be their avatar/user picture. I also have a View which displays this flagged image.

When a user clicks this Flag I would like to be able to trigger a crop (where the user is able to select the cropping area manually) so that a copy of the image can be made and referenced in a separate avatar gallery, without effecting the original image which will stay in it's gallery uncropped. There are several cropping solutions for Drupal 7 however is there a way that cropping can be triggered dynamically as in my example, perhaps via Rules or another way?


texts: Is it possible to custom Event Date format?

texts:
On the Drupal 7 Upcoming Event, I would like to show the Event Date with abbreviated "Day, Month date, Year - Time". However, There an option that I like, which is "Fri, Mar 28, 2014 @ 4:55pm", but it contained with the "@" symbol. Is there a way to custom this being "Fri, Mar 28, 2014 - 4:55pm"?

PS: I know there is a way to add new date type, by going to "Administration/Configuration/Regional and Language". But none of them work like the way I wanted.


texts: Render User field in Display Suite custom fields

texts:
I am trying to use display suite custom field to show a user avatar field (custom field).  In my DS tokens, the field is available as [comment:author:field_user_avatar].  But the field/image does not show.  I have even tried the ...avatar:file] and ..avatar:url].  But it just renders nothing.  However, the [comment:author:field_your_name] does work.

I have also tried the $entity type, but that field does not seem to be there.

Is there any other way to display an author user(image) field?


texts: How to Display popup block when user scrolls down to the bottom of node

texts:
I am using drupal 7. I want to display a popup block for a user to share the node on social media, but i want this popup to appear as the user scrolls down to the bottom of the node. Any module(s) possible to achieve this?

I have tried the Popup and Popup On Load modules but none seems to achieve this objective.

Any help or suggestions appreciated. Thank you


texts:
I deleted the navigation-log-in pane.

I logged out, and when needed to log back in, wrote: "mysite/user" and the message I keep getting is as follows:

"
Not Found

The requested URL /pancher/user/ was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
"


texts: Clean URLS work with http, but not with https

texts:
When I visit ?q=admin/config/search/clean-urls via HTTP I am able to enable clean URLs and they work fine.

However, when I visit the same path via HTTPS I am not able to enable clean URLs and get this error:

Here is my apache conf file for http:

NameVirtualHost *:80

<VirtualHost *:80>

    UseCanonicalName Off
    ServerAdmin webmaster@localhost
    DocumentRoot /media/www_drive/drupal7

  <Directory /media/www_drive/drupal7>
    Require all granted
    AllowOverride All
  </Directory>

</VirtualHost>

Here is my apache conf file for https

NameVirtualHost *:443
<VirtualHost *:443>

    SSLEngine on
    SSLCertificateFile /etc/ssl/cgps/star.cgps.org.crt
    SSLCertificateKeyFile /etc/ssl/cgps/np_cgps.key
    ServerAdmin webmaster@cgps.org
    DocumentRoot /media/www_drive/drupal7
    SSLCACertificateFile /etc/ssl/cgps/RapidSSL.crt

    <Directory /media/www_drive/drupal7>
      Require all granted
      AllowOverride All
    </Directory>

</VirtualHost>

Shouldn't this config use the same .htacess file in the drupal root for both HTTP and HTTPS? What could cause clean URLs to fail to pass the check via HTTPS?


texts: Update url-aliase for nodes of a specific content type

texts:
I'm using drupal 7 in combination with path auto. I imported nodes of a specific content type using the feed importer, but the url alias is not set correctly.

My problem is, that i can not use the bulk update for content paths, because there is other content, that was migrated manually and that uses non generic url-aliases.

Is there a way to trigger the bulk alias update for a specific content type?


texts: How to deal with block cached for anonymous user?

texts:
I have placed in the site's home, via twig, a views block of nodes with a random sort and obliviously no cache active.
Therefore, at each page reload different nodes appear.
The problem is that block get still cached for anonymous users.
For now, we can't yet do performance test of the site, so we'd rather not disable the Internal Page Cache module.
The Internal page documentation says:

Websites that serve personalized content to anonymous users (dynamic, per-session, e.g. a shopping cart) will want to disable the Internal Page Cache module. This module assumes pages are identical for all anonymous users. Those websites can still take advantage of the Dynamic Page Cache module though, or can alternatively do their personalization using JavaScript + AJAX.

So after failing to find anything else useful, I've tried this solution to solve the issue.
Unfortunately I found no module that let "load" the block via ajax, or something similar. For now I've implemented a custom route that render the block view:
<?php

namespace Drupal\my_module\Controller;

use Drupal\Core\Controller\ControllerBase;
use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Drupal\Core\Render\Renderer;
use Drupal\Core\Session\AccountProxyInterface;
use Drupal\sdm_user\SdmUserSalesforceClient;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpFoundation\Response;

/**
 * Provides route responses for the Example module.
 */
class myController extends ControllerBase {

  /**
   * @var \Drupal\Core\Render\Renderer
   */
  private  $renderer;

  /**
   * @param \Drupal\Core\Render\Renderer $renderer
   */
  public function __construct(Renderer $renderer){
    $this->renderer = $renderer;
  }

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container) {
    return new static(
      $container->get('renderer')
    );
  }

  /**
   * @return array
   *   A simple renderable array.
   */
  public function render($id, $display) {
    $view = \Drupal\views\Views::getView($id);
    $render_array = $view->buildRenderable($display);
    $rendered = $this->renderer->renderRoot($render_array);
    $response = new Response();
    $response->setContent($rendered);

    return $response;

  }
}

And then in a custom js, load the necessary block via ajax:
(function ($, Drupal, drupalSettings) {
    Drupal.behaviors.products_in_home = {
        attach: function (context, settings) {
            $(document, context).once('products_in_home').each(function () {
                jQuery.ajax({
                    url: drupalSettings.path.currentLanguage + '/ajax/views/prodotti/products',
                    method: 'GET',
                    success: function (data) {
                        $(".products-container-home").html(data);
                    }
                });
            });
        }
    }
}(jQuery, Drupal, drupalSettings));

This works, but I'm kinda baffled: is this the only approach possible?
I mean, do I need to manually load via ajax every block\thing in the site that will suffer this problem?
Isn't there a module\API\some approach that can generally solve this problem, without custom specific code for every element?


texts:
I've built a Drupal 8 site without using Drush because I was couldn't figure out how to uninstall, or upgrade, the 5.7-drush on my computer.

I can't remember which method I installed Drush by in the first place and every time I've had Drush 8 working my system has reverted back to 5.7 on the next restart/boot.

I've tried extensive googling of course but haven't found a solution yet that permanently removed my old drush.

Any tips?


texts: How to show a map within a node using gmap and location modules

texts: I'm trying to save a location together with the node of a certain content type and when the node is shown I want the location to show up on a map within the node content. I use the Gmap and Location Modules, and I manage to save locations to the database, but the map doesn't show up. Any suggestions?


texts: How to change the value of a user field through Restfull?

texts: I can’t change the value of field_motherid field through restfall. GET running, PUT disabled, PATCH enabled and configured. When I do GET there is no user field.


texts:
I'm using Drupal 7, and my nodes have an image and a weblink in seperate fields, The weblink is using the link module so not sure if that will complicate things here. (if so I could downgrade the link field to a text field)

anyway I'd like to create an <A> tag around my image whilst its being themed and I want the href or that <a> tag to point to the weblink url. Sounds like an easy thing to do hey... well I can't figure it out at all! so any help would be awesome :)


texts: How do I show all the images in my public:/images/ folder?

texts:
So i have successfully uploaded my images into my public:/images folder now i want to output/display all of them in page how do i retrieve all the images?

here's  code by the way of handling the form.

 function testform($form, &$form_state) {
   $form = array();
   $form['file'] = array(
      '#type' => 'file',
      '#title' => t('Image'),
      '#description' => t('Upload a file, allowed extensions: jpg, jpeg, png, gif'),
     );
  $form['submit'] = array(
      '#type' => 'submit',
      '#value' => t('Submit'),
     );
 return $form;

}

here's the code for validating it.

      function testform_validate($form, &$form_state) {
         $file = file_save_upload('file', array(
        'file_validate_is_image' => array(),
        'file_validate_extensions' => array('png gif jpg jpeg'),
          ));
       if ($file) {
       if ($file = file_move($file, 'public://')) {
       $form_state['values']['file'] = $file;
    }
else {
        form_set_error('file', t('Failed to write the uploaded file the site\'s file   folder.'));
     }
  }
else {
   form_set_error('file', t('No file was uploaded.'));
}

}

here's the code for submitting.

    testform_submit($form, &$form_state) {
         $file=$form_state['values']['file'];
         unset($form_state['values']['file']);
         $file->status = FILE_STATUS_PERMANENT;
         file_save($file);
         drupal_set_message(t('The form has been submitted and the image has been saved,   filename: @filename.', array('@filename' => $file->filename)));
          }


texts:
How to do I inject Drupal\user\Entity\User class as dependency? I could not find service name in service list.
 for example:

$user = User::load($this->currentUser->id())

for this code I want to call like this

$user = $this->user->load(($this->currentUser->id())

when injecting in Controller. How can I achieve this?


texts:
I did noting ,when try to clear cache I see this error
Catchable fatal error: Object of class stdClass could not be converted to string includes/theme.inc on line 2742

foreach (array_keys($regions) as $region) {
    // Assign region to a region variable.
    $region_content = drupal_get_region_content($region);
//  $tmp = (array) $variables[$region];
    //ym(empty($tmp));
//  if(empty($tmp))
    isset($variables[$region]) ? $variables[$region] .= $region_content : $variables[$region] = $region_content;

I google this error but didn't find anything, anybody know what is the  reason of this error and how can I resolve it?


texts:
Below is my code. Form results are not displaying below the form. What am I missing ?

When I use print_r($form_state['storage']['results']); I'm getting the results.

But it is not displaying in the form.

Any ideas/suggestions will be helful.

function file_search_form($form,&$form_state) {
  $otpions = _get_country_titles();
  $form['countries'] = array(
    '#type' => 'select',
    '#title' => t('Country'),
    '#options' => $otpions,
    '#required' => TRUE,

  );
  $form['entities'] = array(
    '#title' => t('Entity'),
    '#type' => 'textfield',
  );

  if(isset($form_state['storage']['results'])) {
    $form['result'] = array
    (
      '#value' => t('The results of the form are: !results', array('results' => $form_state['storage']['results'])),
    );
  }

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

  $form['#submit'][] = 'webform_options_submit';
  return $form;

}

function webform_options_submit($form, &$form_state) {

  $args = array(':entities' => '%'.$_REQUEST['entities'].'%', ':countries'=>$_REQUEST['countries']);
  $result = db_query("SELECT field_entity_value,field_country_value, filename
                   FROM field_data_field_entity,field_data_field_country , field_revision_field_file_upload, file_managed
                   WHERE ( field_data_field_entity.field_entity_value LIKE :entities
                   AND field_data_field_country.field_country_value= :countries )
                   AND field_data_field_entity.entity_id = field_revision_field_file_upload.entity_id
                   AND field_data_field_country.entity_id= field_data_field_entity.entity_id
                   AND field_revision_field_file_upload.field_file_upload_fid=file_managed.fid",$args );
  foreach( $result as $item) {
    $form_state['storage']['results'] = $item->filename;
  }
  $form_state['rebuild'] = TRUE;

}


texts: Displaying multiple referenced nodes' fields through Views, using Views Slideshow

texts:
I'm trying to build some image carousel functionality. To accomplish this, I've created two content types: Slideshow, and Slide. The Slide content type is what you would expect--a few fields that hold the content of the slide. The Slideshow content type's only purpose is to hold an ordered collection of slides in an Entity Reference field.

The advantage to this approach is that the use of an Entity Reference field means that the content administrator gets a drag'n'droppable UI for the ordering of slides, which is much nicer than some clunky integer weight fields.

So, having got that part set up, I scoot off to Views to work some magic with Views Slideshow. I create a view which calls up my Slideshow node and uses a relationship based on that Entity Reference field to get to the Slide nodes. With that, I can set up the fields of the slides how I like.

The last step would've been switching to the Slideshow view format and configuring the thing, but it was here that I ran into a problem. After I got things set up the way I thought they should be, I found that only the first slide's node was being displayed.

I did my Googling, and I found another question here on Drupal Answers that was similar to mine, which you'll need to read to understand the rest of my question. Reading through it, I tried out the solution that one kind soul provided, and it worked. But it required that I switch from the Slideshow view format to the Unformatted List view format.

So now it appears that I have a choice: I show all the slides as an unformatted list, which is not a slideshow. Or, I can show one of slides as a slideshow, which is not a slideshow.

This bums me out, because I thought I found an almost perfect setup. A content-manageable slideshow with an easy-to-use UI that didn't require the client to understand weight numbers and struggle through the tedium of setting them up. Can anyone help me jump over this roadblock?


texts: Use page.html.twig template variable in another twig template

texts:
How do I call a page.html.twig template variable from the book-tree.html.twig template.

Using kint, I have found the variable, nid as in the screenshot below:

The 'nid' is highlighted, but it is the 'x-default value that is required.

This variable will be used in a set statement, comparing it to the item.original_link.nid to set an active class.

This page nid is not available within the book-tree.html.twig template.

As per Answer 1, I have created a _preprocess function in my subthemes .theme file as below:

function subtheme_bs_preprocess_book_tree(&$variables) {
 $variables['page_nid'] = 'Add code to get the node id variable';
}

The variable page_nid now shows up in the book-tree.html.twig array. The result is 'page_id' => string(36) "Add code to get the node id variable" which is the static text I added.

I would like help on how to call the nid value from the node.html.twig template. I have tried several combinations:

$variables['page_id'] = $variables['page']['content']['book_navigation']['#book_link']['nid']
But this and many other compinations I have tried all end with a:

Notice: Undefined index: page in subtheme_bs_preprocess_book_tree()

Maybe I need to call an Available method but have no clue as to how this is done.

Below is a screenshot of the {{ kint() }} output from the top of the node.html.twig file.

the value I need to target is the 115 in this line 'x-default' => value (3) 115.

Many thanks in advance.


texts: I'm looking for a solution to implement a lead capture lightbox popup form in Drupal 7. Is there module that would do this? Basically if a user is on a page after a certain amount of time (~10 or 15 seconds), a lightbox popup would go over the page they are looking at and ask them for their email.


texts: How to add comment form to a view of nodes in Drupal 9?

texts:
I'm using views to display the fields of nodes. I prefer to use fields because it allows me to use relationships (bring in author profile picture etc.). Adding the Content: Comments field shows the list of comments as well as the comment form for each node. However, when hiding and rewriting the result/and or using the replacement pattern for Content: Comments, the comment form disappears and only the comment list remains.
What methods can I use to display the comment form for each node in a list of nodes view when using fields?


texts: import a single node and all its comment from one DB to another DB

texts:
Accidently, a node(forum topic) and all its comment got deleted. The deleted data is available in local environment and now I want to export/migrate that data to live enviroment again. Plz suggest me some solution to migrate that data to live enviroment again.

Thanks in advance!


texts:
I am finally retired and have a bit more time on my hands. I'm pretty good with CSS and building a site from Drupal 8 using it "out of the box". But I'm  hopeless when it comes to additional PHP coding, and adding patches etc.

Lots of the advice I see on Drupal Answers goes over my head - can anyone point me in the direction of lessons in simple coding for Drupal?


texts: Submit is not working for contact form which was embedded by AJAX

texts:
I'm trying to add contact form with AJAX callback, called from another form. Form is embedding as well, but when I submit it only page is reloading and form doesn't send any data (in my case it's a contact form, and I can't see any created contact message in backoffice after submitting).

function somemodule_form_alter(&$form, FormStateInterface $form_state, $form_id) {
  $form['somefield']['widget']['#ajax'] = [
    'callback' => 'somemodule_form_conditional_ajax',
    'method' => 'html',
    'wrapper' => 'form-conditional-ajax-wrapper',
    'event' => 'change',
  ];
  $form['#suffix'] = '

'

}

function somemodule_form_conditional_ajax($form, FormStateInterface $form_state) {
  $output = [];
  $values = $form_state->getValues();
  $conditional_form_id = $values['somefield'][0]['value'];

  $contact_message = \Drupal::entityTypeManager()
    ->getStorage('contact_message')
    ->create([
      'contact_form' => $conditional_form_id,
  ]);

  if (!is_null($contact_message) && $contact_message instanceof Drupal\Core\Entity\EntityInterface) {
    $output = \Drupal::service('entity.form_builder')->getForm($contact_message);
  }

  return $output;
}


texts:
This should be very easy, but I cannot figure out why this is not working?

I have 2 different content types: Type1 & Type2
I currently have a view which displays all nodes of content Type1.
I would then like to manually add specific occurrences of Type2.
So far, I have done this with a Taxonomy term reference field called TaxType (terms: Tax1 & Tax2)

I have set the view to filter by content Type1, which displays all fine.
I then add filter for the Taxonomy Field with the operator of 'OR' but as soon as I add this, it stops showing content Type1?

I would expect this to happen if I left the operator as 'AND'. But with 'OR' it should keep showing Type1 or any occurrences of Tax2.

Drupal 7
Views 3.11


texts: Anyone used appcache and jquery mobile on a drupal site?

texts:
Has anyone used the cache manifest to make a Drupal site work offline? Ive made a demo with static html files which seems to work fine, so im assuming it wouldn't be too hard to achieve the same thing with a Drupal site.

The way that you tell browsers that files have changed (and so need to be downloaded again) is by adding a comment to the cache manifest file so its byte size changes. Im not quite sure how to do this with Drupal but maybe some sort of server cron could run periodically? Personally im more interested in having a site that works offline rather than achieving ideal performance, so if the file was modified every hour rather than when content actually changed that would be fine for me.

If anyone has used appcache, has anyone done so with jquery mobile at the same time? What im after is a fully native feel to a site that's accessible offline. My static demo does this perfectly, so again I would have thought this would be achievable in Drupal.


texts: I would like to export users into a CSV in Drupal 7. I believe I can use the module Views Data Export, but I am not sure how to do that or if it is the correct module I would like.


texts: Where is the target ISBN in feeds module?

texts:
I'm using an ISBN module that create a simple textfield with "ISBN" as a type (this module makes validation of the books ISBN when inserted on the textfield when creating a book) It's a pretty cool module.

But now i want to populate my database with books from a CSV file, so in the header i've : "title, author,..,ISBN" i import this CSV file using feeds module, everything is imported except the ISBN. Even when i want to create a mapping for ISBN, i can't find field_data_field_isbn in the targets list. I know that the ISBN module makes validation (or not) for isbns only if you "write it" manually using the textfield. But is there any way to get ISBN from CSV with feeds (it's not important if it's validated or not) ?

Thank you


texts:
How can I count the number of views for a video? I am using the Profile2 module to display user's information.

Users add videos which any user can see. I would like to count the number of video's views, and use that number to sort the result shown by the Views module. Is it possible?


texts: Why did the Apache directive to handle a clean URL get changed?

texts:
I noticed that the clean URLs implementation has gotten more complicated in Drupal 7. Rather than RewriteRule ^(.*)$ index.php?q=$1 [L,QSA] used in Drupal 6, Drupal 7 .htaccess has simply RewriteRule ^ index.php [L], with a comment that says "Clean URLs are handled in drupal_environment_initialize()".

I read through drupal_environment_initialize() and understand that it's using REQUEST_URI to manually set $_GET['q'], but why the change? I see the comment:

// When clean URLs are enabled, emulate ?q=foo/bar using REQUEST_URI. It is
// not possible to append the query string using mod_rewrite without the B
// flag (this was added in Apache 2.2.8), because mod_rewrite unescapes the
// path before passing it on to PHP. This is a problem when the path contains
// e.g. "&" or "%" that have special meanings in URLs and must be encoded.
$_GET['q'] = request_path();

I've got some idea what this is saying, but can anyone explain in fuller terms the reasons behind the change? If it wasn't done this way before, was something (minorly or seriously) broken in Drupal 6 and prior?


texts: Share fields between commerce variation types?

texts:
I have 12 types of products that have 4 similar property fields, for example: weight, force, collar size, noise level. There are many other different fields for each of the 6 types.

Is there a way to set up Drupal Commerce variation types so 'weight' for example is the same fieldname on all these products types?

I'd like to do this so that a faceted search can allow customers to search for weights or collar sizes, etc, across all product types.

Or any other ideas on how to structure this?
(using Drupal 7 and Drupal Kickstart 2)


texts: How to load taxonomy terms from user profile field using entityfieldquery()?

texts:
I want to write hook_node_form_alter() and limit taxonomy terms with only user checked terms on his profile in field_companies.
I can't pass the 1st step - load array of user checked terms from field_companies using entityfieldquery.
This code does not work:

$query = new EntityFieldQuery();

$result = $query
  ->entityCondition('entity_type', 'user')
  ->entityCondition('bundle', 'user')
  ->fieldCondition('field_companies', 'entity_id', $user->uid)
  ->execute();

The error message is:

PDOException: SQLSTATE[42S22]: Column not found: 1054
Unknown column 'field_data_field_companies0.field_companies_entity_id' in 'where clause':
SELECT DISTINCT field_data_field_companies0.entity_type
AS entity_type, field_data_field_companies0.entity_id AS entity_id, field_data_field_companies0.revision_id AS revision_id, field_data_field_companies0.bundle AS bundle
 FROM {field_data_field_companies} field_data_field_companies0
WHERE (field_data_field_companies0.field_companies_entity_id = :db_condition_placeholder_0)
AND (field_data_field_companies0.deleted = :db_condition_placeholder_1)
AND (field_data_field_companies0.entity_type = :db_condition_placeholder_2) ;
Array ( [:db_condition_placeholder_0] => 1 [:db_condition_placeholder_1] => 0 [:db_condition_placeholder_2] => user ) in function field_sql_storage_field_storage_query()
(line 632 in file modules/field/modules/field_sql_storage/field_sql_storage.module)

This query does not give terms, but only array with user[uid]=1 :

$query = new EntityFieldQuery();
$term_entities = $query
  ->entityCondition('entity_type', 'user')
  ->entityCondition('bundle', 'user')
  ->entityCondition('entity_id', $user->uid)
  ->fieldCondition('field_companies', 'tid', 0, '>=')
  ->execute();


texts:
When I want to see the wishlist of user 1, for example I go to http://localhost/drupal/user/1/wishlist. And I successfully get a well organized page.

But I don't see any items in the hook_menu() that describes this. How does it work?

Though there is hook_views_api(), I am not sure whether it is the place for view.

function commerce_wishlist_menu() {
  $items = array();

  $items['user/%user/wishlist/delete/%'] = array(
    'page callback' => 'commerce_wishlist_delete',
    'page arguments' => array(1, 4),
    'access callback' => 'commerce_wishlist_access',
    'access arguments' => array(1, 4),
    'type' => MENU_CALLBACK,
  );
  $items['admin/commerce/config/wishlist'] = array(
    'title' => 'Wishlist configuration',
    'description' => 'Configure wishlist',
    'page callback' => 'drupal_get_form',
    'page arguments' => array('commerce_wishlist_admin_form'),
    'access arguments' => array('administer wishlists'),
    'file' => 'commerce_wishlist.admin.inc',
  );
  $items['wishlist-actions'] = array(
    'page callback' => 'commerce_wishlist_operations',
    'access arguments' => array('view own wishlist'),
    'type' => MENU_CALLBACK,
  );

  return $items;
}


texts:
i have a page built with views and i want to add a selectbox to top of the page.

The reason i do that is simply;

first, i create options for that selectbox; type-1 / type-2 / type-3  (how and where?)
after that, i add that value (for example type-2) to wrapper as a class
finally, i write some css and change appearance of the page.

only admins can control that selectbox and change the appearance of the page instantly.

please some help, thank you all.


texts: View items content type as css class in view template

texts:
I have a view which outputs node titles from various content types, what I need is to theme the view template so one of the css classes for each row in my view is the item's content type. How would I do that?

EDIT: I tried to add the code below in the view template file but it doesn't seem to output any code:

<ul class="<?php print $fields['type']->content ?>">

In fact I even tried outputting it as a regular field but it simply seems to be ignored:

<?php print $fields['type']->content ?>


texts:
Following what described in Views filter criteria date field is greater than current date, I have used operator >= today with some success. I would like to create "future" nodes and they should be filtered out as well. What I need is for a date and time field to be filtered for today's date only. I have tried many things to include:

operator = today + either value type, machine readable or offset (returns no results)
operator = now + either value type, machine readable or offset (returns no results)
contextual filter: summary links (granularity not adjustable that I can find so returns multiple summary links for a single date & summary + a summary link is not a good UI for the application)
contextual filter: default value - "current date" (doesn't work; known issue with variably effective patch to core which I'd like to avoid) ref: https://www.drupal.org/project/drupal/issues/2325899
date only field (doesn't work due to UTC time & changes during daylight savings)


texts: Views exposed filters - how to show "You searched for [exposed filters]" above results?

texts:
I'd like to summarize the current filters used on the data in the results.

What's the easiest way to do this?

[ ] Cats
[x] Dogs

[Search]

You searched for Dogs

===============================
Lassie        Movie star
Bones         Runner
Hobbes        Show-dog

Thanks!


texts:
I am trying to style the registration/login forms so far I have copied all the files from \drupal\core\themes\stable\templates\form\ to themes\mytheme\template\form.

Inside this folder, for example there is input.html.twig which has the following code.

{#
/**
 * @file
 * Theme override for an 'input' #type form element.
 *
 * Available variables:
 * - attributes: A list of HTML attributes for the input element.
 * - children: Optional additional rendered elements.
 *
 * @see template_preprocess_input()
 */
#}
<input{{ attributes }} />{{ children }}

My question is how can I add a specific class name to this input, so I can apply styles to it in my css file


texts: How does one concatenate fields in title field in Panels (Pages)?

texts:
I have learned how to concatenate fields in Views, now I need to do the same thing in the title field in Panels. I have these fields
- first name
- last name

and I would like the title of the Panel to be
first name + last name

I'm using a module which enables me to automatically update the title field and hides it. The automatic generation includes the first and last name plus the date. I don't want this to display on top of the panel for this content type.

TIA


texts: Print value from Views field & HTML into Colorbox Image caption?

texts:
I have created a view for an image gallery with the images using the colorbox field formatter so that they open up in a colorbox window when clicked.

I would also like to display the values from the other fields in the relevant field collection in each colorbox's caption but the built in custom caption option in views does not support html markup and is only limited to around 100 characters regardless.

What would be the best way to print values from my view and html inside the colorbox's caption / #cboxTitle div ? I have tried messing about with the colorbox_image_formatter and colorbox_imagefield functions but to no avail.


texts:
I'm facing problem in Drupal query for order by custom field
Here is my query

$result = db_query('SELECT n.nid FROM {node} n WHERE n.type = :ntype', array(':ntype' => 'portfolio'));

this work fine but when I change that to this

$result = db_query('SELECT n.nid FROM {node} n WHERE n.type = :ntype order by n.field_weight DESC', array(':ntype' => 'portfolio'));

That query not working. It saying field not found?


texts: Remove content translation links from contact form

texts:
I'm having a difficult time diagnosing a problem on a site I'm working on. By default on a multilingual site Drupal puts "content translation links" at the bottom of nodes. I've disabled the content translation links in favor of the language switcher block. However, on the contact form from the contact module I still have what look like content translation links at the bottom of the form (see screenshot below).

In the screenshot the translation links that I don't want are labeled #1 and the language switcher block is labeled #2.

I've selected "hide content translation links" under /admin/settings/language/i18n , but I guess this doesn't apply to the contact form for some reason.

So far I've been able to deduce that these links are getting passed through the $content variable because when I remove print $content from page.tpl.php, the links (as well as the contact form itself, of course) disappear. It also seems that the links are being treated as part of the contact form itself; when I tried using the panels site contact page override, whenever I added the contact form widget the links were included.

I apologize if this is perhaps too "localized" (pardon the unintentional pun) a question, but any help with figuring out how to get rid of these content translation links from the contact form page would be greatly appreciated. On the one hand I highly doubt this is the expected default behavior, so I feel like I must have tripped a setting or missed a setting somewhere. But at the same time I've looked through pretty much everything I can think of, so I'm at a loss.


texts: Any way to flag users who previously submitted a webform on revisit?

texts:
My business team needs users who submitted a specific form to be flagged in order to allow them to gain access to a certain piece of content, which we've hidden behind a conditional check on whether they have the flag or not. I understand how to set up a form action to raise a flag on a given user. Unfortunately, I didn't know there was a requirement to flag users until most had already submitted the form.

I'm wondering if there's anything I can do, now that the horse is out of the barn and a number of users have already submitted the form without getting flagged, to ask users to revisit the form and, if they've already submitted it once, just:

a. get the flag raised
b. get redirected to the page with the restricted content


texts:
I am new to Drupal and am currently trying to edit some pages on a site I inherited. The site does not seem well-organized as there is a panoply of URL redirects and aliases. As a result, I am having a difficult time finding the right pages to edit.

Is there a way to just search for the path and have it return the right content to edit? Perhaps there is a module for that?

As an example, I have a page www.example.com/donate which needs to be edited. When I look under aliases and URL redirects, "donate" returns nothing. How can I go about finding this particular page?


texts:
I have a field collection field with 5 text and image fields per field collection item. On a node with lots of field collections, this makes it very difficult to navigate the node edit form.

I am looking for a module to put the field collections into tabs. One tab per field collection. Clicking "add another" would add a new tab with empty fields to the node edit field collection field.

Please note, I have seen Field Collection Tabs Formatter but this only formats the display, not the node edit form. I have also seen this question, but same thing, its only for the manage display.

I would be happy to use multifield instead of field collection if there was a solution.

Note:
Out of interest, I tried placing the field collection field in a horizontal tabs group using Fieldgroup. Then I tried putting a horiztonal tab around the fields inside the field collection, but this didnt work.


texts: Why is a SPAN included in comments $created variable

texts:
I noticed that SPAN tags are included when the $created variable is printed in comment.tpl.php

This seems to be true even if that variable has been preprocessed with format_date().  Why is this and is there anyway remove the span?


texts:
I have a view setup named Homepage Suppliers.

It is a jCarousel format that displays an image field which links to the content.

What I'm looking to do, is theme this using a view template to get it exactly how I want it.

I've tried using the following file names:

views-view--homepage-suppliers.tpl.php

views-view-list--homepage-suppliers.tpl.php

Do these look right?

Thanks


texts: backing out of a module update after uploading it and before the database update (new update is incompatible with my version of PHP)

texts:
I got a situation here and I don't know what to do. Drupal 7.

There's an update for reCAPTCHA so I click the button and checkboxes and whatever to update it, it uploads the files to the server and unpacks them and stuff, and then I click the "update database" link. BTW, there's two other modules being updates: rules and GA.

On the resulting page, /update.php, it first check the requirements (I rarely see this screen, it usually breezes right past it) and there's a big red error message saying that "reCAPTCHA requires at least PHP 5.5.*" and I have PHP 5.4.45.

Should I delete the reCAPTCHA module from /sites/all/modules/, and then put the files for the old version in there? If I do that, will the database updates script be confused?

Thanks!!


texts: Using rules, how do I assign an action to a vbo list item based on its position in the list?

texts:
I'm using rules and conditional rules. I have an action set that is using a vbo list (4 node titles sorted by post date desc) to flag nodes on the list.  This works fine. However, I need to make the first item on the list sticky and the 2nd item on the list promoted.  Then I need to remove sticky and promoted from the 3rd item.

Do I need to be using alert_entity_list:0 and alert_entity_list:1 or should I be looking for alert-list-item:0, etc. ... or am I way off base?


texts:
I have a content type with a (private) file field. Content is protected by a node access module.

I would like to log (in a particular way) when a user is about to download a file.

hook_file_download looks like it will do the trick, but on the other hand, its stated purpose is to "control access". I'm letting Drupal Core control access; I just want to log a (successful) download.

Is there a better hook to do this with?


texts: EntityQuery on nodes related by ERR and paragraphs

texts:
I have content type Publication which relates to content type Project using paragraphs:

Publication [field_mention] -> Mention (paragraphs) [field_project] -> Project

Now I want to show all referenced Projects on Article templates. Views doesn't show all relations because of the complexity of this relationship.

I try to do it using EntityQuery with the following code used in a Custom Block Module in the following way:

$nids = \Drupal::entityQuery('node')
    ->condition('status', 1)
    ->condition('type', 'publication')
    ->condition('field_mention.entity.field_project.target_id', \Drupal::routeMatch()->getRawParameter('node'))
    ->execute();

The result is empty (after a long loading so) and logs don't show any error.

Is field_mention.entity.field_project.target_id the right way to do it or do I miss something?


texts:
I am attempting to secure the admin pages (/admin/*) and login page (/user/login) to port 8443. I have successfully done that with the following in apache 2.4:

<VirtualHost _default_:443>
    ServerName example.com:443
    ServerAlias drupal
    DocumentRoot "/opt/rh/httpd24/root/var/www/html/example.com/current"
    <LocationMatch /(user|admin)>
            Require all denied
    </LocationMatch>
</VirtualHost>

<VirtualHost *:8443>
    ServerName example.com:8443
    ServerAlias drupal
    DocumentRoot "/opt/rh/httpd24/root/var/www/html/example.com/current"
</VirtualHost>

The problem I am having is when I go to https://www.example.com:8443/user/login and login, I am redirected to http://www.example.com:8443/user/1.

This creates a 400 error - Bad request. Trying to serve http content over a SSL port.

How do I tell drupal to stay on https protocol and remain on port 8443?


texts: How to find the ID of a views block that is not assigned to a region?

texts: The title pretty much says it all. I need to find the ID of a Views block that is not assigned to any region, in Drupal 7.


texts: Workbench moderation and check permissions tab

texts:
Reading through the workbench_moderation module readme file I came across this:

For reference, these are the permission sets recommended by the "Check
Permissions" tab:

Author:
  Node:
    access content
    view own unpublished content
    view revisions
    create [content type] content
    edit own [content type] content
  Workbench Moderation:
    view moderation messages
    use workbench_moderation my drafts tab

However, going to /admin/config/workbench/moderation/check-permissions on my drupal 7 instance, when I select the drupal role of editor, I don't see any of the options listed in the readme file (as above).

All I see is, Moderation task dropdown menu, and then a list of Content types (which I previously enabled in the structure section)

Why am I missing all these options in the Check permissions tab?


texts: How to show year/months in archive block?

texts:
I want to create a archive block for blogs. I tried by using default archive view block, bot that structure is not suitable for my requirement. I need years to display and when I click on years, months should display like below:

           2016
             Jan 2016
             Feb 2016
           2015
             Jan 2015
             Jan 2015
           2014
           2013
           2012

In the same way after a click on year/month, related data should get display.


texts: Is there a robust, free module for SE-style social signup?

texts:
I want to enable users to create accounts using existing Google, Facebook etc accounts, without needing to come up with and remember yet another password. Similar to how the StackExchange network does.

There's a proliferation of modules that have related features to these. I'd like to know if there's any one of them which has proven to be stable, robust, simple (requiring few dependencies or possible points of failure) and working without requiring paid subscriptions.

Some modules I've looked at:

I've seen many recommendations for Janrain Social Login, but I read that it's a paid-for service. This site is a very small project and that's beyond its scope. The demos I've seen also suggest that it removes the ability to create a Drupal-only account should the user want to.
I tried the built-in OpenID module plus OpenID Connect, but discovered that it only supports log in, not sign up.
There's a stack of modules built around OAuth (e.g. OAuth Connector). I gather that OAuth is a different protocol to OpenID, and requires dependencies to be installed on the server. In terms of functionality I haven't yet figured out what the fundamental difference is between the OAuth stack and Drupal's built-in OpenId stack, and I can't find any confirmation in the various docs available that it does indeed support signups. It has all the hallmarks of a serious project, though.
There's the connector module - I think this an API module used by the OAuth stack?
Hybrid Auth looks really promising and is my current front-runner: it explicitly supports signup and login, and has minimal dependencies (one open-source library, php-curl, and ctools), and is under active development with a stable D7 release. Sounds great, but I've not seen many recommendations for it, so I'm wondering if there's something I've overlooked.
There's Gigya, which looks like a 3rd-party service with fancy social features that aren't relevant in my case.
There's OneAll social login, which has a promising-sounding description but doesn't appear to be widely used.
There's Social Connect, but it seems to be Facebook only.
...and loads more, including many more 3rd party services and modules for specific providers.

I'd appreciate any expert advice from experience on the simplest stable way to get a sign up screen similar to this:


texts:
Everytime I run simpletest it creates tables that it does not clean up.  Is there anyway to tell drupal to automatically clean these? I looked in my db today and there are hundred of misc unecessary simpletest tables.
Thank you


texts: Restrict "add more" button to add new fieldset after adding 5 fieldsets

texts:
I have taken a field of type field collection in my user-profile-form and its cardinality is set to unlimited as I wanted to have "add more" button for the users. I want to restrict the addition of fieldset to five numbers.

If I change the number of fields to be displayed to 5 from edit, it renders all the five fieldsets altogether which I do not want.

I tried overriding field_multiple_value_form() in my template.php file but did not succeeded. Please suggest some ideas to achieve this.
Thanks In advance.


texts: Views listing of nodes and node title as exposed filter

texts:
When I started this view I thought it would be simple… But it's not.

I've an "Office" content type and a view (block) where are listed my "Office" nodes as teaser.

First of all it could be great if the result should be sorted with AJAX, but it's only an option.
I would like an exposed dropdown list filter with all the nodes title of my "Office" content type. But it seems I could only expose an input search field.

I already looked at BEF and several posts here but I didn't find a clear solution.


texts: Best way to benchmark Drupal stack performance

texts:
I recently asked a question regarding Drupal performance and got some great replies.

This got me thinking, what is a reliable/meaningful way to benchmark Drupal?

It's easy to say "install APC, memchached & Varnish" or "install module x or y", but how can I quantify just how big of a performance gain I'm getting from each setup? Basically, a sure-fire way to compare setups and find bottlenecks to squeeze the most possible performance from a Drupal site. What is the best method to find out?

Targetting Drupal 6.


texts: User role weaker than authenticated user

texts:
I am using LoginToboggan Module and I want to create to create a "pre-authenticated" user role that users get assigned to upon registration. After they have verified their email address they will be promoted to "authenticated" users. Obviously, pre-authenticated users should have restricted permissions.

  If "Set password" is selected, users will be able to login before their e-mail address has been authenticated. Therefore, you must choose a role for new non-authenticated users -- you may wish to add a new role for this purpose. Users will be removed from this role and assigned to the "authenticated user" role once they follow the link in their welcome e-mail.

I created a new role "pre-authenticated" and gave it weight 1 and "authenticated" weight 2 ("anonymous" has weight 0 and "administrator" has weight 4). However, whenever I give "authenticated" users the permission to do something, "pre-authenticated" users inherit this permission. It seems like Drupal treats all custom roles as being extra roles for users that already are authenticated. I already cleared my cache and ran cron.


texts: How do I contribute a version of the same module for the latest core version?

texts:
I have contributed a module for Drupal 7; now I am interested in contributing the Drupal 8 version of the same module.

When I started creating the Drupal 7 version; I had all the instructions (under VERSION CONTROL of the project); now I need instructions in order to start with the Drupal 8 of the module.

So, I am looking for GIT instructions.


texts: Multiple menu locations in taxonomy menu

texts:
I've used taxonomy menu version 7.x-1.5. Due to this module I can only added taxonomy menus into single menu location.

But I want to add a taxonomy menu into multiple menus. Is it possible? If yes, how to do this?

I've attached image. Please look it.


texts: How to translate the month name in a date select list field?

texts:
I have created a date field in user account fields. In manage form display, I have selected Select list as widget.

I want to translate the month names which is displaying a select list.

I checked it here admin/config/regional/translate and in config translation admin/config/regional/config-translation but I don't see any option to translate it.

Is there anything I am missing. Is it possible to translate the month names in the date select list?


texts: How to show only values matching filter in a view?

texts:
I have created a view, in which I apply a filter on a taxonomy term field that can contain multiple values.  This field is also displayed in the view.  Is there any way to only display those values in the view that match the filter?

For example:

Field of one node contains both terms A and B.
Filter set to select all nodes containing term A.
The view should only display A (not B) for this node.

If I uncheck the "Display all values in the same row" option, the view splits the entries, but I can't seem to get rid of the extra values.  I have also tried enabling "distinct" values and the "reduce duplicates" options; neither option helps.

Am I missing something simple?


texts: I can't log in after removing the user login left bar

texts:
I removed the user login block on the left of my default drupal instalation (7.21) and now i can't login.

When i try: mysite/drupal/?q=admin
It gives me "access denid".

I Don't feel like reinstalling my drupal just for this there has to be a simple way to fix this?


texts: How do I customize an article URL alias?

texts:
In Drupal 6 there is a possibility to customize URL alias by the help of [AUTOMATED ALIAS SETTINGS], but this will affect all the articles. I need to restructure my URL alias only for few paid articles.

Can we able to add /pro/ somewhere in the url only for few articles like as follows,

Original article url parameters:

www.example.com/{article}/{channel}/{year}/{month}/{nid}/{article_title}

Customised article URL:

www.example.com/pro/{article}/{channel}/{year}/{month}/{nid}/{article_title}


texts: Can anyone please tell me the best mobile theme I could use for iOS devices? I tried the iUI theme but it doesn't display the table with the info properly :)


texts:
What is the correct way to create a translatable in four languages website logo with slogan?
I am thinking  of creating a custom content type which will be populated in View block. Which when will be inserted in logo region.
Are there any other approaches?


texts: What is the order of page load in Drupal?

texts:
How does the page load order occur for Drupal?

I understand that first the modules are run and the data is returned to the view files. But which files are responsible for the view loading inside the theme?

Would it be page.tpl.php?

Also I trying to determine the page load when a 404 error is thrown. Which page.tpl.php loads the page when a 404 error is thrown?

I know that drupal_not_found() function returns the data, but how would I know which view would load that page?


texts:
I do not know how to use the last module "project/commerce_pos" version 2 dev. I can not even get a view point of sale. Can you tell me how to access the point of sale? there is no documentation.

I know how to access the settings, but I can not access the page above to use the pos

I do not see how to add products


texts: I saw this,  How much of Drupal 8 will rely on or be compatible with Symfony? but I don't understand if it applies to my question.  Should I learn Symfony 2 to develop with Drupal?


texts:
I am working with webform module , I have added two different forms in my website.
I have customized the forms according to my convenience, as I have changed the css. These changes are reflected in the two forms.
Now i need to get the id of these forms so i can further customize one of them.
I have added this css code for form

.form-text,
.form-textarea {
   width: 100%;
}


texts:
Does there exist an updated master list of contrib modules in some easily parsed format (csv, json, xml ... whatever) that I can use for quick reference to see active full projects (not sandbox)?

I'm particularly interested in a list of project names and their machine names. I'm working on a custom module that may turn into a contrib module and I'd like to make sure my project name and machine name aren't already in use.

I know I can search here:

https://www.drupal.org/project/project_module

But it'd save time if there was a list I could quickly reference. A quick Google search yielded no usable results in the first few pages.


texts:
I have made a deep research over the web and I also tried a lot of alternative solutions, but I didn't find any solution to disable the email notification for new users.

In my User Settings, I have the option "Visitors can create accounts but administrator approval is required" checked, and the option "Require e-mail verification when a visitor creates an account" not checked.

Do you have any idea?


texts: Is it possible to display a Boolean field in a block using views?

texts:
Using views,

I created a block that displays users that are online.
In order to allow users choose to appear online or offline, I added a Boolean field to the user account, which I subsequently used as a filter for the online users. All this works fine.

Now I need to find a way to have a form - (with the Boolean field as its only field) appear as an 'attachment' to the original block? In this way users can choose to appear offline without having to go to their user account page.

Please, is this possible using views,thanks.


texts: Is there some way we can use <br> or javascript line breaks in Node, Page and/or Block Title fields?


texts: Tag & vocabulary module or technique that mimics stack exchange tag behavior?

texts:
I am looking to recreate the tagging functionality of stack exchange:
- enter tags on a single text input line, with comma separation.
- add new tags to the taxonomy
- increment count of existing tags
- inline suggestion based on initial character entry

Is there a Drupal module or set of tools that provides this functionality?


texts:
I have a view with an exposed filter for a date range. I use jquery ui datepicker to select dates. It works good and I can select dates in spanish format (dd/mm/yyyy). But when I apply the filter, It understands that the format is mm/dd/yyyy and It doesn't work good. In the worst case, if the day is greater than 12, It throws an error due to invalid date because It understands that the first number is the month.
How could I fix this issue?


texts: Config import for certain items appears to fail. How do I fix this?

texts:
After synchronizing configuration from dev to staging, I would expect all changes to be imported and for a message to display, advising "There are no configuration changes to import"
Most changes have been imported but I am left with six items which seemed to have failed import. Or a least do not clear from the list of items for import.
I do not understand why the active configuration appears not be be updated by staged.
As well importing all, I have also attempted to import each item separately, without success.
As well as using the UI have also tried drush cim. Drush confirms that the configuration was imported successfully. But if I run drush cim again, the same 6 files remain.
Why does it appear that the import is failing and what should I do to fix it? Is my active configuration messed up somehow?
A screenshot and some code to illustrate the problem.
Via the UI

Via Drush
    [easable]:sync$ drush cim
    +------------+-----------------------------------------------------+-----------+
    | Collection | Config                                              | Operation |
    +------------+-----------------------------------------------------+-----------+
    |            | block.block.schoolpwa_subtheme_bottommenu           | Update    |
    |            | block.block.schoolpwa_subtheme_mainnavigation       | Update    |
    |            | block.block.mainmenu2                               | Update    |
    |            | block.block.websiteswitcher                         | Update    |
    |            | core.entity_view_display.node.page.default          | Update    |
    |            | media_bulk_upload.media_bulk_config.pdf_bulk_upload | Update    |
    +------------+-----------------------------------------------------+-----------+

     Import the listed configuration changes? (yes/no) [yes]:
     >

     [notice] Synchronized configuration: update block.block.schoolpwa_subtheme_bottommenu.
     [notice] Synchronized configuration: update block.block.schoolpwa_subtheme_mainnavigation.
     [notice] Synchronized configuration: update block.block.mainmenu2.
     [notice] Synchronized configuration: update block.block.websiteswitcher.
     [notice] Synchronized configuration: update core.entity_view_display.node.page.default.
     [notice] Synchronized configuration: update media_bulk_upload.media_bulk_config.pdf_bulk_upload.
     [notice] Finalizing configuration synchronization.
     [success] The configuration was imported successfully.
    [easable]:sync$ drush cim
    +------------+-----------------------------------------------------+-----------+
    | Collection | Config                                              | Operation |
    +------------+-----------------------------------------------------+-----------+
    |            | block.block.schoolpwa_subtheme_bottommenu           | Update    |
    |            | block.block.schoolpwa_subtheme_mainnavigation       | Update    |
    |            | block.block.mainmenu2                               | Update    |
    |            | block.block.websiteswitcher                         | Update    |
    |            | core.entity_view_display.node.page.default          | Update    |
    |            | media_bulk_upload.media_bulk_config.pdf_bulk_upload | Update    |
    +------------+-----------------------------------------------------+-----------+

     Import the listed configuration changes? (yes/no) [yes]:
     >


texts: Delete CCK fields that are flagged as "inactive"

texts:
With D6, I have a Feature that defines a content type and a number of fields. It's currently deployed and living happily on Production servers. My Feature is now changing, and some of the old CCK fields will no longer be needed. Any updates must be done programmatically. Here's what I plan to do:

Removed the fields from my Feature export
Deploy the new Feature, which will leave the CCK field & data in the DB, but flag the CCK field as "inactive"
Run a migration script to move the old field data into the appropriate place
Delete the CCK fields from the database for good

It's the last step where I'm uncertain how to best proceed. I read (somewhere?) that content_field_instance_delete() can only be used to process "active" fields. Can I just safely delete the column from the appropriate content_type_* table?


texts:
I am trying to write a shortened Drush option - we want to have an option for both --force as well as -f

I'm searching everywhere and not seeing any documentation, but it seems like something like it is supported based on this page:

https://groups.drupal.org/drush/commands

What I've got so far:

function parsexml_drush_command() {

  $items['parsexml'] = array(
    'description' => 'Parses XML from an XML feed.',
    'aliases' => array('pxml'),
    'arguments' => array(
      'path' => 'Path to the XML file.',
    ),
    'options' => array(
      'force' => 'Flag to force processing of previously processed XML files.',
      'f' => 'Shortened flag to force processing of previously processed XML files.',
    ),
  );

  return $items;
}

But my guess is that that isn't correct.

What is the correct way to have multiple aliases per option? I can only find how to set the alias for a given drush command.


texts:
I'm using the https://www.drupal.org/project/views_field_view module on my Drupal 8 installation, and my current setup consists of:

Products (Content Type - has an entity reference to the Product Availability taxonomy)
Product Availability (Taxonomy)
All Products (View - with the Product Availability view as a field)
Product Availability (View)

Now, for each product displayed on my Products view I'd like to show the 'Product Availability' view fields, only for that product. For example, Product A might have the availability 1 and 2, whilst Product B may have only the availability 3. So I only want to show the availability for each product. I'm not sure how I'm supposed to set up a contextual filter for this, or if even that's the right way of doing this.

I somehow need to pass reference to my child view, Product Availability, the node ID of the product I would imagine.

Any suggestions?

EDIT: I've managed to get the result I wanted by going at this in a bit of a backward way. Instead of trying to configure the filter at the level of each product, I've set it up to be on the level of the Product Availability content type. Obviously this isn't as user-friendly, as to relate a 'Product Availability' to a 'Product' this way, you'll need to go into the 'Product Availability' content type and then select the products individually.


texts: How to hide/exclude a product for the list of products

texts: I want to hide or exclude a product listed in the list of products displayed by Ubecart (for example in the catalog list, or list of nodes displayed by a taxonomy term). That I want is just allowing the users to visit the product directly (from a email for example).


texts:
I've tried nearly everything to get my image quality to improve upon upload. I have an imagestyle on my image upload field that is set to resize uploaded images to 300x300. I've installed ImageMagick (hearing a myth that doing so improves the image quality drastically), but I see no change.

I'm desperate - any idea as to how I can get my images to maintain their quality when uploaded? This seems like it should be a simple thing?

See example below. The image on the left is what it looks like when I resize outside of Drupal (e.g. with Photoshop; see how sharp it is?!) - the image on the right is when it's resized via Drupal image field/image style.


texts: Disable comments in nodes specific taxonomy terms are attached to

texts: I know it is really easy to disable comments if your content is organized by content type, but what if it is organized by taxonomy, is it possible to disable comments on all nodes with, say, the term 'news' attached to them? If so, how?


texts: easiest way to implement alternating row colors?

texts:
DISCLAIMER,

I am not a programmer.

What would be the easiest way to implement alternating css row colors in a table for a drupal 7 theme?  Thanks!


texts: Need to redirect Parent Taxonomy Term page to oldest child

texts:
I use the Views version of the taxonomy listing page.  For performance reasons, I can't use a depth of 1 on the 'Taxonomy Term (depth)' contextual filter.

Unfortunately, for one taxonomy, ALL terms are a child of this one set of six terms (think Publication / Issues of a magazine).  Is there a way I can, in my menu, link to the parent terms, yet have that listing page show only the nodes from the most recent child?

Otherwise, is there a way, in that View, to have an increased depth (1 vs 0) ONLY if there are no nodes for the particular term?


texts:
I am using the Organic Groups module and am following the readme file. I am on step 2:

  Create a new content type via admin/structure/types/add. Call it
  "Group", and define it to be of Group type.

Just curious, can I call it another name rather than " Group"? like "Site", or something else...

Thanks!


texts: Breadcrumb add content type data without any modules

texts:
How could I print content type like the breadcrumb, for example

  Home/Content type/Create


texts: What is the difference between wysiwyg module + ckeditor and ckeditor module?

texts: What is the difference between using the Wysiwyg module and the CKEditor - WYSIWYG HTML editor module? Are there benefits on using one over the other?


texts: How to get user.field value in node.twig

texts:
I have a field_author with different values expert, moderator or contributor

For get this custom USER field in node.twig i using next function

function MYTHEME_preprocess_node(&$variables) {

if ($node = \Drupal::routeMatch()->getParameter('node')) {
                  $variables['author'] = $node->getOwner()->field_fname->value;
        }
    }
}

And then {{ author }} in node.twig

How to get vlue of this field? For example {{ author.0 or author.1 or author.3}}?

Thanl you for helping!


texts: Find out what time was last comment posted on a node

texts:
I want to put a new icon next to node listed in a block if it was created/updated or commented on in last 1 day. I'm able to fetch all the nodes which were created/updated or commented on sorted in descending order of their time of creation/update or comment.

This is my code in template.php:

 function analytic_preprocess_views_view_fields(&$vars) {
     $viewName = $vars['view']->name;
     $view1 = "view1";
     $view2 = "view2";
     $view3 = "view3";

    if (strcasecmp($viewName, $view1) == 0 ||
        strcasecmp($viewName, $view2) == 0 ||
        strcasecmp($viewName, $view3) == 0)
      {
           if (isset($vars['view']->name)) {
              $created = $vars['row']->node_created;
              $changed = $vars['row']->node_changed;

              $cexpire = $created + (1 * 24 * 60 * 60); //one day later
              $uexpire = $changed + (1 * 24 * 60 * 60); //one day later

              if (($cexpire > time()) || ($uexpire > time())) {
                    $vars['newicon'] = '<img src="'. path_to_theme().'/images/new_icon.gif">';
              }
       }
    }
}

Problem is that when I commented on an older article which I created few months back, it was accurately displayed at the top of my block but 'NEW' icon didn't appear next to it and I saw this error on the page:

Notice: Undefined variable: newicon in include() (line 28 of /home/user/public_html/sites/all/themes/analytic/views-view-fields--viewname.tpl.php).

where I'm displaying/rendering this image.

My understanding is that for the node which just has a new comment I don't have the time of update. How do I get that? Like I have node_created and node_changed.