texts: Limit of 15 routes in module.routing.yml

texts:
I have see when i want to create a new route they have an limit of 15 routes per module. In fact i have created an over route an i'm suprise to see of my road wans in route:debug. However they are in the module.routing.yml

I have cout the number of routes i have , and after 15 the routes arren't seen.

It's me or it's normal?

The YAML file :

 //empty line is not comment on the code
 unicef42.unicef_controller_index:
   path: '/unicef42'
   defaults:
     _controller: '\Drupal\unicef42\Controller\UnicefController::world'
     _title: 'Unicef controller'
   requirements:
     _permission: 'access content'

 //...the other routes

 //The 15th routes , no comment in the real code,1 empty road between the 14th and the 15th routes
 unicef42.accueil_controller_index:
   path: '/accueil'
   defaults:
     _controller: '\Drupal\unicef42\Controller\AccueilController::index'
     _title: ''
   requirements:
     _permission: 'access content'

 //The 16th routes , no comment in the real code, 1 empty road between the 15th and the 16th routes
 unicef42.accueil_controller_index:
   path: '/accueil2'
   defaults:
     _controller: '\Drupal\unicef42\Controller\AccueilController::index'
     _title: ''
   requirements:
     _permission: 'access content'
 //empty line is not comment on the code


texts:
I have a splash page where the user will choose a language before entering the site.
This page only needs the header region and a background image (for the #main-wrapper div) that should occupy the rest of the screen size.

I'm using

#main-wrapper {
    background: url('img.jpg') center no-repeat;
    height: 100%;
    width: 100%;
    background-size: cover;
}

But it doesn't fill the available space, only the #main-wrapper div, so I end up with a grey area below the background image, where the footer should be.

Is there a way to make this region expand all the way to the bottom (I don't need the footer in this particular page) without declaring it's height in px?
I want to avoid scrollbars when not necessary, and have the image fill the space when resizing the window or viewed on mobile.

Is it possible to do this with Bartik theme?

EDIT:

I've already hidden the footer, but that doesn't make the #main-wrapper div reach all the way to the bottom. I still get a blank space below it.


texts: form with taxonomy autocomplete widget throws error upon submit: Invalid argument supplied for foreach()

texts:
I have a custom form with this field in it:

$form['first']['field_city'] = array(
    '#title' => t('Woonplaats'),
    '#type' => 'textfield',
    '#size' => 25,
    '#autocomplete_path' => 'taxonomy/autocomplete/field_city',
    '#element_validate' => array('taxonomy_autocomplete_validate'),
    '#required' => TRUE,
);

I'm trying to use the autocomplete tagging widget to use with an existing taxonomy vocabulary on this form.
It works fine tags are loaded when I start typing but if I submit the form I get the following Warning:

Warning: Invalid argument supplied for foreach() in taxonomy_autocomplete_validate()

resulting in this error and the wsod (white screen of death)

   PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '))' at line 2:
SELECT base.tid AS tid, base.vid AS vid, base.name AS name, base.description AS description, base.format AS format, base.weight AS weight, v.machine_name AS vocabulary_machine_name FROM {taxonomy_term_data} base INNER JOIN {taxonomy_vocabulary} v ON base.vid = v.vid WHERE (base.name LIKE :db_condition_placeholder_0 ESCAPE '\\') AND (base.vid IN ()) ; Array ( [:db_condition_placeholder_0] => Amsterdam )

I think I'm missing something in the form decleration or made a mistake somewhere.
So what's wrong with it? Thanks!

some suggestion is that the machine_name of the field might be wrong. ( the machine name is actually stad when I look in the taxonomy in the admin UI).


texts: Why is my Forena report parameter not displaying as a textbox?

texts:
I created a Forena report using a data block that has one parameter in it, i.e. ":year".

When creating the report, the parameter is detected and added to the report definition. When previewing the report a textbox is shown to let me enter a value and test the report. However after saving the report no text box displays to allow data entry for this parameter. I have checked the settings for the parameter and the "Input Control Type" is set to Textbox. I have tried both Yes and No settings for the "require" setting.


texts: Using Address Locality field as Entity Reference

texts:
Im using Drupal 8.

In content-type-A, I have a field type Address with country and locality as required fields. I want locality as an entity reference to be use in content-type-B.

Whenever I create an entity reference view, its giving me the list of content title as a result. I added locality as field(and/or remove content title) and select it as search fields. I am getting no results on it.

I assume locality results would showed up.


texts: Hook to replace custom tags in block showing related articles

texts:
I use a single drupal8 installation to serve content for multiple website's FAQ section. So I have put some custom tags like "##website_name##" in the html in article content and title.

Depending on the current domain, the tags get replaced. I have successfully replaced the tags in article content and title while displaying article page.

I have also created a block view to show related articles to the current article depending on the taxonomy of the article.

Problem is the tags I had placed in article title is not getting replaced when the related article block is replaced.

    function my_module_preprocess_views_view_unformatted(&$variables)
    {
        $rows = $variables['rows'];
        foreach ($rows as $id => $row)
        {
            $variables['rows'][$id]['content']['#row']->_entity->get('title')->value
                = replace_tags_in_content($variables['rows'][$id]['content']['#row']->_entity->get('title')->value);
        }
    }

Also tried following code:

function my_module_preprocess_block(&$variables)
{
        if ($variables['plugin_id'] == 'views_block:related_articles-block_1')
        {
            $results = $variables['content']['#view']->result;

            foreach ($results as $key => $result)
            {
                $title = $variables['content']['#view']->result[$key]->_entity->get('title');
                $variables['content']['#view']->result[$key]->_entity->get('title')->value = replace_tags_in_content($title->value);
            }
        }
}

When I inspect the title value in debugger, values are getting replaced but when the output is shown on the page the custom tags are still present.

Following the the screen shot for the view setting:


texts:
I want to use special characters (like üßä) in my clean URL alias's and google says they must be UTF8 encoded.

I have no idea if this is the case by default, or how to check. Are URLs UTF-8 encoded?


texts: Link to content within node, from CKEditor WYSIWYG

texts:
This seems like it should be fairly simple, but I'm having trouble getting off the ground.

I have a content type "Document". This content type has a field of type File, which allows for uploading PDF's. This content type also has a title, such as "My User Manual".

I want to create a simple CKEditor plugin, similar to LinkIt that will allow a content editor to highlight a piece of text, click a button in CKEditor, search for and select Document content types.

The result will be that the highlighted text will be wrapped in an anchor tag with an href to the file (which comes from the Document > File field).

I know there are modules link IMCE which I can use to link to a file in the sites files, but I'm trying to simplify this a bit, as well as maintain only one file(s). I have also tried Entity Embed, unfortunately, this module embeds content, and doesn't necessarily allow for inline linking.

Thank you in advance for any insight you can provide.


texts: REST interface to custom entity type getting constant 403's

texts:
I created my module and the entity definition using the drupal console. It has not been modified at all. My entity is for a user but for various reasons I won't be using the pre existing user entity.

I installed restui, serialization, hal, basic auth. All working fine.

I have created a REST instance for my entity using the UI; POST & GET using json+hal and basic auth.

Using curl (and Postman) I can create and retrieve a node; I can also retrieve a custom user entity that I created through the UI. All the above was easy, no dramas, took no time at all.

Then it came to creating a custom user entity. No dice. I get persistent 403's and nothing in the message (and nothing logged in watchdog which is handy.)

The auth is using an admin account (in fact 2, I created a new one in a display of desperation); admin users have all permissions by default, but I did add extra permissions to authenticated role also in the off chance that it used that internally. (More desperation.)

I'm clearing the caches every 5 minutes also.

I have sent requests using the X-CSRF-Token header using a mix of fresh and old tokens (ie, requesting new ones before a full request and then trying old ones also). Anybody know how often we should be retrieving new tokens?

I've also tried with no tokens.

The issue is that I have no idea where this is falling over, so all I can do is flail my arms around in a vain attempt at hitting something useful (I'm sure this was a dungeons and dragons action?)

The body of my POST request has been changed also, but I'm not convinced that it would throw a 403 if incorrect, I'd assume a 'malformed' response would come back or at least a non 403. Can anybody confirm?

As my entity was created by the console and I can see all the CRUD permissions enabled on my admin roles, where can I go from here?


texts: Ubercart - moving uc_order-customer.tpl.php to my theme folder makes emails sent twice

texts:
Ive copied uc_order.tpl.php to my them folder as well as uc_order-customer.tpl.php which ive used to remove a few fields from the customer's notification email.

The problem is that now the same email notification is being sent twice at the same time, to the same email address.

If I remove the files from the theme folder, the problem goes away, but of course I need to modify the template and i wont want to hack core.

Thanks


texts: Populate a drop down select list with the results from a view with entity reference relationships

texts:
Ok. Perhaps this has been asked before  in this site somewhere but for the life of me I can't find an answer.

I have three content types: Client, Contact and Job ticket.

Clients are companies with whom I conduct business. Contacts are contact persons within these companies. The Contact content type has a reference field referencing their company's node. Job tickets are tickets for jobs these companies hire me to do for them. In this content type I have two reference fields: one for the Client and one for the Contact.

What I need is to have the Contact reference field (drop down select list) dynamically populated with the contacts for the client I chose in the Client reference field (another drop down select list). Because if I populate it with ALL the Contact nodes then I get a very big list and I don't know which contact belong to Which company.

I know I can do this with a entity reference view display but I don't know how to configure it.

Thanks in advance for your help.


texts: How do I add  tags to the output of a view list?

texts:
The output of a view I am using contains the following code.

    ....

    ...

    ....

    ....

I want to add
....
 around the following snippet.to group two fields

      ...

      ....

the loop

 <?php foreach ($fields as $id => $field): ?>
  <?php if (!empty($field->separator)): ?>
    <?php print $field->separator; ?>
  <?php endif; ?>

  <<?php print $field->inline_html;?> class="views-field-<?php print $field->class; ?>">
    <?php if ($field->label): ?>
      <label class="views-label-<?php print $field->class; ?>">
        <?php print $field->label; ?>:

    <?php endif; ?>
      <?php
      // $field->element_type is either SPAN or DIV depending upon whether or not
      // the field is a 'block' element type or 'inline' element type.
      ?>
      <<?php print $field->element_type; ?> class="field-content"><?php print $field->content; ?></<?php print $field->element_type; ?>>
  </<?php print $field->inline_html;?>>
<?php endforeach; ?>

how to add the div tags to the loop?


texts: What's this type of content actually called?

texts:
I think I've been getting the terminology wrong.

When I open a Panel and go to the Content region and click the gear icon, then Add Content a modal appears.

On the left of this modal are categories housing various site components - gallerys, forms, HTML, etc

What are these things collectively actually called?


texts: Lat/Long not getting imported into Geofield via feeds importer

texts:
I am working on a Drupal 7 website where I have a content type with geofield
I am importing a .csv file with lat/long (title and lat/long(geofield))

the node gets created with title, but no location coords.
How do I fix it?

Thanks


texts: How to alter number of row and label of webform Matrix Component

texts:
Using Drupal 7 webform and Webform Matrix Component in their last stable versions, I have a Matrix in a webform, this Matrix has 2 elements, first one is label, second one is textfield.

How can I alter the webform to change the number of row of this matrix, and the label of each row?

Imagine I want as many row as the number of line return by a sql request, and the label, the value of each line of this request.

Thank you very much!


texts: Have a Rules condition that will take the current time minus last comment posted time

texts:
Overall goal:  If a node has not been commented on in a given time frame, send an email.

How it could possibly be done:  Have Rules look at the last time a comment was posted when cron runs.  Then do a data comparison of that unit (current time - last comment posted time) to see if its greater than the time frame assigned to the node (ex: hours).  If so, send email.

Is this approach correct?  I am struggling to get the Rule to work if it is.


texts: How can I improve running repeating background tasks?

texts:
I ran into an issue recently, where I have a piece of code that accesses content from an external source. The content generation from this source is quite slow (3-5 seconds), but it only needs to be refreshed every 30-60 seconds.

Currently it's a bit of a Russian roulette. Every minute a user will receive a generally slower page load, while the content is refreshed and cached, and then other people will receive the cached version. Naturally, this is a headache for the users and for our apdex score.

I was trying to find a way to refresh the content in a non-obtrusive way, either automatically via scheduled action sets, or in background process when the user load the page, but I've failed with both. Normally it would not be an issue (simple enough using Elysiacron), but on Pantheon I don't think it's possible to manipulate the crontab in the fashion I require it.

Did anyone face a similar issue on Pantheon so far? Is there any solution that would solve my problem within Pantheon? Can something like this be achieved with AJAX?

I have an idea for a workaround, which would involve a third party machine requesting the part of the module that generates and caches content every 30 seconds, but that is a really ugly and inelegant way to do this.

Thanks for any input regarding this!


texts: Remove lingering configuration data in block plugin

texts:
I built a custom block plugin but after updating it there are configuration items that I no longer need. But removing the part that saves the configuration data in blockSubmit submit function doesn't actually remove the configuration data that existed before.

My original blockSubmit function was as follows

public function blockSubmit($form, FormStateInterface $form_state) {
        $this->configuration['row']       = $form_state->getValue('row');
        $this->configuration['columns']   = $form_state->getValue('columns');
}

But now I only want to store $this->configuration['columns'] like below

public function blockSubmit($form, FormStateInterface $form_state) {
        $this->configuration['columns']   = $form_state->getValue('columns');
}

Is there a way to delete the configuration data in $this->configuration['row'] ?
I don't mind it being a work around since I'm only going to be using it once. I wouldn't mind doing something like delete($this->configuration['row']); in the build function so it's removed when you visit a page that contains it.

Is there a way to remove this lingering configuration data in this block plugin?


texts: Adding a join in a Views field handler class constructor?

texts:
In a Views field handler, one can define additional fields to accompany the base field defined in hook_field_data. These field values are based on database columns on the same row, and they can be used in the render function. Somewhat like this:

my_views_field_handler extends views_handler_field {

  function construct() {
    parent::construct();
    $this->additional_fields['property2'] = 'property2';
  }

  function render($values) {
    return $this->get_value($values) . $this->get_value($values, 'property2');
  }

}

But is it also possible to define a join in the constructor? One of my database columns is an id of another entity. I have been using it somewhat like this, but this generates quite a lot of overhead (loading an entire entity for each row).

  function render($values) {
    $id = $this->get_value($values, 'property2');
    $entity = entity_load_single('my_type', $id);

    if ($entity->some_other_field == TRUE) {
      return $this->get_value($values);
    }
    else {
      return 'none';
    }
  }

So is there something like a join I can use in the constuctor, so I can query the other entity table directly instead of having to load the entity?


texts: How can I hide field labels without using any CSS style?

texts:
How can I hide field labels from Drupal (without CSS)?

function clean_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == "user_register_form") {
    $form['account']['name']['#title'] = Null;
    $form['account']['name']['#description'] = Null;
    $form['account']['name']['#attributes'] = array('placeholder' => t('Имя пользователя'));

    $form['account']['mail']['#title'] = Null;
    $form['account']['mail']['#description'] = Null;
    $form['account']['mail']['#attributes'] = array('placeholder' => t('mail'));
  }
}

I don't know how to write for password and date.


texts:
Hey,
I am new to Drupal and Commerce,
I have to develop a Commerce Payment  Gateway Plugin for a store in Drupal commerce 2.0,
We have two options either an On-site Payment or Offsite payment gateway,
Async Payment Gateway:
Create a Payment on the customer request by Payment Plugin Set the Payment Status to 'PENDING'
After the customer paid the actual amount In a Bank or  in a Portal(outside of the commerce store), Payment Gateway make Payment Status to 'PROCESSED' or 'COMPLETED'
also notifies the Payment Plugins(who originally initiated the payment).
or Simply you can say IPN[instant payment notification] supported payment gateway.
so my Question :
Which option do I choose On-site Payment or Offsite payment gateway or maybe another option available?
Note: Commerce Payment Plugin Does not need to store payment Methods or
It does not require to redirect.
it just needs to call the gateway using (WS-SOAP) service and show the payment reference number to the customer and make Payment Status pending.
The plugin also needs to process Notification and change the Status to 'COMPLETED'
so I am confused which method to use On-site Payment or Offsite payment gateway


texts: How can I prevent "Log in to post comments" from displaying for anonymous users?

texts:
How do I remove the "Log in to post comments" from the bottom of my content in Drupal 8 while keeping old comments visible to all and allowing existing registered users to still comment? Basically, I don't want anonymous users to find my login page, ever. These means no CSS hide or Javascript solutions (bots will still follow the link).
So, if comments exist on a node:
I want anonymous users to:

See the comments as usual
NOT see any sort of "add comment" link
NOT see any sort of "login/register" link either

I want authenticated users to:

See the comments as usual
See "add/reply" comment links as usual

If comments DO NOT exist on a node:
I want anonymous users to:

See NOTHING at the bottom of the node

I want authenticated users to:

See "add comment" link as usual


texts: How do I alter the URL of a primary_links menu item in drupal 6?

texts:
I have already tried doing this in theme_preprocess_page() in template.php and this works if I output the array to the browser but the menu itself remains unchanged.

I have also tried using hook_menu_alter() but again this does not change the primary links.

Where am I going wrong here?


texts: How does the Search synonyms module work?

texts: I've just activated the search synonyms module for D7, but I don't get how it works at all. Where do I set synonyms, I've tried editing forms or check the settings, but I can't find any new input where synonyms could be added. Also I could not find any documentation for the module. Probably me overlooking things but some help would be greatly appreciated.


texts: How can I use a token to display the node body summary?

texts:
I'm trying to use a token to show the body summary of a node on Drupal 7.

The Replacement Patterns area gives the following information:

Body
[node:body:?]
The main body text of the node. The following properties may be appended to the token: value (Text), summary (Summary), format (Text format)

However, I don't understand what "append" means in this context.  I tried [node:body:summary] and [node:body:?summary], but neither works.  What am I supposed to do to get the summary?


texts: How can I hide the main administration account from authenticated users? I have created a new role and created a new admin account.


texts: all modules that use the field api module

texts: Sorry if this is a basic question, is there a way to browse all modules created with the fields api. I am looking for some interesting ways to format and use fields.


texts: I created a view to replace the search default of my website. So I explained the form in a block. Everything works fine, but I would like to highlight search terms in the results.


texts:
I'm using a MODULE_preprocess_node function to modify the node template and I'm experiencing strange things.

Basically my idea was to prevent anonymous users from commenting more than once. In the preprocess function, I check if the current hostname (if anonymous) has a previously submitted comment for the current NID and if it does, I empty the comment form array.

But the problem is that, even when caching is disabled, I'm experiencing strange behavior. I'm not quite sure whether it's because of caching. I checked my db_select call and it works.

Do you have any recommendation for me to prevent this from being happening ? May be I should ask if the output of *_preprocess_* functions are cached at first place.

I do not have (core) caching enabled  and I'm planning to do so. No other modules installed yet.

Thanks in advance.


texts: "Drupal" is showing in our Google Analytics as the top browser. We're using Drupal 7 with the google_analytics module. What could cause this?


texts:
I’ve a page, called Jobpage, where I’m listing all my members within a specific content type. Then I’ve at the right sidebar a list of geographical locations which each member has entered when signing up. I want my users to filter the Jobpage but instead of getting all the members for that content type, I want only to list the members which have that specific location.

Right now I’ve tried to create the links and filter by that like so:
Normal Jobpage with all members is: www.mydomain.com/jobpage
Filtered Jobpage is: www.mydomain.com/jobpage/Dublin

I’m using Views for my Jobpage and is there any way to “filter” by creating a link URL structure as described and how do I set this up??

Any suggestion or help is very much appreciated.

Sincere
- Mestika


texts: Problem with images not displaying because domain is incorrect

texts:
I have recently installed a Drupal site on our web server and this is the default host (replaced an old website with static files). This server also hosts another virtual host for another domain name and that installation is WordPress.

On blog posts on the Drupal site (regular pages are fine), images will eventually show broken icons and when you check the URL of the image, it's replacing the domain name for the Drupal site with the domain name for the WordPress site.

Clearing the cache within Drupal immediately fixes everything, and the images reappear and with the correct URL.

An additional oddity is that the images are broken inside our network, but from the outside they will show up even though using the incorrect URL. On the inside, it resolves to the internal IP address and on the outside to the public.

I'm using Apache 2.2.22 with Drupal 7.28.

I realize it could be an Apache issue or DNS issue, but I'm checking all avenues... is there a configuration for the Drupal cache that I should be taking a look at that could be causing this problem?


texts: Access fields of node content type from event "rules_entity_insert:comment"

texts:
In Rules 8, I know how to make custom fields of a content type accessible in an event "After updating a content item (rules_entity_update:node)", that is:

Condition: Entity is of bundle
Entity: node
Type: node
Bundle: my_content_type

So that I can use something like {{node.my_custom_field.value}}.

But, when I'm in an event "After saving a new comment (rules_entity_insert:comment)", the above solution does not work. How should I do to access custom fields of the node the comment is attached to?


texts:
I'm using the following code.

function mymodule_form_alter(&$form, &$form_state, $form_id) {
  switch ($form_id) {
    case 'user_profile_form':
      $form['status_message'] = array(
        '#markup' => '',
        '#weight' => 7,
        '#prefix' => '
',
        '#suffix' => '
'
      );

      $form['validate'] = array(
        '#type' => 'submit',
        '#value' => t('validate'),
        '#ajax' => array(
        'callback' => 'example_callback',
        'wrapper' => 'status-message',
      ),
      '#limit_validation_errors' => array(),
      '#weight' => 10,
    );

    $form['#group_children']['status_message'] = 'group_settings';
    $form['#group_children']['validate'] = 'group_settings';
    break;
  }
}

function example_callback($form, &$form_state) {
  // ...

  $form['status_message']['#markup'] = '
settings saved
';
  return $form['status_message'];
}

When I click on the Validate button the first time, the callback function gets called, but when I update the values in the fields and then click again on the Validate button without reloading the page, the callback function is not called.

What is the issue with the code?


texts:
how can I create table with sticky head.
I try theme_table but it output a simple table without floating head.


texts: Error message after using Internalization

texts:
I installed Internalization module and made my website Turkish as default.
Now I receive this error message


texts: Strange log message and node not found for anonymous

texts:
I have a node found at the teaser of front-end for both admin and anonymous users. However, going to the node details page using anonymous user leads to 404 error while it works fine with admin.

The log message details is strange as shown in the following screen shot:

What is custom_404_page? I'm afraid of it is a hacking against the website.

I tried to clear all cache, I disabled XMLsitemap module. I could not able to determine where is the origin of custom_404_page.

Also in the log and after clearing it, and the trying to visit this node's details, this is the only log message available. i.e there is no other messages or warnings.


texts:
I'm adapting my bootstrap html theme to Drupal 7 and want to use some of the features of Bootstrap 3 theme.

In Bootstrap theme, there is a code for accordion menu like this:

/**
 * Implements theme_bootstrap_bare().
 */
function bootstrap_bootstrap_accordion($variables) {
  $elements = $variables['elements'];

  if (empty($variables['id'])) {
    $accordion_id = 'accordion-' . md5($elements);
  }
  else {
    $accordion_id = check_plain($variables['id']);
  }
  $output = '
';
  foreach ($elements as $id => $item) {
    $output .= '

';
    $output .= '' . check_plain($item['header']) . '
';
    $output .= '

';
    $output .= render($item['content']);
    $output .= '

';
  }
  $output .= '
';
  return $output;
}

My problem is, how can i use this code in my theme for all menus in sidebar region?


texts: I want to use this script in Omega subteheme

texts: I want to use this script in my Omega sub-theme. How do I do it?


texts: How to display permanent arrows on the left/right of a carousel when using the Flexslider module?

texts:
I'm using the Flexslider module with Views and have a nice carousel running on my Drupal site.

The problem is that the design calls for permanent arrows on the left/right and the module only shows them when you hover over the carousel.

Is there an easy way to do this?


texts: Entity Translation: Translate breadcrumb

texts:
I'm having issues translating breadcrumb.
Everything works, menu items, strings etc... a part from breadcrumb.

I've tried hook_menu_breadcrumb_alter to reset the title with no success.

How can I translate breadcrumb?


texts: Getting field labels from the $node variable

texts:
How can I get the labels of specific fields within a node, in Drupal 7?

The field for which I am interested has the following structure:

    [field_text_question1] => Array(
      [und] => Array(
        [0] => Array(
          [value] => Sales Intern
          [format] =>
          [safe_value] => Sales Intern
        )
      )
    )


texts: Why isn't local.css file used in styling a page on a site?

texts:
I have been transferring a development site to a new computer and ran into a problem when I transferred the local.css file I had been using to style my content.  While the file works fine on the old computer it is not working on the new even though the file configuration is identical.

The site is using a subtheme for Stark.  Both theme are present and enabled. The general appearance of the site is now consistent with the Stark theme.  I am using firebug to determine the css sources.  If I select a superfish menu on my site, I get css input from system and superfish.css, but not from local.css.  It is not being used at all because I can copy over a setting from superfish and change it in local without affect.  My caches are constantly being flushed so that is not the problem.

Here is the directory structure:

"example.div/themes/stark/stark.css" - used
"example.div/sites/all/libraries/superfish/superfish.css" - used
"example.div/sites/all/themes/sub_stark/css/local.css" - not used.

The sub-stark info file reads:

       name=sub stark
       description = Stark
       sub-theme base theme = stark
       core = 7.x
       engine = phptemplate

       stylesheets[all][] = css/local.css

Configuration looks good. Caches are cleared. Have I forgotten a setting somewhere?


texts:
I've created this view that displays content an author creates in a table. Trouble is, this view only appears once the author creates at least one piece of content, is there a way to show the labels by default? ie. even when there is no content in the fields?

I tried playing about with no result behaviour, but that just overrides the whole thing. I know there is a lot of info out there on how to hide fields if there is no result but i'm looking for the opposite.

Here's the table:

Here's the view:

Cheers,
Rumman


texts: Add additional element to exposed view form?

texts:
I'm trying to modify an exposed view form by adding some additional markup.  My current code looks like this:

  if ($form_id == 'views_exposed_form') {
    if ($form_state['view']->name == 'products_page') {
        // $element = array();
        $form['filter_by']['#type'] = 'item';
        $form['filter_by']['#markup'] = '
Filter by:
';
        $form['filter_by']['#weight'] = -10;
        // $form = array_merge($element, $form);
        $form['solution']['#options']['All'] = 'By Solution';
        $form['technology']['#options']['All'] = 'By Technology';
        $form['platform']['#options']['All'] = 'By Platform';
        $form['brand']['#options']['All'] = 'By Brand';
        $form['category']['#options']['All'] = 'By Solution';
    }

    dpm($form);
  }

Now I'm trying to move the 'filter_by' element to appear first, before every other element, so I attached a weight value of -10 to it.  However, the element is being added to the container that the submit button would normally be found.

I'm completely confused...  any insight?


texts: When using views to create a list of nodes, how can I eliminate the link from the node title?

texts:
I am using views to create a list of nodes. I am using the "Unformatted" style, with the "Node" row style.

This is perfect for my need except that it automatically creates a link from each node title to the node page. I would like to not have those links.

How can I most easily do this? Would the best way to be to switch to "Field" row style and simply include the fields I want, styled the way I want? Or is there a simpler way?


texts:
This thread: http://drupal.org/node/1077884 indicates we can delete our own sandbox projects, but I'm a little confused as to how this is done.

I see nothing on the UI on drupal.org that would allow this. If this is done directly with git, I would appreciate some guidance.


texts: Menu endpoint hangs when access callback returns false

texts:
I'm trying to add a custom access callback function that checks that a user is a specific user (we only want this one api user to have this specific endpoint. It is set up like so:

function my_module_menu() {
    return array(
        '/api/v1/sample/request' => array(
            'page callback' => 'sample_request',
            'access callback' => 'user_is_api_user',
            'type' => MENU_CALLBACK,
        )
    );
}

function user_is_api_user() {
    watchdog("GLOBALS", "<pre>" . print_r($GLOBALS['user'], true) . "</pre>");
    return $GLOBALS['user']->name == 'api';
}

If my custom user_is_api_user function returns FALSE, the endpoint just hangs instead of sending back a 403 Forbidden (like expected). Instead, it looks it just keeps retrying because my recent logs just repeat the error not authorized and the watchdog log I put in over and over again until I end the request.

If my custom user_is_api_user returns TRUE, it logs the user in fine. Why does it just look and not actually return 403 forbidden when my custom function return false?


texts: Firing ajax_callback on textfield after a minimum number of character

texts:
Ive created a textfield with an ajax callback with 'keyup' event.

In need the callback function to be fired only after a certain number of character ...
I can control the number of character of the input in the callback function, but this is not the way I want it...

There's maybe a javascript way to avoid the callback to be fired before 5 character ?

My form field :

        $form['myitem'] = array(
          '#type' => 'textfield',
          '#size' => 6,
          '#maxlength' => 5,
          '#default_value' => '',
          '#name' => "my_name",
          '#disabled' => FALSE ,
            '#ajax' => array(
                'callback' => 'mymodule_mycallback_ajax_callback',
                'wrapper' => "mywrapper",
                'method' => 'replace',
                'event' => 'keyup',
                'progress' => array('message' => NULL),
            ),
        );


texts: How to get the NodeID from ItemID of connect Item from Field Collection

texts:
I have a nodetype which is has a connected field collection (multiple values). In this case one of items of the collection is a date and I have got the ID of this one. So:

field_collection_item_load($did);

takes me just half the way home, since I still need some data of the node, hosting this collection, which in turn holds that item.

Illustration:

node // need that id
  + dates (Field Collection)
     + item (of item of the field collection)
       + ....
       + date // got this id
       + more fields
     + ...
     + more items

Any Ideas?


texts: Error after upgrading ecommerce kickstart is breaking my start

texts:
I'm working on someone else's project that hasn't updated its "Commerce Kickstart" (commerce_kickstart) module in a long time.  After I upgrade it using Drush, the site breaks and I'm left with the message when I navigate to the (development) website:

Fatal error: Call to undefined function commerce_info_fields() in C:\xampp\htdocs\amherstcopy\sites\all\modules\commerce_price_table\commerce_price_table.module on line 560

I googled around for the answer, but had no luck.  Anyone know how to fix this?  Thanks.


texts: Set default "Quantity" dropdown select in product. Commerce Kickstart

texts:
Using the Commerce Kickstart distribution I have a shop site listing products.
The product page shows a Quantity widget to allow the buyer to choose the product quantity to be added to the cart. (look my capture)

I need to change this widget to the standar select list html element. (look the capture)

Update: I found the library which generate this "spinner", is located at: profiles/commerce_kickstart/libraries/jquery_ui_spinner I don't see any module related to this. Maybe in theme?


texts: How can I set Focal Point coordinates in a View or Twig?

texts:
I use the Focal Point module in D8, and I'm trying to figure out how I can access the X and Y coordinates of the focal point through Twig in either a view or Twig template so I can use them as background-position coordinates.

I can't seem to find any documentation... could someone point me in the right direction?


texts: Cannot Logon to Drupal ("The website encountered an error while retrieving...")

texts:
I am trying to get a new Drupal site running on Ubuntu 12.10.  I believe I have what is either an Apache or permissions error.  I can get to the main logon page for the site, but after entering my credentials, I get the following error.

The website encountered an error while retrieving http://localhost/node?destination=node. It may be down for maintenance or configured incorrectly.

I set my permissions using the following script, and my apache setup is below that.  Can anyone tell me where else to look?

!/bin/bash

FILES="/var/www/localdrupal/cms/sites/default/files"
SETTINGS="/var/www/localdrupal/cms/sites/default/settings.php"
SITES="/var/www/localdrupal/cms/sites"
DEFAULT="/var/www/localdrupal/cms/sites/default"
THEMES="/var/www/localdrupal/cms/sites/all/themes"
MODULES="/var/www/localdrupal/cms/sites/all/modules"
DSETTINGS="/var/www/localdrupal/cms/sites/default/default.settings.php"

# Paths for binary files
TAR="/bin/tar"
RM="/bin/rm"
CHOWN="/bin/chown"
FIND="/bin/find"
CHMOD="/bin/chmod"

# Change permissions to be secure

$CHOWN -R www-data:www-data ${SITES}
$CHMOD 775 ${SITES}
$CHMOD 775 ${FILES}
$CHMOD g+w -R ${FILES}
$CHMOD 440 ${SETTINGS}
$CHMOD 440 ${DSETTINGS}
$CHMOD 755 ${DEFAULT}
$CHMOD 755 -R ${THEMES}
$CHMOD 755 -R ${MODULES}

Apache:

    DocumentRoot /var/www/localdrupal/cms
    <Directory />
            Options FollowSymLinks
            AllowOverride  None
    </Directory>

    <Directory /var/www/localdrupal/cms/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>


texts: Filter between first and last day of the current month in any year

texts:
I have a date field in my view and when I try to filter between the first and the last day of the month there is no result in my view preview.

Here is my settings. This filter is because I need to compare the born date from all the registered users and print only those who have the value between first and last day of the month.

Here are the screen shoots of my views settings:

First here is my date field settings:

Then the filter settings:

And finally set the filter option to get the result between first and last day of the month:

This is what I've tried till now without success. Can someone help me in this? I don't want to use a module for this. I only need this filter works.


texts: how to show views block that drill down hierarchical terms to nodes

texts:
I have a hierarchical taxonomy vocabulary Regions which I want to break my nodes down into 'Region > Province > City'.

I have nodes with term reference using simple hierarchical select forced to deepest level, referencing the Regions taxonomy vocabulary.

Via views I want to create a block, showing:

Region 1
Region 2
Region 3
and so on

I can only make appear City and when that is clicked it shows the nodes in that city.

What I want is a views block which shows Region (x no. of nodes), which when clicked will make corresponding page show respective Province then City

I have tried solutions here but these only seem to show terms, not the nodes.

thank you!


texts: A module for migrating data from an SQL file only into a new site?

texts:
I have an SQL file of my Drupal 7 site. I want to migrate data only from it's SQL file (and afterwards all it's images manually) to a fresh, minimally-installed Drupal site that already has all the needed modules for the update.

Is there a module that could load all the SQL data --- All the nodes\views\image paths\Redirects from the SQL directly?

Thanks!


texts: View filter to include title and body text

texts:
I created an exposed view filter so that users can search for words in the body of a node type but I would like the search to also look for words in the title without having a separate search box for titles. Can this easily be done?

See code for exported view.


texts: Block being rendered twice on a views page

texts:
I have created a view page '/searcher' which displays indexed results from search_api_solr queries - ajax is enabled for this view.  I have also created a custom block which will be used to display some information at the top of this page.

Issue: It appears when this page renders the block callback is being executed twice.  I have shared the code below - 'hello world' is dpm()'d twice. I have tried other custom blocks from other custom modules, and it is doing the same thing. Anyone experienced something similar? Cheers

function my_module_block_info() {
  $blocks['date_range'] = array(
    'info' => t('Date Range - Top of Gant Chart'),
    'cache' => DRUPAL_NO_CACHE, // default
  );
  $blocks['another_block'] = array(
    'info' => t('Assemble the Crew'),
    'cache' => DRUPAL_NO_CACHE, // default
  );

  return $blocks;
}

function my_module_block_view($delta = '') {
  $block = array();
  switch ($delta) {
    case 'date_range':
      $block['subject'] = t('');
      $block['content'] = my_module_date_range();
    break;

    case 'another_block':
      $block['subject'] = t('');
      $block['content'] = my_module_second_block_test();
    break;

  }
  return $block;
}

function my_module_date_range() {
  dpm('hello world');
}


texts: How do I get rid of a table doesn't exist warning?

texts:
I have a Drupal 6 installation for my website, and over time, without any doing on my part, I started getting an error, below:

  user warning: Table 'pharmtec_pharmtechinc.xmlsitemap' doesn't exist
  query: SELECT * FROM xmlsitemap WHERE type = 'node' AND id IS NULL in
  /home/pharmtec/public_html/sites/all/modules/xmlsitemap/xmlsitemap.module
  on line 544.

I have no clue what the issue is.  I did find out, though, that it does come up for both existing and new pages.

I'm stuck because I can't update the content of the site.  When I add information and preview, it shows all the source code for the entire page, rather than just the text.  :(

Thanks for any help you can provide.


texts:
Using Drupal7, I am logged in as administrator, and I am getting an empty content list, even if  there are many nodes created by the administrator user before this.

Even if I add nodes as administrator, the list is still empty.

Here is the content view configuration's screen

Why does this happen? How can I fix it?


texts: Allow comments only for the author of the node

texts:
I'm using Drupal 8 for a personal project and I'd like to allow only the node author to post comments.

Can you please help? I'm stuck.


texts: TinyMCE - Drupal 7 - Insert images not functioning

texts:
I'm having trouble inserting images via TinyMCE  (I've also installed WYSIWYG). I can insert images into an article just fine and all looks as it should while I'm editing an article, but if I preview or save the article and then view it, the image doesn't show up, instead I see:

[img]/sites/default/files/myimage.png[/img]

I've tried making the content with full html, and I've installed the media module and selected an option under text formats that is supposed to convert media tags into html.

What am I missing?


texts:
Here is my sitemap structure from my custom sitemap module in which 4 of my menus are displaying. But there are duplicate menu items under Products and About.  I dont need MECHANICS, INDUSTRIAL and SPORTS under About.

How can I remove these menu items, or restrict a specific menu item to display (or not) on the sitemap page?


texts: Image Upload Issues Same Image Different File Name Always Receive This Error

texts:
We are currently working on fine tuning and updating the dev backend of our CMS we're rolling out for a new site.

I was familiarizing myself with the new system and uploaded some images in error.
I then deleted said images using module Reports > Audit Files > Managed not Used.
Once I removed the file another user tried to upload the same file with a different name and we keep getting this error.
We've removed the file from the Database and the  file server but still get the below error every time.

New to Drupal 8 and this forum... If you have solution or work around please let me know.


texts: Shared hosting - force mail return envelope

texts:
I hope I'm on the right site, because it's a crossover between drupal and server configuration...

I am currently using shared hosting for a website and am encountering mail problems while sending mails from the website (drupal CMS). The problem is I only host the website, the mail server is located with another host causing the mails to their own domain to be dropped.

Basically I have example.com and I'm trying to send an email to john.doe@example.com from drupal. To avoid having the mail dropped and to avoid changes on the example.com mailserver side I would prefer to send mails from website2.com which is hosted on the same server.

According to my host I should use the "-f" option of the PHP mail() function to force my website.com e-mailaddress, but I cannot believe this is required since this is not supported by the Drupal core. I cannot be the only one in this scenario, yet I do not find any solution. Can somebody point me in the right direction ?

Technical information:

Running Installatron
Shared hosting with two domains: example.com and website2.com
External mailserver, dns is managed by other host.


texts: How to display Rate module widget by php

texts:
I'm using the Page Manager (Panel) to customize the node layout, and the Rate module to rate them.

How to print the rating widget of the current node using php ?

I've tried to use this code but no result.

<?php  print rate_embed($node, 'page_rating', RATE_FULL);  ?>


texts: How to change widget's icons in the service-links module?

texts:
I am using the Service links module in Drupal 7.

I tried to change the icons of the links, but only the "general services" links are changed. The "widget services" staying like the original. I saw that is because the icon is coming from an URL and not from a picture on the computer.

How can I change the widget icon?

Is there a patch or an option on the module?


texts: What is the difference between using hook_views_pre_render() or preprocess functions?

texts:
What is the difference in using hook_views_pre_render(&$view) instead of using
[THEME_NAME]_preprocess_views_view_table_[VIEW_NAME] . I am just changing the '#markup' of field.
hook_views_pre_render() is being used in custom module and
[THEME_NAME]_preprocess_views_view_table_[VIEW_NAME] is used in template.php file ?


texts: Is it possible to use JS maps (Openlayers/Leaflet) in a slideshows (Views Slideshow/Flexslider)?

texts:
I have attempted to create a slideshow using Views Slideshow and Flexslider in Views, the content to be used includes a map displaying a track. The problem is that no map tiles or other layers are displayed, this is true for both Openlayers and Leaflet formatters.

As this content displays correctly using a List View but not a Slideshow View and it is a problem with two separate JS mapping libraries I am wondering if it has to do with how slideshows offset their content and then manipulate their positioning during operation that the mapping libraries can't deal with.

I am currently happy with the overhead using JS mapping in this instance instead of using a static image. Is it possible to use content of this type in a slideshow?


texts: How to read data from nodes and display in this complex table?

texts:
I have some nodes in my site

Day         Color   Type    Value
01-01-2018  blue    A       4
02-01-2018  yellow  B       3
02-01-2018  orange  C       2
03-01-2018  red     B       8

I need to show this data in the following way (NOT USING VIEWS):

Does anyone knows if it's possible using the table theme in Drupal?
I don't think it's possible to have the double header either.

Is there any other way to achieve this?


texts: Is it possible to record user agent information on node creation?

texts:
I have a custom content type, Picture, which has only a single required image field.  Since this field is required, I thought that it should be impossible for users to save a node without uploading a file, but every once in awhile there is a node created that has no file uploaded.

Users have permission to create nodes of type Picture but not to edit them.

To try to troubleshoot this problem, I would like to record the user agent information (browser, etc.) of users when they create nodes of this content type.  Is there a "standard" way to go about this?

I'm on Drupal 7 if it matters.


texts: Hook into other module's field formatter?

texts:
Am currently trying to implement a node referenced image field on my Drupal 7 site that will change it's 'view mode' depending on programmatical logic just before render. The field is currently being rendered on a number of content types via their display mode settings, each of which are using the field formatter 'Rendered node'.

first attempt

My first idea was to implement the following, considering a hook is a hook is a hook:

function HOOK_field_formatter_view( $entity_type, $entity, $field ... ){
  switch ($display['type']) {
    case 'node_reference_node':
      /* Programatical logic here to modfy field render settings */
    break;
  }
}

Obviously exchanging HOOK for my module's name.

It didn't really matter if the above would fire before or after the original function node_reference_field_formatter_view in node_reference.module because I would either override it's output entirely or, hopefully, modify its values before rendering. The only problem is, the above hook seems to function only on a per module basis — i.e. it's not site-wide, so basically it doesn't fire for my module.

Now obviously I can write my own field formatter to output a rendered node. But it seems a bit of a waste considering there is already one that exists.

other approaches

My other approaches have been to HOOK_preprocess_node and HOOK_preprocess_field but the former doesn't contain any view_mode information, and the latter contains at least 5 different complicated structures that all have references to a view_mode property at different levels — and it feels rather hacky to have to modify each of their values. Even when I've changed certain view_mode properties the resulting image doesn't change.

question

Does anyone know of a clean way to step in before a field formatter renders (of a contrib module) and change it's settings on a per page request basis — i.e. by not having to change the actual content type's permanent view mode settings?


texts:
I've been trying to figure our how to get a term ID of a taxonomy term I created, and I found a little bit of php that looks like it should work. However I have no idea where to put it to get a response.

I'm working on a D6 site that needed updating and already found this script

$term = taxonomy_get_term($tid);
$name = $term->name;

Any pointers?


texts: Is there a suggested approach to altering the field schema for already populated fields?

texts:
I specifically wish to solve this problem http://drupal.org/node/1514826#comment-5866494.

Currently the fivestar module's field schema looks like this:

<?php
 function fivestar_field_schema() {
  return array(
    'columns' => array(
      'rating' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'sortable' => TRUE,
      ),
      'target' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
    ),
  );
}
?>

I would like to change it to:

<?php
 function fivestar_field_schema() {
  return array(
    'columns' => array(
      'rating' => array(
        'type' => 'float', // Change to float from int
        'unsigned' => TRUE,
        'not null' => FALSE,
        'sortable' => TRUE,
      ),
      'target' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
    ),
  );
}
?>

This would work for new Fivestar fields. However, those that contain data cannot be updated. Since the field storage can be in SQL or Mongo or Solr, I would like to create a generic update to this. However, the most commonly used sql storage does not allow column changes if it has data (see field_sql_storage_field_storage_update_field()).

Is there a suggested way out? Thanks.


texts: how should I add textfield ie jump pagination in views mini pagination of drupal

texts:
I have created views of gallery by view. View has provided pagination option. I choose mini pager.

I want to implement Jump Pagination here. How should I add in view pagination?


texts: How to switch back and logout of masquerade user back to admin?

texts: I've setup masquerade module and switched to a regular user, but my switch back to admin block doesn't show up in the main theme and the user has no access to the admin theme. Is there a link I can use to switch myself back to admin?


texts: How do you link a view into a listing dropdown menu?

texts:
here are some screenshots i created a new sort view and i have tried to add it to the field collection list and then selected it in the page with the drop down and it does not display the view. Am i doing this right? I am using D7 and the

I am using the nodequeue module

https://imgur.com/a/qj3Tt


texts:
I'm running FreeBSD 10 with PHP5.3.28

I can't use the port or package to install Drush because it will install the default PHP (5.4) as a dependency.  So I installed Drush manually.
Then when I invoked Drush it said:

  Can't find PHP

So I added this to csh.cshrc: setenv DRUSH_PHP /usr/local/bin/php

After reboot I now get this:

  Could not open input file: @pear_directory@/drush/drush.php

I don't have PEAR on my system and trying to install it also means it will install PHP5.4.  I was able to install Composer manually but I'm afraid it too will install PHP5.4 as a dependency for Drush.

Any ideas?

Note: php -i works.


texts:
I just spin a test Drupal7 site and having some issue w/ getting boost module to work(

$ cat /etc/redhat-release
Scientific Linux release 6.4 (Carbon)
$ uname -a
Linux XXX.XXXXX.XXX 2.6.32-358.23.2.el6.x86_64 #1 SMP Wed Oct 16 11:13:47 CDT 2013 x86_64 x86_64 x86_64 GNU/Linux
$ rpm -q drupal7 php php-pecl-apc
drupal7-7.23-3.el6.noarch
php-5.3.3-23.el6_4.x86_64
php-pecl-apc-3.1.9-2.el6.x86_64
$ drush -r /usr/share/drupal7/ -l alexustest pm-list | grep '(boost)'
Performance and scalability  Boost (boost)                                  Module  Enabled        7.x-1.0-beta2
$

this is what I get via "Boost: Pages cache status" block:

  File: cache/normal/alexustest/_.html

  Generated: not cached yet (either no one has visited the page
  recently, or something is preventing the cache from being generated).

I'm not sure what I am doing wrong. Can someone help me?


texts: How to maintain a Drupal project on GitHub

texts:
I maintain several modules on drupal.org. Having spent years doing things "the drupal way" (remember CVS?) I'd like to make my life a bit easier and use GitHub.

While there may be political reasons this could be undesirable, are there any technical reasons? I imagine one-way syncing could be as simple as a cron job that does a fast-forward push from a github repo to the corresponding drupal.org repo.

Is that all there is to it? Are there existing tools to facilitate this?


texts: Drupal views get field info from node within another field

texts:
I'm attempting to create a view which will show Photo Galleries that have a reference to a project. The project has a reference to a category. It is on the category page I want to show these galleries.

So I am on the category page, and would like to show the latest galleries posted within the projects in this category.

When creating the view for photo galleries I can display the project field, so I know what project they are in. However the category field is within the project node, so how can I find out what category the project has referenced?

I need to look at the node referenced in the project field, then take the category field from that to determine if it is associated to the current category. Is this possible within the fields module or should I look at something else?

Hopefully this question makes sense, if not please ask questions or edit the question. Thanks!

Edit: This is using Drupal 7 and I assume views 3.


texts: Sorting view results by the number of matched arguments (contextual filters)

texts:
I have nodes with tags on them. I also have a view of nodes with a contextual filter that can take multiple tags. I have it set to get nodes that match any, rather than all.

So imagine I have three nodes, Lorem, Ipsum, and Dolor. They have the following tags:

Lorem: foo, bar, baz
Ipsum: foo, bar
Dolor: foo

When the contextual filter "foo" is passed, of course all three come up. When "foo" and "bar" are both passed, all three also come up. Currently, they come up in no particular order, so passing "foo" and "bar" might give me this (depending on my other filters):

Dolor
Lorem
Ipsum

I want to sort by number of matched items, so passing "foo" and "bar" will bring them up in the order Lorem, Ipsum, Dolor or possibly Ipsum, Lorem, Dolor, but never with Dolor first. And if I pass all three terms I'd expect to see the only the order Lorem, Ipsum, Dolor.

This seems like a common thing to need, and yet searching has not yielded a ready-made solution. How would one go about implementing this with Views 3 in Drupal 7?


texts: Menu theming is not being applied as expected

texts:
this is a bit of a backwards question, in that "not being applied as expected" means "I expected it to break, and it didn't". However, I'd like to know WHY I'm seeing the behaviour that I do.

I'm generating a path-specific site submenu, as detailed in this question. Briefly, I'm rendering the main menu exactly how it is in the default page.tpl.php:

<?php print theme('links__system_main_menu', array('links' => $main_menu, 'attributes' => array('id' => 'main-menu', 'class' => array('links', 'inline', 'clearfix')))); ?>

... but the submenu is custom-built (see function in linked question) and rendered via:

print drupal_render($page_submenu);

I need to adjust the HTML output for my submenu, and have added the following to my theme's template.php:

function mytheme_menu_tree($variables){
  return '
' . $variables['tree'] . '
';
}
function mytheme_menu_link($variables) {
  $element = $variables['element'];
  $output = l($element['#title'], $element['#href'], $element['#localized_options']);
  return '
' . $output . "
\n";
}

This does have the required effect on my submenu HTML output. However, it doesn't adjust anything in the main menu HTML output. Even though I don't want it to, I'd like to know why those two functions haven't affected it, because I was kinda expecting them to.


texts:
I've just set up an installation of Sendy (http://sendy.co) - it uses Amazon's SES infrastructure to send out emails at really cheap rates.

It all works well and I'm trying to integrate it into Drupal Rules such that a new user is automatically added to an email list.

I've set up a new Rule:
After saving a new user account > Execute custom PHP code

and then added this code:

$your_installation_url = 'http://my-site.com'; //The domain in question
$list = '1234'; //A string which relates to an email list

//POST variables
$names = '[account:name]';
$emails = '[account:mail]';
$name = $_POST['$names'];
$email = $_POST['$emails'];
$boolean = 'true';

//Check fields
if($name=='' || $email=='')
{
    echo 'Please fill in all fields.';
    exit;
}

//Subscribe
$postdata = http_build_query(
    array(
    'name' => $name,
    'email' => $email,
    'list' => $list,
    'boolean' => 'true'
    )
);
$opts = array('http' => array('method'  => 'POST', 'header'  => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata));
$context  = stream_context_create($opts);
$result = file_get_contents($your_installation_url.'/subscribe', false, $context);

//CHECK RESULT
if($result) echo true;
else echo false;

This code (minus the Drupal Tokens) works perfectly as a standalone PHP file - however the above code in Rules fails to do anything.

I was hoping that someone might spot an obvious slip up here - perhaps the tokens are incorrect or incorrectly used. I'm trying to capture the newly created user's Username and email address and POST them to the $results URL.

Thanks in advance.


texts: What do you set in the "column" field for adding a minimum words validation via the Field Validation module?

texts:
I'm creating a validation rule on a text field via the Field Validation module. On the create screen it asks for "Column" and includes this description:

  A column defined in the hook_field_schema() of this field.

I do not understand what I need to enter here. Can anyone explain?


texts: Where is saved the value of the 'help text' of field of content type?

texts:
I know that you can set help text for any field in the content type, but where this text is saved in databese, because I want to access it in other way not only for tooltip?

Thanks


texts: What is the difference between the config and the settings directories?

texts:
I can see a folder named config in Drupal 8 core modules which contains sub directories like optional, schema and install.

I can see it is like a settings folder which is initialised during module installation. But how do they differ from each other?


texts: How do I change the caption style in Flexslider?  I know how to change what the caption text, but I don't know how to change the size, font style, color, etc.  I've been pulling my hair out trying to get this to work today.  I've changed everything around it, through the flexslider.css file, but not the actual text.


texts: Display Author Pane in view (with Display Suite View Mode)

texts:
I'm new to Drupal, but I couldn't find an answer for my problem in any other thread.

I've installed and configured Author Pane and I'm able to see it in places like a node page or advanced forum topic.

Now I'm creating a View that returns a list of nodes, and configured one of its Display Suite view modes for displaying each result (this view mode includes the Author Pane block for that content type).

The list of nodes is displayed OK, but the Author Pane is not being shown. The section of the view mode layout where the Author Pane should be displayed is empty.

I've already tried making a relationship with Author and setting the Author:name as one of the view's fields (I've read sth like that in some other posts), but nothing changed. It's like Author Pane cannot find any user context information.

Can someone help me with this issue ?

As a (maybe) related issue, I have another view that ends up in a block, which should also display the Author pane. This block appears at the bottom of a node page, which also has Author Pane configured. In that view block, Author Pane is actually being display for each results but always with the information of the user of the page's node! So, every secondary node related with the primary node displays the same Author information as the primary node, instead of its own author's information. I think both issues are related. There is some problem with Author Pane trying to get user information from views.

Thanks everybody in advance!


texts:
I have made neat comment link for anonymous users http://example.com/modal_forms/nojs/login?destination=http://example.com/comment/reply/NID#comment-form
However when I click it then the #comment-form is missing and it's very inconvenient because have to scroll to the comment form, how to fix it?

Here's the code responsible for opening login links in modal window:

Drupal.behaviors.initModalFormsLogin = function (context) {
  $("a[href*='/user/login'], a[href*='?q=user/login']", context).each(function () {
    this.href = this.href.replace(/user\/login/, 'modal_forms/nojs/login');
  }).addClass('init-modal-forms-login ctools-use-modal ctools-modal-modal-popup-small');
};


texts:
I am using simple views custom field handler. And I would like to make list of custom tokens for this $data array I have. How could I do that?

class custom_views_handler_field_hostname extends views_handler_field {

  function render($value) {

     $location = get_some_data_from_outside;

     foreach ($location as $key => $value) {
      $data [] =  $key. ': ' . $value;
    }

    if (!is_array($value)) {
      return theme('item_list',
          array(
            'items' => $data,
            'title' => NULL,
            'type' => 'ul'
          ));
    }
  }


texts: How to reveal the admin password when logged in with one time login link?

texts: I just started on a project and there is a prod and dev server. I have access to the dev server and I'm able to do a force login via 'drush uli admin' but I do not have access to the prod server to do the same thing. Is there a way to reveal the admin password on the dev drupal when logged in as admin?


texts: How to get language specific path in twig?

texts:
In a twig template you are able to get a relative path by using {{ path('entity.node.edit_form', {'node': nid }) }}. The path will be in current language.

Now I need to get the path in a specfic language. I thought I could use {{ path('entity.node.edit_form', {'node': nid }, {'language': langcode}) }} but this results an error if I set langcode to a string like DE. According to the api docs language has to be a language object. How can I accomplish this in twig?


texts: Is the Admin role different than a role with all permissions enabled?

texts:
Is the default Admin role inherently different than other roles? Does Drupal extend privileges to the Admin role that are not configurable/available to other roles?

To be clear, I am not referring to user/1 on the site, but rather the official Administrator role as has been assigned here: admin/config/people/accounts.

Here's why I'm asking:

I've been having trouble with a Data Export View where a non-Admin user runs the export and the resulting output is incomplete. When running the export logged in as an Admin, the resulting output is complete.

I spent some time futzing with the permissions of the non-Admin role with no good results. So, as an experiment, I made a new role and enabled every permission… which, presumable would make this role equivalent to the Admin role. I logged in as a user with that new role, ran the data export, and still got the same incomplete dataset. What gives?

As a bonus question: any idea why is my Data Export view outputting incomplete data for the non-Admin roles?


texts: Webform [submission:values]: field name and value inverted

texts:
Recently,  [submission:values] inverts my field name and the value like this:

TestName Name

0600000000 Phone number

Do you know how to display correctly my submission with [submission:values] ?

To have this instead:

Name TestName

Phone number 0600000000

Thank you.


texts:
I would like to use FTP to copy my current site to a new server. I obviously know that the bulk of my files will be stored in /var/www/ and the folders inside. I also exported my databases from phpMyAdmin to a localhost.sql file.

Is there any other place I need to pull files from? Is that it for the database?


texts: I get the following error message while updating a Drupal site

texts:
I keep getting this error when I try to update Drupal. I have no clue what it means; it seems I have a missing column.

  PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'base.access_exposed' in 'field list':
  SELECT base.id AS id, base.name AS name, base.label AS label, base.plugin AS plugin, base.active AS active, base.weight AS weight, base.status AS status, base.dirty AS dirty, base.module AS module, base.access_exposed AS access_exposed, base.data AS data FROM {rules_config} base WHERE (base.status IN (:db_condition_placeholder_0, :db_condition_placeholder_1, :db_condition_placeholder_2)) ; Array ( [:db_condition_placeholder_0] => 3 [:db_condition_placeholder_1] => 2 [:db_condition_placeholder_2] => 6 ) in EntityAPIController->query() (line 152 of /opt/readyby21.org/public_html/sites/all/modules/contrib/entity/includes/entity.controller.inc).


texts: Redirect to anchor after form validation in Drupal 6

texts:
I am trying to redirect user to anchor of error form field after form validation.

I have such form and:

$form['#validate'] = 'my_form_validate';

Then, in validation function, if the form has some error message I am trying to scroll to error field:

function my_form_validate() {
    ...
    $form_state['redirect'] = 'node/'.$form['nid']['#value'].'#'.$error_field_anchor;
    ...
}

But my form is not redirecting after validation.

I have tried  another paths such as: user/1, node/123 without anchor but form is not getting redirected to that one.


texts: Problem with token when unchecked "Enable signatures" and "Enable user pictures"

texts:
How when i want unchecked "Enable signatures" and "Enable user pictures" show those errors:

 The Body is using the following invalid tokens: [sito: login-url].
 The Body is using the following invalid tokens: [sito: login-url].
 The Body is using the following invalid tokens: [sito: login-url].
 The Body is using the following invalid tokens: [site: url-breve].

??


texts:
I am using the simpledialog module with the 'edit' tab still in it. The edit overlay for the node is displayed in the background with the simpledialog still in the way.

I have tried a bunch of ways of attaching the close call to the edit button and triggering a click on the dialog close button. None of it very successfully - all iframes. e.g.

$htj2('.tabs.primary').delegate('click', 'a', function() {
    $hjt2('#simple-dialog-container').dialog("close");

I think the 'correct drupal pattern' is to attach a behavior to the form load using drupal behaviors.

(function ($) {
    Drupal.bahaviors.hotTopicsResearch = {
        attach: function(context, settings) {
            // ?? What next?
            $('#hot-topic-research-node-form',context).once('load', function() {

            });
        }
    }
})(jQuery);

How do I find out what the behaviours are? How do I attach to the load event or is there an event related to clicking on the 'edit' tab? How do I get close the simpledialog?


texts: How to get access all images of custom directory in twig template?

texts:
I intend to create a slideshow in front page of my theme to show all images in custom directory, I try to use file_scan_directory and drupal_get_path in below codes to get any non static images path and display that images automatically without any need to calling each one of them separately:
Theme Name.theme:

function MyThemeName_preprocess_page(&$variables) {
$mask = '/\.(?:jp[e]?g|gif|png)$/i';
$files = file_scan_directory(drupal_get_path('theme', 'Theme Name') . '/assets/img/orbit', $mask);
ksort($files);
$variables['files'] = $files;
}

page.html.twig:

{% for file in files %}
<img src="{{ file.uri }}" width="100%" height="100%" alt="{{ file.name }}"/>
{% endfor %}

I would be happy to hear what is the problem with the codes and what is the right way to load that slideshowe pictures?


texts: How to expose the quantity of list items to an action?

texts:
Put another way.

Using a loop, how do I pass the number of items in a list to an action outside the loop?

I have created a loop and within the loop I have added an action to calculate a data value as follows

Data selector: 'loop_name:quantity'

Calculation: *1 = calculation_result

From within the loop I can access the new variable 'calculation_result' however I can not figure out how to expose the calculation result to other data selectors.

What steps am I missing?


texts: How to set different default images in an image field per domain?

texts: I'm working on a set of similar websites (promoting products of different regions) separated by Domain Access module. I'd like to set different default image in an image field in each site. Is it possible?


texts:
I'm trying to add a tweet button to my node.tpl.php in Drupal 6 - https://dev.twitter.com/docs/tweet-button.

I literally place the html+javascript within node.tpl like so:

Tweet
<

The result is a flickering button every time I refresh, so I'm thinking the javascript is loading incorrectly?

Ideally, I'd like to load the javascript within page.tpl.php, and ensure that it applies to node.tpl, but it doesn't appear to be working. I've also tried loading it using drupal_add_js within template.php various preprocessor methods.

I rather not use any of the social media modules - such as AddToAny, ShareThis, or ServiceLinks - partly because I feel this should be cut and dry w/o module dependency.

So I guess my question is - what is the best way to load that twitter javascript code within node.tpl to avoid the flickering button?


texts: Is there a way to make views_pre_build fire only once?

texts: In Drupal 7, I am trying to set an ajax view's current_page when it first displays, which I can do, but of course it will always go to that page regardless of the input from the pager. The goal is simply to have the view jump to the last item when first displayed.


texts: How do I render my date field using my custom date format?

texts:
I have a content type with two "date and time" fields, configured to display in "22 November 2012 5:19pm" format:

On the item itself, the start and end dates are both set to include times:

In my node.tpl.php, I output the two fields:
print drupal_render(field_view_field('node', $node, 'field_date'));
print drupal_render(field_view_field('node', $node, 'field_end_datetime'));

However, the two fields are displayed without the time:

Start Date and Time: 02 December 2012
End Date and Time: 02 December 2012

How do I output these two fields using my custom date format?


texts: How do I set a Boolean field with "yes" and "no" values?

texts: I have a content type, I'm trying to add a field that's a boolean. I want the options to be yes or no. This is something I thought would be relatively simple however, I keep getting an error message. I've attached 2 screenshots. 1 is the configuration for my boolean. The other is the error message my site gets. Can someone help me. What am I doing wrong?


texts: How to set an error message with Javascript?

texts:
I was wondering how to set an error message from js to Drupal ?
something like

<?php
    drupal_set_message('mplampla);
?>

but in Drupal object in js

jQuery(document).ready (function(){
    Drupal.setErrorMessage('mplampla');
})

is this even possible?


texts: How to get list of activated and deactivated module using some script from database?

texts: How to show list of activated and deactivated module using some script from database?


texts: View with paged output - how to alter number of pages?

texts:
I use Views 7.x-3.8.
I have view "taxonomy_term". It has Paged output, full pager. Number of pages (the total number of pages) is set to 100, Items per page = 10.
Now I want to show all pages for users with proper permission.

I tried to set pager option 'total_pages' to empty string in hook_views_pre_execute():

function MYMODULE_views_pre_execute(&$view) {
  if ($view->name == 'taxonomy_term') {
    if (user_access('view all pages')) {
      $view->query->pager->options['total_pages'] = '';
    }
  }
}

It actually works with pager: users with permission 'view all pages' can view page #101, #102 and so on, but nodes on these pages (more than #100) are the same as on page #100. It means that query has not changed, and query limit is still 1000 (10 items x 100 pages).
I tried

$view->query->set_limit(0);

in hook_views_pre_execute() and

$view->query->set_limit(0);
$query->set_limit(0);

in hook_views_query_alter(), but it's not working.

I also tried to set $view->query->offset and $view->offset manually:

$view->query->offset = $view->offset = $view->query->pager->current_page * $view->query->limit;

with no effect.

What am I missing? How to change number of view' total pages AND query results programmatically?


texts:
Is there any way I can split a region into 2 different regions. For example, in Garland theme I want to split the HIGHLIGHT block region horizontally into two regions..
is it possible ?

Any help would be so much appreciate.


texts: Taxonomy inline with several category types?

texts:
Is it possible for D7 to display several taxonomy fields inline with some separator between them? I want to have a node with 2 category types, say, a song with a Year and a Singer. Now the taxonomy displays in a column:

Year: 1999
Singer: Britney Spears

And I want it to appear inline with some separator:

Year: 1999 |separator| Singer: Britney Spears

I've found a similar question but it deals with displaying one multivalued taxonomy field. That's not quite what I want. So where should I look and what I should override to display several types of taxonomy fields inline?

Update: after spending 2 days on that I've done it using node.tpl.php and field.tpl.php. It's always better to print your separators outright. Relying on CSS is good but not when there are guys using IE6 out there (I've seen one as late as 2011). Not that I did the best solution ever here (I'm lousy with the code) but still it works and at least does what I want it to do. I did the following:

1) copied node.tpl.php from modules\node to sites\all\themes\mytheme.
2) used $content variable to find all taxonomy fields:

$taxonomy_field_names = array();
$all_field_names = array_keys($content);
foreach($all_field_names as $i => $value)
{
    $field_name = $all_field_names[$i];
    $field_type_name = '#field_type';

    //if content contains an array with $field_name and it is an array itself
    //and has an item #field_type of taxonomy_term_reference
    //it is a taxonomy field
    if(is_array($content[$field_name]) &&
        array_key_exists($field_type_name, $content[$field_name]) &&
        $content[$field_name][$field_type_name] == 'taxonomy_term_reference')
    {
        $taxonomy_field_names[] = $all_field_names[$i];
    }
} unset($i);

3) hid them to prevent rendering:

//hiding taxonomy fields
$count_taxonomy_fields = count($taxonomy_field_names);
for($i = 0; $i < $count_taxonomy_fields; $i++)
{
    hide($content[$taxonomy_field_names[$i]]);
}

4) after rendering $content I rendered taxonomy fields:

//rendering taxonomy fields
for($i = 0; $i < $count_taxonomy_fields; $i++)
{
    //printing a separator after each of the fields except the very last
    if($i < $count_taxonomy_fields - 1)
    {
        $content[$taxonomy_field_names[$i]]['#separator'] = '&bull;';
    }
    print render($content[$taxonomy_field_names[$i]]);
}

5) copied field.tpl.php from modules\field to sites\all\themes\mytheme and renamed it field--taxonomy-term-reference.tpl.php (affects all ). After setting $content[$taxonomy_field_names[$i]]['#separator'] at the previous step one can use it as $element['#separator'] in field--taxonomy-term-reference.tpl.php:

<?php if (isset($element['#separator'])): ?>
<?php print $element['#separator']?>
<?php endif; ?>

6) added the following lines to sites\all\themes\mytheme\css\fields.css:

.field-type-taxonomy-term-reference .field-item {
   float:left;
}

To people who answered my question I offer my sincere thanks.


texts: Drupal 8 Link Autocomplete Filter by Bundle

texts: Does anyone know how to limit the autocomplete suggestions of Link Fields to only certain bundles -- not globally, but per Link Field instance? I nearly found a solution in customizing https://github.com/minnur/Alter-Entity-Autocomplete , but this is global for all autocompletes, and I need to get the calling Link Field instance somehow.


texts: What may cause Undefined index in drupal_retrieve_form when uploading an image?

texts:
I have a developed custom plugin in my Drupal 7.54 site for panels where user can upload image. It works locally, however when I trigger same functionality on production nothing happens and I see in logs following errors.

Notice: Undefined index: hero_block_search_box_edit_form in drupal_retrieve_form() (line 807 of /Users/dpa/Sites/e1/includes/form.inc).
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'hero_block_search_box_edit_form' not found or invalid function name in drupal_retrieve_form() (line 842 of
/Users/dpa/Sites/e1/includes/form.inc).
Notice: Undefined index: content in file_ajax_upload() (line 271 of /Users/dpa/Sites/e1/modules/file/file.module).
Notice: Undefined index: #suffix in file_ajax_upload() (line 280 of /Users/dpa/Sites/econ-websites/econ1/modules/file/file.module).
Notice: Undefined index: #prefix in file_ajax_upload() (line 283 of /Users/dpa/Sites/econ-websites/econ1/modules/file/file.module).

I read about similar issues in google any many people say it could be related to permissions (and it has sense, since locally everything works but not on production side).

Would anybody give me a hint where to look?


texts: How to add subtitle for menu items in Nice menu in Drupal 7

texts: I'm using nice menu in my durpal-7 site.I need to show a subtitle for each menu item.How can this be done ? I'm new to drupal so it would be great if you could help me.


texts:
Requirements:~

Android app post json data to a certain url.
Drupal can  receive the json data and then verify the json data and return result data in json format.

My question is on receive Json data and return Json data steps. What module or api can I use?

It would be greater help if you can share a sample.


texts: Why are there several branches at the official documentation (e.g. 8.0.x, 8.1.x)?

texts:
Why are there several branches (e.g. 8.0.x, 8.1.x) at the official documentation?

Is it planned that sub versions of Drupal 8 will be developed independently?

If yes, then what's the point?
If no, then why are these branches mentioned in the documentation?


texts: How to programmatically add a link to an image field in a view

texts:
I have a view with an image field and other fields, and I need to link the rendered image, not the content which is one of the configuration choice, but on another computed filtered view.
I think that I should use my_theme_preprocess_views_view_field_myviewname to catch this field, using it's name as selector then wrap it with the computed link, but didn't find how to do it.

To clarify my question, the image in this view is normally displayed, and I "dynamically" create a link to another view which is not related to the image. I wrote a function (in my template) to compute this link, and I need to know how to add this link to the image field within my_theme_preprocess_views_view_field_myviewname(&vars).
The preprocess function is executed several times to build the view, I tried to use var_dump(vars) to see where is the image field, but it generates a too huge amount of data.


texts: Loading dependencies from the vendor directory in a module using composer

texts:
I am using composer for managing dependencies in my drupal module. I specified my dependency in the composer.json file placed in my module's root directory. After running the composer install comand it installs all the dependencies correctly; however, the autoloading does not seem to work.

I have checked several threads here that deal with the problem and found that most of them suggest using the composer manager module that's available even though on the module's page on drupal.org it says that it's deprecated due to Drupal's improved use of composer since version 8.1

Here's my composer.json file in my module's root diretory:

{
"name": "activit/facebook_ratings",
"description": "Display a feed of your Facebook fanpage's ratings on your website.",
"type": "drupal-module",
"require": {
    "facebook/graph-sdk": "^5.4"
},
"license": "MIT",
"authors": [
    {
        "name": "Robert Balasko",
        "email": "rbalasko@activit.sk"
    }
]
}

and a factory class in the root of src directory that tries to load a class from the graph-sdk.

<?php namespace Drupal\facebook_ratings;

use Drupal\Core\Logger\LoggerChannelFactoryInterface;
use Facebook\Facebook;

class FacebookConnectorFactory {

  private $logger_factory;

  public function __construct(LoggerChannelFactoryInterface $logger_factory) {
    $this->logger_factory = $logger_factory;
  }

  public function getFacebookService($app_id, $app_secret) {
    if (!$app_id || !$app_secret) {
      $this->logger_factory
        ->get('facebook_ratings')
        ->error('Undefined App ID or App secret');

      return FALSE;
    }

    return new Facebook([
      'app_id' => $app_id,
      'app_secret' => $app_secret,
      'default_graph_version' => 'v2.6',
    ]);
  }

}

The result is a class not found error when I run my code. Shouldn't the dependency be autoloaded or am I doing anything wrong?

Thanks a lot.


texts: Errors to Display: None - Settings won't save

texts:
I've got my site developed and I'm preparing it for production. There are some errant warnings that appear every once in awhile (I've checked them, they aren't actually a problem, just something dumb in one of the php libraries I'm using). I'd like to hide all warnings and errors on the production site.

I, as an administrator, go to /admin/config/development/logging and I change Errors to Display to None, then I click Save. It says my changes have been saved, but the option is still set to "All Messages" and the errors and warnings are still showing on my site.

What's wrong? Why can't I change this setting?

I'm logged in as user 1, with administrator permissions, but I can't change this setting. Can you help me?


texts: Disable Elysia Cron task programmatically

texts:
I have a custom module where I create several cron tasks using HOOK_cronapi.
This is done when the user visits a page and has a form to create those tasks.

I also need that the user can disable those tasks but I can't find anything in the elysia cron documentation on how to disable a cron job.

After it is created I can't disable it programmatically? (I can do it via GUI)

Thanks.


texts: How do I get the node type label from a node object?

texts:
I'm trying to get the bundle label (node type label) of the node from a node object in Drupal 8.

This works, but seems long-winded:

$node_type = \Drupal::entityManager()->getStorage('node_type')->load($node->getType())->get('name');

Is there another way to get the bundle label, possible in a less complicated way?


texts: moving a drupal website to another server

texts:
I've been working on a drupal website in a server for months but after moving it to another server and url some of the files are not read. for example it seems that it does not read colors.css or all of the image files used in the site.

for more clarification I must add that there is a joomla site on www.example.com then I've put my drupal site on  www.example.com/test this is the site which does not work properly.

and before that it had been working on www.something.com/test/test1.

I don't have a clue why it has happend! help


texts: How to define jQuery in libraries for avoiding conflict with theme with library?

texts:
For use of most frameworks (Zurb Foundation, Bootstrap, etc) or libraries (Like Owl carousel, Slick, etc) within a theme, jQuery has to be added as a library.

Is it enough to add jQuery only once as dependencies in a global library and have it load on every page (imagine that I add this library in Library section of ThemeName.info.yml) Or would I have to add it as dependencies each time I define a new library again?

For example, is the below structure correct:

global:
  css:
      # The path to the css file.
      assets/css/stylesheets-1.css: {}
      assets/css/stylesheets-2.css: {}
  js:
    assets/js/myglobal.js: {}
  dependencies:
    - core/jquery

library-A: # Bootstrap Library.
  css:
      assets/css/stylesheets-3.css: {}
      assets/css/stylesheets-4.css: {}
  js:
    assets/js/myglobal.js: {}
  dependencies:
    - core/jquery

library-B: # Owl carousel Library.
  css:
      assets/css/stylesheets-5.css: {}
      assets/css/stylesheets-6.css {}
  dependencies:
    - core/jquery

Is there any problem If I add jQuery once as library in js: category and again as dependencies: in one library like library-C simultaneously? Something like below? Can it cause the conflict?

library-C:
  css:
      assets/css/stylesheets-c-1.css: {}
      assets/css/stylesheets-c-2.css: {}
  js:
    assets/js/myglobal.js: {}
    assets/js/jQuery.js: {}
  dependencies:
    - core/jquery


texts: Load login / register block in custom template

texts:
I've created my own homepage template [page--front.html.twig] and want to add the drupal default login and register form. I was looking for something like

{% include 'themes/bootstrap/templates/block--system-login.html.twig' %}

But it looks like none of these kind of blocks exist.

If I go to user/login and take a look into the source code (with devel enabled) I also do not see any block hint:

<div class="region region-content">

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'block' -->
<!-- FILE NAME SUGGESTIONS:
   * block--flowers-content.html.twig
   * block--system-main-block.html.twig
   x block--system.html.twig
   * block.html.twig
-->
<!-- BEGIN OUTPUT from 'themes/bootstrap/templates/block--system.html.twig' -->

<!-- THEME DEBUG -->
<!-- THEME HOOK: 'form' -->
<!-- BEGIN OUTPUT from 'core/modules/system/templates/form.html.twig' -->
<form class="user-login-form" data-drupal-selector="user-login-form" action="/user/login" method="post" id="user-login-form" accept-charset="UTF-8">

How can I add the login and register form in my (homepage)-Template? I did not find any useful information related to Drupal 8.

Any help is much appreciated. Thanks!


texts:
I have created 2 image-fields in my content type image-main and image-hover.
The image-main is an album display and when you hover the album cover it must change to the image-hover.

How can I get this working.


texts: How to send author an email after they post content?

texts:
When I user saves a piece of "my_custom_content_type" I want to send the user an email, basically "your content has been submitted, will be published after review"
I know this is a core feature for webforms, but what is the best way to accomplish this for Custom Content Types?


texts:
button_submit:
   '#prefix': '
text<button>button text</button>'
   '#suffix': '
'
   '#value': Send
   '#type': submit

I have the code above in YAML form. When I edit the code, I see the button tag; when rendering, only the following markup is left.

ALGOasd
<input id="edit-button-submit" class="button js-form-submit form-submit" type="submit" value="Send" name="op" data-drupal-selector="edit-button-submit">

It´s clear that I have some filter, but I can't find it out. I also tried putting a <button> in a container item, but the same thing happens.

Why does this happen? How can I fix it?


texts: Twig: How to access multiple values from node reference field with number_format

texts:
I'm adding fields to array:

{% for item in content.field_notes | field_target_entity %}
   {% set field_component_pages = item.field_component_pages|view|number_format %}
{% endfor %}

In my scenario the value of item.field_component_pages|view is equal "16", but when I convert it to number with number_format I get value of 1.

I presume the item.field_component_pages|view is not a real value. How can I access field field_component_pages correctly in this case?


texts: Getting the source URL of image in Media Gallery Module

texts:
I need one more thing to get my custom lightbox running in the Media Gallery module for Drupal 7.

The link that is clicked which leads to a custom page which contains the image is at this moment the following:

l($image, $link_path, array('html' => TRUE, 'attributes' => $attributes)) : $image;

The thing is that I want to link directly to the image, and not to a page where the image is on! I know that this is hard to understand so I'll try to clarify. At this moment, when you click the link you will be directed to something like this:
/media-gallery/detail/xxx/xxxxx

But I want it to link to the image itself (e.g. /files/folder.1.JPG) and I can't seem to find where the image is transformed into a page on itself. Does anyone have ANY idea? I would be soooo grateful!

Thanks a lot you guys.
EDIT: I have found that the generated link can be edited by the following snippet of code in colorbox-display.js:

var $ = jQuery, $galleries, $gallery, href, $links, $link, $dummyLinksPre, $dummyLinksPost, i, j;
    // Add a colorbox group for each media gallery field on the page.
    $galleries = $('.field-name-media-gallery-media');
    for (i = 0; i < $galleries.length; i++) {
      $gallery = $($galleries[i]);
      $links = $('a.sbEnabled', $gallery);
      $dummyLinksPre = $gallery.parent().find('ul:has(a.shadowbox-supplemental-link.pre)');
      $dummyLinksPost = $gallery.parent().find('ul:has(a.shadowbox-supplemental-link.post)');
      $dummyLinksPost.appendTo($gallery);
      $links = $links.add('a', $dummyLinksPre).add('a', $dummyLinksPost);
      $links.attr('rel', 'shadowbox-' + i);
      for (j = 0; j < $links.length; j++) {
        // Change the link href to point to the lightbox version of the media.
        $link = $($links[j]);
        href = $link.attr('href');
        $link.attr('href', href.replace(/\/detail\/([0-9]+)\/([0-9]+)/, '/lightbox/$1/$2'));
      }
}

Unfortunately this doesn't bother to work.