texts:
I am attempting to create a subtheme using showcase_lite as a base theme. For now there will be mostly just CSS alterations in the subtheme.

To start, I created just an .info.yml file to start with:

name: My Subtheme
type: theme
description: 'Subtheme for testing'
core: 8.x
base theme: showcase_lite

Most inheritance works fine (CSS / JS / Twig), but it seems that the preprocess functions in the base .theme file are not called anymore. I am talking about _preprocess_html() for example.

Is this expected behaviour? If so, how could I have these be called from my own theme, without copypasting them all?


texts:
i am new to drupal i want to make custom page with form , i googled and was able to built custom form using guide at Link

but i need form as part of my page content not just form so basically i need custom page with form ,please guide me with this .

Have i to recode it or can use buildForm at certain place in my html, please help me with suitable link or guide


texts:
When I save a menu link pointing to a node (nid 5, alias /woohoo/magic/test, it's value in the database is: entity:node/5
I'm trying to convert fully formed user inputs such as "http://127.0.0.1:42080/woohoo/magic/test" to the path stored in menu in the databse.
I've tried the following:
$local_path = url::fromUserInput($possibly_local_path);

// $local_path->getRouteName() returns "entity.node.canonical"
// $local_path->toString() returns "/woohoo/magic/test"
// $local_path->getInternalPath() returns "node/5"

Please note I can't just do string concatenations. I don't always know that the path is to an entity, such as when I am using group module group content entities.
Any ideas?


texts:
I'm building a multilingual site with 4 different languages, using panels and panelizer, but am struggling to see how to have different panels for different languages.

The site has to be content-manageable by the client, so I need to provide panels that can be translated by them.

I've tried 2 routes - first of all using the i18n_panels submodule in panels. The readme.txt file suggests that I can create a custom pane which can be translated, which would be great, but it isn't very clear how to do this. The example doesn't work.

I've also tried adding a pane for each language and using visibility rules based on the node language. This doesn't work either.

Does anyone have an example of a custom pane that is multilingual using i18n_panels, or another way of achieving the same effect?


texts: Does the language filter show all languages by default?

texts:
I'm looking at a Drupal 6 site with the following modules installed, all of which I think are contributing to translation:

Internationalization
Locale
Content Translation

As I am not experienced with site translation I'm not sure which module is contributing to this, but the "Language Switcher" block shows both English and French for all content, regardless of the language choice assigned in the node, or if there are any translations present.

It is claimed that previously, if there was only an English translation for the node, then only English would be available from the language switcher block. However, if I add a new node, with just an English translation, I can still select French, which, because there is no translated node, takes the user to the internal node path, e.g. instead of:

/en/mycontent/foo

it would be

/fr/node/232

which of course, breaks contexts and what-not.

So what module does the language switcher block get provided by in this case and should it always show both languages?


texts:
In the following website, I want to change the string from "Add to bag" to "Add to cart." I am using Drupal 6 and Ubercart.

How could I change it?


texts: Change Add to cart button text in Drupal 7

texts:
I am using Drupal 7 and Ubercart 3. I want to change the text for the button "Add to cart", how can I achieve this?

Any help, thanks.


texts: After wrong submit redirects to wrong url

texts:
I have my form on page at url alias http://mypage.com/services.
After wrong submission, form redirects me to http://mypage.com/services/formname - and every field is unordered, because Drupal doesn't read there template for this page.
I want to after wrong submit drupal redirect me to same page, and list fields names that are required (and aren't filled).

Changing form options (eg. custom url) doesn't work too. It concerns only the case when all required fields are submitted.


texts: Display different menu links based on page/theme

texts:
I have a custom main theme for my website along with a Blog theme using themeswitcher. All content in my /blog directory uses the Blog theme.

Question:
I would like to display different links in the main menu when users are on my blog theme vs. main website theme. If I choose to display the Primary Menu in my blog theme all of my main website links show up. Are there any menu Modules that allow enable/disable links based on directory and/or pages?

I there an easy way to do this?


texts: How do I get a user profile's picture from entity_metadata_wrapper()?

texts:
I am using entity_metadata_wrapper() for getting values from the user profile.

This is my code:

$user_wrapper = entity_metadata_wrapper('user', $uid);
$user_name = $user_wrapper->name->value();

How do I get the user picture field from $user_wrapper?


texts: how to upload an image of product in drupal commerce

texts:
I would like to upload an image of product in drupal commerce programmatically while creating a product, Here is my code for create product, but drupal return error said

Call to a member function set() on a non-object in <b>C:\xampp\htdocs\mySite\sites\all\modules\api\mymodule.inc

any suggestion is greatly appreciated.

Thanks

mymodule.inc

$wrapper = entity_metadata_wrapper('commerce_product', commerce_product_new('product'));
$properties = entity_get_property_info('commerce_product');

$wrapper->title = $title;
$wrapper->sku = $sku;
$wrapper->commerce_price->amount = $price;    // Price in minors units 500 = 5$
$wrapper->commerce_price->currency_code = 'MMK';
$wrapper->cmp_store = 2;
//$wrapper->field_category = 137;
$wrapper->field_product_color = 106;

$file_path = file_save_data(file_get_contents('C:\\Users\\ASUSS\\Desktop\\Nexus_5_(1).jpg'), 'public://products/Nexus_5_(2).jpg');
$wrapper->field_product_image->file->set($file_path);

try{
    $wrapper->save();
    $result = "success!" ;
}catch(Exception $ex){
    $result = "not success! -> ". $ex;
}


texts:
There is a Drupal 8 RenderElement called HtmlTag, which controls how HtmlTags are rendered. I would like to override this so that I can change its default behaviour.

I could write a class that extends HtmlTag and override what I need, but then how would Drupal core and the theme system know to use my new class?

Alternatively, maybe I should be using hook_theme_registry_alter() to tell Drupal 8 to use my new class?

I'm not really sure of the best way of achieving this and there don't seem to be any examples of this being done.


texts: Can't click link added to header of a block

texts:
In Drupal 7 I created a views page, and I want users to have the option to view the results either as a list, or with thumbnails (like on a lot of websites). The only way I can think of doing that is creating one page with the results as a list, and having a link to another page with the results that have thumbnails.

But my question is, how do I add just a random link to the top of my block page that will direct users to the 'thumbnail' page?

I tried to use 'unfiltered text' in the header and put the html for a link in there, and when I went to the page it looked like a link, but I couldn't click it. Any suggestions?


texts: I'm loading a webform on a Ajax modal dialog. The form submission is also set to Ajax. I want to alter the Ajax submit callback so I can have more control over the form behaviour. I'm not being able to do that. The callback being executed is always submitAjaxForm, set on the WebformAjaxFormTrait trait.


texts: what is the use of the migrate module UI in drupal 7

texts:
Guys do i still have to code object oriented coding when i use the migrate module in drupal 7? like this one example here.

http://miss-hana.com/migrate-contents-from-drupal-6-to-drupal-7-using-migrate-2/

if so, then what's the use of the UI for migrate module provided in drupal 7? i cant post a screenshot of the UI i nee 10 reputation for that. But it is in the 3rd tab in the content page.

if i still have to code, anyone can guide me to a very good tutorial or video on how to code this step by step. Because im not into object-oriented programming. :(


texts: CKEditor oEmbed Plugin Shows up in config but not in actual Editor instance

texts:
The issue I'm having is very similar to this question, but the solutions here did not work for me.

The steps I took:

Downloaded the latest version of the oEmbed plugin from https://ckeditor.com/cke4/addon/oembed.
I extracted the oembed directory from the archive and placed that in a custom Drupal module that I already had. This module was used to create simple CKEditor button plugins and worked fine with them.
I went to the configuration page for basic_html and full_html editors and saw that the oEmbed button was one of the new options (/admin/config/content/formats/manage/basic_html).
I moved the oEmbed button to the "Active Toolbar" as well as some other custom plugins.
I went to edit some content where the WYSIWYG would show up
The other custom buttons showed up, but the oEmbed one did not, despite the fact that I could see it on the config page.

I've tried an older version of the oEmbed plugin from the download page, as well as clearing my cache many times with drush cr, but still no luck getting it to show up.

What's weird is that when I load the node edit page with the Chrome console open, I can see that the Javascript/CSS for the oEmbed plugin is loading and executing. The button icon though is never requested.

The Drupal Plugin looks like this

namespace Drupal\custom_ckeditor\Plugin\CKEditorPlugin;

/**
 * Defines the OEmbed plugin, with CKEditor.
 *
 * @CKEditorPlugin(
 *     id = "oembed",
 *     label = @Translation("OEmbed Plugin")
 * )
 */
class OEmbed extends extends PluginBase implements CKEditorPluginInterface, CKEditorPluginButtonsInterface
{
    protected $pluginName = 'oembed';

    public function getButtons()
    {
        $iconImage = $this->getIconPath();
        return [
            'OEmbed' => [
                'label' => t('Insert OEmbed'),
                'image' => $iconImage,
            ]
        ];
    }

    // Other required functions such as getLibraries() and getDependencies() all return an empty array or false and are omitted from this example.

}

I'm using Drupal 8, with CKEditor v4.7.2.


texts: Set "Use the administration theme when editing or creating content" to true in install profile

texts:
I am creating an installation profile, and I can succesfully download and enable my custom theme as default. The issue I am running into is the "Use the administration theme when editing or creating content" setting is disabled on a fresh install, and I always want that enabled.

How do I enable the "Use the administration theme when editing or creating content" setting in my install profile?
What is the easiest way to find out how to configure settings like this in the future? The install profile documentation does not give any info on this, and I can't find anything in the API.

Update: I've found this API article api document to be helpful in figuring out which fields to target.


texts: Articles listed in order base upon "Last-edit Date" instead of "Publishing Date"

texts:
I have to solve a small bug in a Drupal 7.31 installation.

I have 3 rows in homepage, in which are listed 3 articles for each of them. Here a partial screenshot of Edit View for the first row, in wich Sort criteria is set to "Publishing Date".

In "Auto preview" pane, in the bottom area of this page, sorting seems corresponding to "Publishing Date" (node IDs are respectevely: "node-1901", "node-1861", "node-1904"), while when I load Homepage in browser, order is "node-1861", "node-1901", "node-1904".

It seems that in a case, order is made by "Last-edit Date" and not "Publishing Date".

How to make them coherent and, most important, how to display articles in Homepage in "Publishing Date" order ignoring "Last-edit Date"?


texts:
I need to prevent users from posting comments based on some conditions but I can't find any hooks I can implement.

For nodes we have hook_node_access() but apparently there is no hook_comment_access()

Any ideas on how I can implement this?

I have tried something like this but apparently it doesn't work:

function my_module_entity_info(&$entity_info) {
  $entity_info["comment"]["access callback"] = "my_module_comment_access_callback";
}

function my_module_comment_access_callback($op, $comment){
  // some custom logic and return false...
  //...
  return comment_access($op, $comment);
}

My form is a custom form, displayed on multiple pages. I would like to prevent access to the comment entity and not to the form or page.


texts: Exclude nodes referenced from another content type's node

texts:
I have two content type:

Content type A
Content type B

In content type B I have one reference field which referencing Content type A.
Now I want to build a list of Content type A, which is not reference yet (from content type B).
I was did it in drupal 7 by RELATIONSHIPS (referencing field_name), and FILTER CRITERIA (NID Is Null /(empty)
But in drupal 8 its not working, I search everywhere but didn't able to solve this issue. So I am here for your help.
Thank you so much.


texts: How to group fields in the form without grouping them in the node view?

texts:
My issue is that using the field_group module will create field groups for the form and the node view. And I don't want to group fields for viewing, I just want to make the form neater.

Here's a failed attempt (seems to ignore the values from body and title fields): https://gist.github.com/9651054


texts: Reference current user when creating a content type

texts:
I am creating a new content type and one of the fields I d like to add owner.

I ve chosen reference - user as the field type
Type of item to reference = user

How do I make the default value the name of the current user?

Many Thanks


texts: How to get fullcalendar month view showing event ranges that start before the current month?

texts:
I'm doing some stuff with fullcalendar that is basically working, with ajax, to show a collection of events in a month-view calendar.  Everything is working, except for events that start outside the month on display.  That is, if I have an event that runs from February 15 to April 15, it will only show up in the February view -- it will not show up on either the March or April views.

I'm starting to hack around in the fullcalendar code to see how I might address this, but it's pretty slow going.  FWIW, I've tried flipping the "lazy fetching" option in the view's view's options, but without luck.  Has anybody run into this before; any insights about how to fix it?  Thanks!


texts: How to allow only certain users access to certain fields of a node?

texts:
I have product information on my site. Only some users can view pricing for certain suppliers. So each product has a supplier field, which is a node entity reference to an instance of a "supplier" content type.

When User A logs in, who only has access to Products Offered by Supplier B, he must only see the "cost price" of items that he is linked to. This link is currently accomplished using a Profile Field, which is private and set by administrators.

What is the best way to now restricting users based on this relationship. The end result would be that certain users see the full node with the cost price, while others will see everything except the cost price.

How can I get this right?


texts: Off-site payment method from the terminal

texts:
Just wondering if it is possible to setup an off-site payment from the terminal. I've already created a custom module for a custom offsite payment method for standard user checkout process. I also need to add this option to the terminal so it can be used by Admins when creating an order in the backend

Is that doable?

Just to note, I'm a Drupal beginner so I may have missed something obvious.


texts: Using Entity reference + Views to create members select list

texts:
How can  I use VIEWS + ENTITY REFERENCE to get list of active members specific to the CURRENT GROUP [created via organic groups].

I have created a view that list active members belonging to the group.

I have seen Restricting selectable entities with Views

But my question is, that is it possible with entity reference too ?

If yes how can I achieve this case ?


texts: Is it good practice to override simple db_query or EntityFieldQuery with a View

texts: I am using several autocomplete fields in a form. To retrieve the data, I have used db_query for very simple queries, EntityFieldQuery for more complex, until I found one that is somehow convoluted, so I used a View and views_get_view_result to retrieve the list of suggested terms. Is it a good practice or am I consuming too many resources instead of digging a little more in my code?


texts: Automatic entityform creation after user registers with rules

texts:
I would like to create a draft entityform for every entityform type after a user registers, I've been trying to attempt to create a list of entityforms in rules but can't work out how.

This is needed so that a list of entityforms can be displayed to the user with the percentage complete next to the entityform using views. The problem is that if the user hasn't attempted any then the list is empty rather than just displaying the entityform type and then 0% complete.

In rules I've tried to create a component that returns a list of entityform types so that I can loop over the list create a form and then save it but I just can't find a way to get the entity types into a list. This can be done manually with a rule for each but that would mean that each time I add a new entityform I would have to create a new rule.


texts: What is easiest way to debug variables in nodes, views, blocks and page twig templates?

texts:
What is easiest way to debug variables in nodes,views,blocks and page template.

Earlier we used devel module in drupal 7 ,by using dpm() function it shows very neat and clean structure ,it was so easy to find out the values of variables.

Also what is the easiest way to get protected variables values.

why debugging became so complex in drupal 8?


texts:
I am doing an ajax form submit,

Issue #1 : I am facing problem while submitting the form,
The form have a submit and a validate function. In the validate function it is checking whether the username entered is 'King Kong', If it is then it will then it will show an error message. After changing the name to a different one, the error message is still showing up.
Also on submit I am displaying a sample text below the form.

Issue #2 : When I submit the form I am getting the form that is filled with the values i have entered in the previous form submit.
I have got this link(Form API : display the same form again with AJAX, but with different values, on submit) regarding the Issue #2 ,but no luck, If some one could direct me the right way, I would be really great full.

Here is my code.

function app_form($node) {
  $form['form']['#prefix'] = '
';
  $form['form']['item'] = array(
    '#title' => t('Item'),
    '#type' => 'textfield',
    '#description' => t('Enter an item.'),
    '#required' => TRUE,
  );
  $form['form']['submit'] = array(
    '#type' => 'submit',
    '#ajax' => array(
    'callback' => 'app_form_submit',
    'wrapper' => 'wrapper',
    'effect' => 'fade',
    'name' => 'submit',
  ),
    '#suffix' => '
Something can be inserted after this

After Command Status: Unknown
',
    '#value' => t('Submit'),
  );
  $form['form']['#suffix'] = '
';
  return $form;
}

/**
 * Custom function for submit.
 */
function app_form_submit($form, $form_state) {
  ctools_include('object-cache');
  if (!form_get_errors()) {
    $new_values[] = array(
      'item' => $form_state['values']['item'],
    );
    $selector = '#after_div';
    $commands = array();
    $commands[] = ajax_command_after($selector, "$new_values");
    $commands[] = ajax_command_replace("#after_status",
      "

      Updated after_command_example " . date('r') . "

"
    );
    return array('#type' => 'ajax', '#commands' => $commands);
 }
 elseif (form_get_errors()) {
   $element = $form['form'];
   return $element;
 }
}
/**
 * Validate the form.
 */
 function app_form_validate($form, &$form_state) {
   if ($form_state['values']['user_name'] == 'King Kong') {
     form_set_error('user_name',
     t('King Kong is not allowed to use this form.'));
   }
 }


texts: Background Images Paths are Changed when CSS Aggregation is On

texts:
I have a Drupal 7 site with and Adaptives Themes subtheme enabled and set as default. I was recreating the Drupal 6 site in Drupal 7 on a subdomain and have recently transferred it over. My site has worked any problems until I turned on the aggregator for the CSS and JS files.

When my CSS files are compressed, the background images paths are not only absolute, background-image: url(images/relative_to_CSS_file.png) => background-image: url(/subdomain/sites/all/themes/theme_name/css/images/relative_to_CSS_file.png), it adds the subdomain in the path. Instead, I would like to just remove the subdomain.

I have flushed the caches a few times, but this problem persists. How do I update these files?


texts: Not able to assign value to field using form_alter hook

texts:
I have a add entity form. On which I want show some fields pre-populated from other entity. I wrote form_alter hook and pre populate fields....
But for one field it wont work. It populate the data in text box but when user change that data and click on save it saves pre populated data not the changed or updated one.

Scenario 1:
"field_summary_introduction" this is a text area and code used to prepopulate data is
$form['field_summary_introduction']['und'][0]['#value'] = $arrDefaultEntityData['field_summary_introduction']['und'][0]['value'];

This is working fine and if user update the data it stores updated data

Scenario 2:
"field_company_subtitle" this is text field and following code is not working

$form['field_company_subtitle']['und'][0]['#value'] = $arrDefaultEntityData['field_company_subtitle']['und'][0]['value'];

Instead if I use following code then it prepopulate data

$form['field_company_subtitle']['und'][0]['value']['#value'] = $arrDefaultEntityData['field_company_subtitle']['und'][0]['value'];

But not able to store updated data it stores prepopulated data....
All fields in my form taking populated data to save in db. If user update the populated data it saves old populated data in database.
Thanks in advance


texts: How do I modify the output of iframes generated by Media oEmbed module?

texts:
I'm trying to add a title attribute to all iframes outputted by the D7 media_oembed module with Youtube videos, but can't find the write entry point for it. There aren't any templates with the raw structure to override.

Can someone point me to the right place please?


texts: Is there a way to modify the behavior of taxonomy_term_uri() in a custom module for D7? I am not able to do so by definining THEME_term_uri(), and I wouldn't like to alter the original Taxonomy module.


texts: How do I add a span "wrapper" to all required form fields?

texts:
In the current Drupal configuration required fields simply display an asterisk wrapped in span of class "form-required":

return '*

This isn't really suitable and I have noticed quite a few users miss the asterisk (poor visibility, etc.). To combat this I would like to apply much better styling / hinting to all elements of a required field (label, value, background, etc.).

How do I add a span wrapper to al required fields on the form?

  Label

  ....

I presume I need to use hook_form_alter() but not sure what I need to check or how to output the original field data correctly/safely.


texts: unsetting field via view hooks no effect on aggregation results

texts:
I have created a view, with some aggregation parameters.

I expected that unsetting (removing) the aggregation field via some view hook (views_pre_render?) would do the trick to disable the aggregation caused by this field.

But it just removes the field from the table, the results are the same (aggregated by the unsetted field, even if it is removed).

some ideas? thanks


texts: Context module not displaying block on panels' taxonomy page

texts:
I am overriding a taxonomy term page with panels and I need context (module) to display a block for the taxonomy term.
When I use the default taxonomy Page (no override), the context is active, but when I override it with Page manager the context isn't active and the block doesn't show up.
I achieve the same setup with node types for og and it worked without an issue.
Any help on what I am missing out with the taxonomy page setup?


texts: Base field provided by a module is not accessable

texts:
this is a follow up to my question here.
In my .module file I use the following code to add a base field to all my nodes:

/**
 * Implements hook_form_BASE_FORM_ID_alter() for node_form().
 */
function seo_fields_form_node_form_alter(&$form, FormStateInterface $form_state) {
  $form['seo_fields'] = array(
    '#type' => 'details',
    '#title' => t('Metadata for SEO'),
    '#open' => FALSE,
    '#group' => 'advanced',
    '#weight' => 110,
  );

  $form['seo_description']['#group'] = 'seo_fields';
}

/**
 * Implements hook_entity_base_field_info().
 */

function seo_fields_entity_base_field_info(EntityTypeInterface $entity_type) {
  if ($entity_type->id() == 'node') {
    $fields = array();

    $fields['seo_description'] = BaseFieldDefinition::create('string_long')
          ->setName('seo_description')
          ->setLabel(t('SEO description for this entity'))
          ->setDescription(t('If not present, the module will try to create it from entity body.'))
          ->setDefaultValue('')
          ->setSetting('case_sensitive', TRUE)
          ->setDisplayOptions('view', array(
            'label' => 'hidden',
            'type' => 'string',
            'weight' => -4,
          ))
          ->setDisplayOptions('form', array(
            'type' => 'string_textarea',
            'weight' => 1,
            'settings' => array(
              'rows' => 4,
            ),
          ));

    return $fields;
  }
}

After running update.php the field is created without any error, I am able to edit it in the node form and it saves values to the database, but once I try to access it's value (in templates or preprocess functions / through EntityInterface) I always get an empty string. Even the node form shows an empty field after input and saving (even though the value clearly exists in the DB).
Any help?


texts: How can I update "no results" text in Search as a content manager?

texts: I want to customize the "no results" search page, but I do not have access to any of the server files. I only have general "administrator" access. Thanks.


texts: How do I display only nested form elements in modal

texts:
i'm currently working on a custom field/widget.

For a better ux i want to display some nested elements in a modal dialog.
The elements are generated during form submission (multistep widget) i added a custom ajax callback like this: (For better understanding i reduced the code)

public static function myAjaxCallback(array $form, FormStateInterface $form_state) {
    $response = new AjaxResponse();

    $form['#attached']['library'][] = 'core/drupal.dialog.ajax';
    $response->setAttachments($form['#attached']);

      $button = $form_state->getTriggeringElement();
      $element = NestedArray::getValue($form, array_slice($button['#array_parents'], 0, -3));

      $response->addCommand(
        new OpenModalDialogCommand('Only a few sub elements', $element, [])
      );

      return $response;
}

The problem in this function is the elements are, obviously, rendered without a form around and so they can't get submitted.

Which would be the correct way to display only some nested elements in an ajax dialog?

Best regards
Michael


texts: What are the possible exploits if settings.php is writable?

texts:
I have recently had to set up Drupal on shared hosting using suPHP. This is a first for me, an install where all the files are writable by the user by default. All the Drupal documentation and the Drupal built in status report will warn you of the folly of having your settings.php writable by the web server process.

Option 1:
I can log into the shell and secure the settings.php by making it read-only to my own account (and the webserver account which is running as me).

Option 2:
I can log into the shell and make all the files and folders read only to my own account (and the webserver account which is running as me) which may have to be changed every time I want to install a module etc. This will be kind of a pain to maintain.

My question is: Is there a significant difference in the security risk between the two options? What are the specific exploits that are possible due to having the settings file writable by the webserver process vs. the other core files?


texts: How to add an alias filter to the media view?

texts:
I have a path alias for my media content provided by pathauto. The media view at 'admin/content/media' shows all the content. I am able to add filter for the media entity name, type, language and other fields but I cannot add a filter for the URL alias.
I was able to add the field 'link to entity' which shows the correct URL (alias). Then I added a exposed combined filter that uses the media link field. However as soon as I try I get an error "col not found" in the view.


texts: How to have new fields show with default content on new items?

texts:
For example:

I created a content type with 2 fields, the default values are:

Field 1 = A
Field 2 = B

When creating BRAND new content items, the fields show up on display with populated default data:

A
B

But when editing content that was created BEFORE creating the fields it doesn't work.

Is it normal that the default fields will only work on NEW content items?

I want to be able to add fields to items


texts: How to specify image paths for Commerce feeds imports on xampp?

texts:
Been banging around with Commerce feeds and think I've wrapped my head around it. One thing which has been flummoxing is how to provide the path in the CSV file to the image(s) on my xampp install.

I put the folder in xampp/htdocs/drupal/sites/default/files/poster_pics/XXX_image.jpg

Do I provide the path to the root of the site? (IE htdocs/drupal/etc?) or do I provide the entire path to the file on the local machine? (IE C:/xampp/htdocs/drupal/ rest of the path? or something more elaborate like

file:///C:/xampp/htdocs/drupal/sites/default/files/poster_pics/ANON0060.jpg

Many thanks in advance.


texts: How can I ensure that fields from a Views query plugin work as tokens?

texts:
I have a Drupal 7 Views query plugin module that pulls in data from a RESTful API for use in Views. I used this series of articles as a starting point to build it: https://www.lullabot.com/articles/building-views-query-plugins. I now need to port it to Drupal 8.

I have made a start on the porting process, with the help of this series of articles: https://www.lullabot.com/articles/building-views-query-plugins-dupal-8-part-1. The Drupal 8 module now successfully pulls in data for the fields that use the 'standard' handler.

I'm currently stuck on trying to get tokens representing one of those fields to work when rewriting results.

The field is called access-url and contains URLs. If I tick 'Override the output of this field with custom text' on that field, and enter the token form, {{ access-url }}, it just returns '0' for every record, whereas if I untick that box it returns the URLs correctly. Meanwhile, the token form of the id field works correctly.

(In real life I will want to use {{ access-url }} under 'Output this field as a custom link', but 'Override the output of this field with custom text' illustrates the problem better.)

How can I get the {{ access-url }} token to work correctly?

I expect it would be helpful if I posted some code, but I'm not sure what code would be most helpful, so please let me know.

Additional debugging info: as far as I can tell, all seems well until it gets to the line in PluginBase::viewsTokenReplace() that runs $this->getRenderer()->renderPlain($build). $build at that point has the value of access-url in it, but the renderer returns zero.


texts: difference between real click and jQuery click

texts:
I create a new subject which is the next of this one.

I have a form on drupal.

There is a function to create it : commerce_checkout_account_pane_checkout_form

There is a function to validate it : commerce_checkout_account_pane_checkout_form_validate

There is a function to submit it : commerce_checkout_account_pane_checkout_form_submit

Everything work with Firefox, but not with Chrome or IE.

If I do a real click on the submit button, I go to the validate function.
If I use jQuery to trigger click on the submit button, I can see ajax gif but my page is reloaded and there was no passage into validate function ( I use drupal_debug to log passage ).

How it is possible there is a difference, in two case there is a click on the submit button ?

All day on this problem, I really need to fix it quickly.


texts: For "parent" node, how do I show list of child nodes related by child field of type "Entity Reference"?

texts:
CONTEXT:  Let's say I have a one-to-many relationship between parent "companies" and child "contacts".  Each is its own content type.  The contacts content type has a field of type Entity Reference that can be used to associate a child Contact node to a parent Company.

QUESTION:  How, when I am on the display of an individual Company node, can I see a list of related contacts right beneath the Company node fields?

Essentially this functionality would be like a "related list" in Salesforce.

Surely there is a module or modules that enable this without having to resort to code?

I've seen the Views Field View module.  It looks promising.  The Panels module looks promising but apparently it is not just for use on its own; it just enables other modules.


texts: How can I convert a node title to a lowercase string with hyphens?

texts:
I need to convert the title of a node, for example, from this

  John Doe

to

  john-doe

Is there Drupal function for it? (Easier to use than using preg_preplace etc.)


texts: Bootstrap theme - add or remove classes in $navbar_classes

texts:
I'm using the bootstrap theme, by default in page.tpl.php the nav bar is outputted like so:

<header id="navbar" role="banner" class="<?php print $navbar_classes; ?>">

Where can I edit the $navbar_classes variable called in the header tag so I can add or remove classes?


texts: Site branding block wont appear on contact or user login form

texts:
I have a theme and I am able to configure the site branding block to show up on my content type pages and a full-width template I have.  This is because I have {{page.branding}} in the template.

However it wont appear on the contact page or the user login page?  Is it because they are not "pages" or "content types"?  What am I missing?


texts:
I'm a newbie in Drupal, and I have a really important web site to build. I've started with a Zen template, so I can build the entire theme from scratch.

I've looked around for better practices and best ways to do this, and finally decided to start by doing the "Master-Layout" on the "page.tpl.php" (I've figured that it's the best place for the global website structure), plus, I'm using the default CSS's files do arrange the things on the page.

But now, I need to start the "home page" content section. It will have a few "blocks"  and I still have some things that isn't clear what I can do to build this way.

For example, I have a "News" structure, that the authors use it to insert the news articles. I need to list the news on the home page much like an accordion style, with the image related.

Other example, the site will have a dynamic menu, using a jQuery plug-in like this: http://www.wizzud.com/jqDock/, and each item on this dock, will come from the Drupal database. Should I create a modulo to accomplish this? Can you guys help me??


texts: Specifying Taxonomy Term Filter in View from Page Editor

texts:
I'm currently using a view to display content teasers and I want my users who are making pages to be able to incorporate these views, however I want them to be able to specify a taxonomy term to show that content. I tried doing this with a Contextual Filter, however I need some way to allow the user to specify the term in the page editor, not on the page preview itself. Is this something that Views allows you to do? Do I need to install a module, or do this programatically?

Hopefully I'm not being too confusing with that description, if so just let me know and I can try and clarify.


texts: Serve aggregate CSS/JS files from S3 instead of local storage

texts:
I have enabled aggregate CSS/JS from the backend. It stores the aggregated files in the local system. How do I make them accessible through the S3 bucket? I have already installed the S3fs module.

The point is when my server is down it automatically creates another instance. And that newly created instance does not have the previous aggregated CSS/JS files. Therefore, it breaks my website.


texts: Where are the pages for the Statistics module shown?

texts:
I've installed the Statistics module (version 7.18) in my Commerce Kickstart 2 store, but I can't find it anywhere in menu.

What should I do to access this module?


texts: Creating a sortable table in the backend?

texts:
I want to create a custom view where informations are shown in table format. In the backend i want to create a view like this:

Do you know a module to achive this? Or how would you create  a module for that?
Any hints are greatly welcome!

Thanks a lot!


texts: Create a view to display all nodes referencing this content

texts:
I have 2 content types: Recipe and Product. In Recipe, I have an entity refence field to select a Product node used from the Recipe node.

In the Product node, I want to create a view to list all the recipes using that product. This means a block which lists all the recipes that reference this product.

How can I achieve this in Drupal 8?


texts: How not to display some required fields on registration form?

texts: My user form is pretty long and many of the fields are required. However I don't want to discourage lazy users from registering. I would like them to register and pay first then make them fill out the required fields when they edit their profile. I would like the required fields to be required when editing their profile but do not want to show them on the registration form. Right now making a field required automatically puts it on the registration form. How do I prevent this? Thanks.


texts: Pathauto , Using Body Value for URL Alias

texts:
I am trying to use the use the node body value for URL alias using Pathauto . I am trying the below path pattern : content/[node:body:?]
But this doesn't seem to have any effect .
I have tried this also : content/[node:body:Text] ..yet no result .

Any pointers to resolve this is highly appreciated .

Thanks


texts: I have used Drupal Commerce Kickstart 2 + Commerce Coupons (fixed, %) + Coupons Batch create to create  coupons. Now, is there any way to remove all coupons?


texts: How do I render the primary menu's markup?

texts:
I have {{ page.primary_menu }} in page--front.html.twig and I have the following in the .info.yml file of the theme.

regions:
  header: Header
  primary_menu: 'Primary menu'
  content: Content
  footer: Footer

The primary menu markup doesn't render. What am I missing? This is a new blank theme (not a sub-theme of anything). There is no mytheme.theme file.

In the template comments, under 'Regions' it states:

  page.primary_menu: Items for the primary menu region.

I noticed that the menus don't appear in the 'Classy' theme either.


texts: Display an image for the first item in a Views news list

texts:
I want to create a view to display news like in this image:

The list shows an image only for the first news, the other news only display the title.


texts: How to show more terms in the "Parent terms" select list when adding taxonomy term?

texts:
When adding terms to a taxonomy vocabulary, the "Parent terms" scrolling selector list in the "RELATIONS" section only displays 4 items. When dealing with large, complex, hierarchical taxonomies, this makes it difficult and slow to find the parent (a similar complaint and another).

I would love to be able to use something like the Simple hierarchical select or Client-side hierarchical select widget there, but assuming that's not currently possible, how can I simply display a longer list to make the selection a bit easier?

I am guessing there is a file somewhere containing a setting of "4" (unless that's a default) that I would able to increase to "20" for example. I hunted but couldn't find it.

I'd be interested in an answer, even if it would be a core hack that I would have to redo with each update.

Edit: It seems, from this link, that one solution may involve adding code such as this:

<?php
function MyModuleName_form_alter(&$form, &$form_state, $form_id) {
  if ($form_id == 'taxonomy_form_term') {
    $form['relations']['parent']['#size'] = '20';
  }
}

But where to add it? Or perhaps in a custom module (called MyModuleName)? Perhaps in MyTheme.theme? Or perhaps in a twig file such as html--admin--structure--taxonomy--manage--MyVocabularyName--add.html.twig?


texts: Using taxonomies to enhance SEO: Hard Situation

texts:
I am working on a site that the client required a dynamic url creation for a huge number of keywords for each city (for example). So the result url would be like www.domain.com/city/citname/keyword.

And each URL shall direct to a page which has the same content except the city name and keyword.

So I directly thought of taxonomies, but when I reached the development stage ... it was very hard to apply this over Drupal. I think of making two vocabularies one for the cities and the other for keywords as keywords are repeated the same for each city.

Summery: every city should have all the keywords connected to it

So, If my approach is good, how to mix two vocabulary? and how to maintain one content for all resulted taxonomy terms.

I hope it is clear

best,


texts: After updating view through ajax call href change to destination node

texts:
i have a view let say dash_status all which is showing on a page at url www.example.com/statuses/share . then url becomes for hrefs like

Now if i update this view through ajax call, code for ajax call as follws

$view = views_get_view('dash_statuses_all');
$view->set_arguments(array( $type, $value));
$view->execute();
print $view->execute_display('page_1');

then after updating view my href url becomes :

so the destination change to node.

I don't know why this is happening and i don't want to do this.

how i can resolve this . Please Help

Edit :

After more debugging I get to know that  action after my ajax call is getting changed to ajax handler page.
action="/xyz/AjaxCalls.php" is coming from where I am creating view.
It should be the xyz/statuses/share which was page from where ajax is getting called.

Thanks
Yatendra


texts:
I have been trying to intercept a page request from /node/nid which is of type the_content_type and then appending some facet query parameters to it which is something like this

?f[0]=city%3A160&f[1]=country%3A48.

The purpose is to preselect the facet options from that page.

Here is the subscriber class I have written so far

<?php

namespace Drupal\custom_module\EventSubscriber;

use Drupal\Core\Url;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Drupal\Core\Routing\TrustedRedirectResponse;

class RedirectWithFilterSubscriber implements EventSubscriberInterface {
  /**
   * {@inheritdoc}
   */
  public static function getSubscribedEvents() {
    // This announces which events you want to subscribe to.
    // We only need the request event for this example.  Pass
    // this an array of method names
    return([
      KernelEvents::REQUEST => [
        ['redirectWithFilter'],
      ]
    ]);
  }

  /**
   * Redirect requests for my_content_type node detail pages to node/123.
   *
   * @param GetResponseEvent $event
   * @return void
   */
  public function redirectWithFilter(GetResponseEvent $event) {
    $request = $event->getRequest();

    // This is necessary because this also gets called on
    // node sub-tabs such as "edit", "revisions", etc.  This
    // prevents those pages from redirected.
    if ($request->attributes->get('_route') !== 'entity.node.canonical') {
      return;
    }

    // Only redirect a certain content type.
    if ($request->attributes->get('node')->getType() !== 'the_content_type') {
      return;
    }

    $node = $request->attributes->get('node');
    $node_id = $node->id();
    $node_url = $node->url();
    $country = $node->field_country->getValue();
    $city = $node->field_city->getValue();
    $country_target_id = $country[0]['target_id'];
    $city_target_id = $city[0]['target_id'];

    if (empty($country) && empty($city)) {
      return;
    }

    // This is where you set the destination.
    $option = [
      "query" => [
        "f" => [
          "city:$city_target_id",
          "country:$country_target_id"
        ]
      ],
    ];

    $redirect_url = Url::fromUri("entity:node/$node_id", $option);
    $response = new RedirectResponse($redirect_url->toString(), 301);
    $event->setResponse($response);
  }
}

The resulting url looks fine though

http://project.dev/some-custom-page?f%5B0%5D=city%3A160&f%5B1%5D=country%3A48

But the problem is, the page always shows

The page isn’t redirecting properly

on my browser. I've been figuring this out for almost 3 days now and I can't seem to find a way through it. I've been wanting someone to have a fresh look into it. Maybe I am doing something wrong. Is there somebody can lend me a help please? Or maybe, a different way other than this? Thank you in advance.


texts:
How do I display all nested links in

 format in Drupal 7? The default code only displays the 1st level links even though they are arranged in the Drupal admin menu as nested:

<?php if ($main_menu): ?>

 <?php print theme( 'links__system_main_menu', array('links' => $main_menu) ); ?>

<?php endif; ?>

Only the 1st level is displayed in the ff. menu setup:

-Fruits
---Apples
---Oranges
---Lemons
-Cars
---Big car
---Small car
---Fucked up car
-Whatever


texts:
I'm using D7 and Rules 7.2.3

My goal is to insert a record into a non-drupal table using rules.

For the rule action I have:

    $userid = [entityform:uid];
$entityform-id = [entityform:entityform-id];
$myresult = db_query("INSERT INTO 'btcalarm' (`userid`, `entityform-id`) VALUES (%d, %d)",$userid, $entityform-id);

The rule is triggered (it also has a page redirect as the last step) but the record is not inserted and I do not get an error message.

It seems the code should work, but my biggest concern is how to troubleshoot this?


texts:
I am new with D8

I have a view which lists some content about a specific content type.

I made a plugin that permit to add a custom drop button for each view rows

This button has to make some control and then redirect to a new content type or form.

This part is OK

But

I would like to know how is it possible, in the button context, I can get the node_id of the specific content :

the button in first row will return the node_id of content of row 1
the button in second row will return the node_id of content of row 2
...


texts:
When I was installing Drupal 8 (Macos, nginx, php7.0, mysql5.6), the following error occurred, Can someone help me?

An AJAX HTTP error occurred.
HTTP Result Code: 200
Debugging information follows.
Path: /core/install.php?langcode=zh-
hans&profile=standard&continue=1&id=1&op=do_nojs&op=do
StatusText: OK
ResponseText:
Warning:  Declaration of
Drupal\Core\DependencyInjection\ContainerBuilder::callMethod($service,
$call) should be compatible with Symfony\Component\DependencyInjection\ContainerBuilder::callMethod($service, $call, SplObjectStorage $inlinedDefinitions) in /Users/xile/code/drupal/core/lib/Drupal/Core/DependencyInjection/ContainerBuilder.php on line 22
Drupal\Core\Config\UnmetDependenciesException: Configuration objects (block.block.bartik_help, block.block.bartik_search,
block.block.seven_help, contact.form.feedback,
core.entity_form_display.node.article.default,
core.entity_form_display.node.page.default,
core.entity_form_display.user.user.default,
core.entity_view_display.node.article.default,
core.entity_view_display.node.article.teaser,
core.entity_view_display.user.user.compact,
core.entity_view_display.user.user.default,
field.field.node.article.field_image,
field.field.user.user.user_picture, field.storage.node.field_image,
field.storage.node.field_tags, field.storage.user.user_picture,
rdf.mapping.comment.comment, rdf.mapping.node.article,
rdf.mapping.node.page, rdf.mapping.taxonomy_term.tags,
taxonomy.vocabulary.tags) provided by standard have unmet dependencies in Drupal\Core\Config\UnmetDependenciesException::create()(line 89 of /Users/xile/code/drupal/core/lib/Drupal/Core/Config/UnmetDependenciesException.php).


texts: trigger a action based on the presence of families of products using rules?

texts:
How would I trigger a action based on commerce_product_calculate_sell_price if families of products (or quantities of families of products) are present using rules?

For exemple, if the cart contains products (or a quantity x of products) where the sku starts whit Mx67 (e.g. Mx67b, Mx67er, etc.), NQ-12, etc., when calculating the price do action CalculateX.

Would it be simpler to pass the full list of line items to an action and test for the falilies there? How do I pass the full list of line items to an action and how do I define that parameter in my hook_rules_action_info()?

Thx


texts:
I created a flag named 'like', user can 'like' every node, and below down the node footer, show 'users who like this node also like'.

Just like Amazon's Customers Who Bought This Item Also Bought

I think the normally process is :

find users who flag this node.
loop every users, and find each user's flaged node.

But if 1000 people flag this node, it will be very slowly!

I think may Views module can do this. but i think it will slowly too.


texts: Problem with Bootstrap Theme and Jquery Multi

texts:
I was using the bootstrap theme for drupal and jquery update and everything worked ok. But by client requirements I have to use Jquery Multi instead of Jquery Update and now, this returns two errors:

All scripts are loaded right(jQuery.js, jQuery-1.11.2, swicth.js, bootstrap.js)

I'm sure I'm missing something but I have no idea what can be.


texts: Help with view styling - template/css/whatever

texts:
Our client saw the schedule view of DrupalCon Denver's site and wants one of their conference schedule views to look like that:

Obviously we're styling things differently, but what they really want is the track icons to display in the exposed filter and alongside the individual sessions.

Individual Sessions
We have a content type called session, and a taxonomy called track. The taxonomy has an image field called track icon (field_track_icon), and there's a term reference field on the session that holds the selected track.

I managed to get the icons to display in the view with the sessions:

View setup -

Preview -

But I need to do some conditional processing - if the field "field_hide_track" on the individual session is true, then don't display track icons (or the value of field_hide_track, obviously.) We have a certain session type that needs to contain all of the choices from the taxonomy (i.e. be associated with all tracks) but do not want it to have a visual indicator. Right now, because they have all the choices, the view displays all of the icons from the taxonomy. It also displays the icon twice if there are multiple speakers, but I think that's because of the way we have things grouped. Basically we want the icon to display before the session number/title line for all sessions that don't have field_hide_track checked.

I've tried custom templates (views-view-fields--at-a-glance-test--page.tpl.php and views-view-field--at-a-glance-test--page.tpl.php, where the view's machine name is at_a_glance_test), but can't figure out how to get the information I need to do the conditional processing. Can someone point me in the right direction?

Exposed filter
I have no idea where to start with this one. We're using Better Exposed Filters module to allow checkboxes instead of dropdowns, etc. I already have a views-exposed-form template to handle the background color and font choices, etc. but aside from some kind of horrible hard-coding, I don't know how to get the icons from the taxonomy to display next to the checkboxes. I think I could probably move the css for this into the template file and generate a background property for each taxonomy term that would include the image, but I don't know how to get the image from the taxonomy term field in the context of the views-exposed-form template.

EDIT to add Views PHP code that worked

<?php
if(isset($data->field_field_hide_track[0]['raw']['value'])) {
    if($data->field_field_hide_track[0]['raw']['value'] == '0') {

    $image_vars = array(
        'path' => file_create_url($data->field_field_track_icon[0]["rendered"]["#item"]["uri"]),
        'alt' => $data->field_field_track_icon[0]["rendered"]["#item"]["alt"],
        'attributes' => array(
          'class' => array('session_list_track_logo')
        )
      );

    $track_logo = theme('image', $image_vars);
    print "
" . $track_logo . " " . $data->field_field_session_number[0]['raw']['value'] . " | " . $row->title . "
";
    }
    else {
      print "
" . $data->field_field_session_number[0]['raw']['value'] . " | " . $row->title . "
";
    }
}

?>


texts: Multiple field, but each one as individule

texts:
I need an image field with only 2 field limit.
I need to call first one front and second one back and be separated.(no problem I can do that with hook_form_alter)

My problem is that in drupal 7, in adding the content, it doesn't show the second field upload button until you upload the first one.
You have to add the first file, than click on "add another" to be able to upload second file and after uploading both if you delete the first one, the second one goes to first one place, which I don't want that to happen!

I know I can make two separate fields call one front image and one back, but I want to know if there is an approach to do this with only one field. (save a database table)

Thank You


texts: How can I make the Book Navigation also show the Summary of the Child Page?

texts:
Currently the Book module will create a navigation of links to each of it's children pages. I need that navigation to also include a teaser or summary from the child page.

This is for Drupal 7.


texts: create a datetime field with data module

texts: I have installed the data module in order to create some data tables, but I have noticed that there is no datetime type given in the user interface, so how can I add some datatime fields to my data tables with the use od data module?


texts:
I want a content type having a field "FB URL" that get the URL of a Facebook Event and that when people load a node of this type, the content of the facebook event is retrieved through FB API. It cannot be retrieved from the database because the content must be up to date with the one on facebook.

So far, I created a module with node_load() to add content while the node is loaded but I don't know what function to call from FBOauth module to do so... Before that, I tried with a simple file_get_contents(); that worked well until the access token from the FB App expired and didn't know how to get a new one dynamically.

I think I'm getting lost so could anyone guide me on how to do that?

Thanks a lot!


texts:
I am trying to add a custom token in pathauto.
I have a token [story-page-number].
Then in my hook_pathauto_alias_alter() I am trying to replace it using token_replace().

Something is not quite right though.

token_replace("[story-page-number]", (array)node_load($context['data']['node']->nid));

Here's my custom token set up.

function mymodule_token_list($type = 'all') {
    $tokens['story-page-number'] = t('Page number (of story front)');
    return $tokens;
}

function mymodule_token_values($type, $object = NULL, $options = array()) {
    $values = array();
    $values['story-page-number'] = get_story_page_number($node->nid);;

return $values;
}

What am I missing here, I thought it would be a lot more straight forward.


texts: What attempts are there (successful or otherwise), to move the heavy work in templating to client side javascript?


texts:
I have created a view that is grouped by taxonomy term and it displays exactly how I want it. But what I need to do is add the term ID that the view is grouped by as a class, I have the following custom views template created but the term ID is not available as a variable to use.

The template is views-view-unformatted--products.tpl.php where I have printed the title as the class of the wrapper I need to add the term ID instead (the title is actually the term name as this is what the view is grouped by.)

<div class=<?php print '$title)'; ?>>
  <?php if (!empty($title)): ?>

<?php print $title; ?>

  <?php endif; ?>

    <?php foreach ($rows as $id => $row): ?>
      <div<?php if ($classes_array[$id]) { print ' class="' . $classes_array[$id] .'"';  } ?>>
        <?php print $row; ?>

    <?php endforeach; ?>


texts: How to theme the edit page of a form and retrieve $form variable from the hook_form_alter into the template for theming purposes?

texts:
I have a content type A
How can I add custom theme to edit page of that content type A in drupal 7 only for specific role ?
In my module,

function hook_form_alter(&$form,&$form_state,$form_id) {
if (form_id == 'content_type_a') {
global $user;

if (in_array('rad',$user->roles)) {
$form['#theme'][] = 'custom_content_type_a_node_form';
}
}
}

In my template.php file I have the following code

function hook_theme() {
  return array(
    'custom_content_type_a_node_form' => array(
      'variables' => array('form' => NULL),
    );
  );
}

function THEMENAME_custom_content_type_a_node_form($form) {
// When I check here for $form I get an empty value
// I want to get the $form value derived from the form_alter function's $form //variable . How can I achieve it?

}

How can I retrieve the $form value from the hook_form_alter's $form variable?


texts: When I visit  a page , say 'About Us' I want the 'About Us' in the menu-items to act as a simple text (not as a link). How can I achieve that ? Thank you in advance.


texts:
I have two different profile2 profiles, the usual stuff.
I just found out that creating new profiles of type a makes it impossible for the user to edit his profile.

How it should be:

The user registers and goes to his empty profile, sees edit buttons and links.

How it is:

The profile is empty. you see the frame for where an image belongs, but no text at all, no buttons, no links.

I took over the project with very little documentation, already existing users have full and right functionality.
I did a permission rebuild, checked them and tweaked them without any success.

The users have permission to view, edit and delete own content.

Where should I look for the problem? What could cause such behaviour?


texts:
I get this message but nothing is logged (that I can see)

The update process was aborted prematurely while running update #7204 in wysiwyg.module. All errors have been logged. You may need to check the watchdog database table manually.


texts: How to display an image from theme directory to a drupal block by php code?

texts:
I want to load an image from my theme directory inside a block. I am using the following code:

<img src="<?php print $base_path .$directory; ?>/images/oil-ad.png" alt=''oil ad">.

But it is not working. However I have enabled PHP Filter and php text format.


texts: Views charts with node revision date as x-axis

texts:
I have 4 nodes with a field status (just an example, it could have more fields). The content type is set to create revisions on every update.

What I need is to create a chart in views like the one below, using Charts and Highcharts.

So, first time I create the 4 nodes:

3 have status = No Run;
1 have status = Blocked;

After updating the 4 nodes, a new revision is created and now each node has a different status value:

1 have status = No Run;
1 have status = Blocked;
1 have status = Passed;
1 have status = Not Completed;

On the third revision:

2 have status = Passed;
2 have status = Not Completed;

... and so on...

I tried everything in views without success. I started by trying to show the data needed in table format but I can only view the latest revision, not all.

Anyone has a clue on how to accomplish this?

I'm willing to make this with code also but I would like to try views first.

Thanks!


texts: Creating complex tables in views in Drupal 7


texts: Deletion of some watchdog messages with subquery

texts:
What i want is to delete from watchdog the first 20 messages with type as 'blabla' what i did untill now is:

 $query = db_select('watchdog', 'w')
    ->fields('w')
    ->condition('type', 'blabla')
    ->range(0, 250);
  $subquery = $query->execute()->fetchCol('wid');

  if ($subquery != NULL) {

    db_delete('watchdog')
      ->condition('wid', $subquery, 'IN')
      ->execute();
  }

it works fine but i want to do it with subquery like:

$subquery = db_select('watchdog', 'w')
    ->fields('w', array('wid'))
    ->condition('type', 'blabla')
    ->range(0, 250);

  // Deletes the previous selected values.
  db_delete('watchdog')
    ->condition($subquery, 'wid')
    ->execute();

it gives me the error:

General error: 1093 You can't specify target table 'watchdog' for update in FROM clause

Any ideas how to solve this problem?


texts: Updating a term reference programatically

texts:
I've written a module that - among other things - automatically categorizes uploaded files based on their file extension. The idea is simple: the module programatically sets up a taxonomy and automatically adds new terms to it whenever it stumbles upon a new file extension (i.e. pdf, .doc, .jpg etc.).

I cannot get it to work, however. The taxonomy terms are succesfully added to the taxonomy and I can go and investigate them in the admin interface, but the term reference between the node and the term is never saved to the database. I use $node->computed_file_extension[$node->language][0] = $term->tidto save the reference and I'm pretty sure that I've done this with sucess in the past.

I'm actually a bit confused about using 'und' or $node-language. I suppose $node->langugage is the more universal of the two, but it seems it does not always work - in this case I've tried both without success.

When I inspect my node object I can see that the reference is on the node object, but there are no records added to the table taxonomy_index in the DB when node_save() is triggered.

I'm triggering this function on either node update, node insert or node delete and only if changes have been made to the field where I store the uploaded file (i.e. a file has been added or removed).

function _uvp_fields_update_field_file_extension($node) {

// Load the vocabulary called 'file extensions'.
  $vocabulary = taxonomy_vocabulary_machine_name_load('file_extensions');

  if (!empty($vocabulary)) {
    if (!empty($node->field_file['und'][0]['fid'])) {
      $file = file_load($node->field_file['und'][0]['fid']);

// Split the filename and grab the last part to get the file extension.
      $extension = array_pop(explode('.', $file->filename));

      $term = current(taxonomy_get_term_by_name($extension));

// If there is not already a taxonomy term with the given extension, create it.
      if (empty($term)) {

// Build taxonomy term object.
        $term = (object) array(
          'vid'  => $vocabulary->vid,
          'name' => $extension,
        );

// Save the taxonomy term.
        taxonomy_term_save($term);
      }

// Add taxonomy term reference.
      $node->computed_file_extension[$node->language][0] = $term->tid;
//$node->computed_file_extension['und'][0] = $term->tid;

    }
    else {

// If the file has been removed, remove the tag.
      unset($node->computed_file_extension['und'][0]);
    }

// Save the node.
    node_save($node);

    return TRUE;

  }
  else {

    watchdog('uvp_fields', 'The vocabulary "file_extensions" does not exists.');

    return FALSE;
  }
}


texts:
In the past I have imported automatically some vocabularies using rdfx/evoc and put some rdf mappings using rdfx ui. The module also made automatic rdf mappings with taxonomy terms and various fields that does not let me delete.

Now I need to clean up the mappings and reach astate of rdf mappings as it would be a fresh install.

RDF UI and other modules do not provide the possibility of deleting mappings.

What tables/fields I have to delete/alter from the database, so to clean up, without damaging the rest of the site?
How I can bring rdf_mapping, mapping BLOB to defaults?


texts:
I am simply trying to autopopulate a Taxonomy Term from Content Type A into Content Type B.

An example, I'm creating a review site for Cars:

Content Type A = Car Model
field: field_car_model_tag

Content Type B = Car Review
field: field_car_review_tag

Assuming, Content Type A|CAR MODEL has already been created, titled "FORD MODEL".... My users will find and click a "Review Ford" link that routes them to Content Type B|CAR REVIEW, and auto-populates the Node Reference field (Node Reference URL Widget, for example, even though I'm attempting to only use Entity Reference fields).

After saving this same Content Type B|CAR REVIEW node, I would like this field, 'field_car_review_tag' to automatically populate with it's sister term from Content Type A|CAR MODEL.

In Drupal 6 Rules, I found this to be very straightforward.
I would simply "Load a referenced node, and then set a CCK field without validation", applying the token from the referenced content type.  In Drupal 7, the settings are seemingly endless.

Thank you for your help!


texts: Is there any way to clear the cache with specific cid?

texts:
I set some data in cache using cache_set($cache_id, $temp_data, 'cache', CACHE_TEMPORARY); from a custom module. It's cleared when I clear all the cache.
Is there any way I can clear that specific cached data using its ID?


texts:
I'm looking to drop the -a flag from the drush's rsync, but not sure what the best place for it as far Aegir is concerned. Would it be the sitename.alias.drushrc.php files in /var/aegir/.drush? Or should this change be configured in /var/aegir/drush/commands/core/rsync.core.inc ? Ideally, it would get set in once place and be effective for  all sites, and without impact to other functionality.

The reason I am looking to drop -a flag is to not preserve file ownership when the files are pushed out to clustered web servers -- we keep running to weird file permission issues, when files have different ownership on the Aegir server than the target web servers.

Thanks!


texts:
I'd like to do simple thing, but because of drupal serialized data field don't know how to. I'd like to set for every user a variable in "data" field, I do it manually when user edits its profile, like this:

$edit['data']['profile_bg_active'] = 1;

I want to do it now for all users, so the "profile_bg_active" exists in every user data field.

The code I am using is the following one.

$updateAllDudes = db_select('users', 'uu')
  ->fields('uu')
  ->execute();

foreach ($updateAllDudes as $dude) {
  $existingUser = user_load($dude->uid);
  $edit = array();
  $edit['data']['profile_bg_active'] = 1;
  user_save($existingUser, $edit);
}

I get the following error in the log:

  PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 'name': INSERT INTO {users} (uid, name, pass, mail, theme, signature, signature_format, created, access, login, status, timezone, language, picture, init, data)`

It seems it is creating new users instead of updating the existing ones.


texts: Can`t access config panel after the installation of Ubercart and e-commerce modules

texts: Fatal error: Call to undefined function dpm() in /home/u275855040/public_html/sites/all/modules/ecommerce/ec_store/ec_store.tokens.inc on line 10 How to fix that?


texts:
I've got a view for the content type article to display them. I'd like it to display the full content or the teaser.
As a format I've chosen unformatted list.

But whatever I choose (rendered entity/display suite/teaser/full content) I will only see the titles in my view and a read more link.

The body field is Long text and summary but I didn't use the summary so far.
Does anybody know this behaviour? I'm sure it's just a small setting somewhere but I didn't see this before and I ran out of ideas where to search for the solution.

Edit: Even in the content type, everything looks fine. In full content and teaser, all fields are beding displayed.


texts: How to add tri-state checkboxes to form created with Form API?

texts:
I want classical tr-state checkboxes, like the ones on the picture below:

Checked would mean "true for node and all it's children", intermediate "true for some children, leave it as it was" and uncecked "false for all children". Desired values (but that's not a must) are:

checked - TRUE
unchecked - FALSE
intermediate - NULL

Is there a module to provide control like this? Or to provide intermediate value for regular checkboxes?

I need it for Drupal 7, but I'll gladly welcome answers for 6 and 8 too.


texts: FontAwesome tags removed when switching between Source and Wysiwyg

texts:
I am using http://fortawesome.github.com/Font-Awesome/ - popular iconic font

When I insert "i" tag i.e.  it is saved only in source mode enabled, but removed from html when saving in wysiwyg mode.

How to avoid removing i tag? (using Ckeditor with Drupal 7 and Wysiwyg module)


texts:
I've been browsing through modules at drupal.org, in search for a Drupal7-savvy WYSIWYG editor. I looked into this (horribly outdated) lineup. It looks like the only actively maintained editor at this moment is CKEditor. Has anyone come across any other solution? Even if not wrapped into module, perhaps it would be easy to integrate into admin-side.
I'm obviously looking for the least expensive option. Ability to define custom templates and integration with Media module - would be a plus.


texts: There is a mongodb module which is in develeopment stage. As usually find MySQL as my bottleneck, wondering whether anyone has actually implemented mongodb on D6 with success? And if so what are good resources on how to implement mongodb?


texts: Blocks aren't being assigned to a region

texts:
Is there any reason that these blocks wouldn't be assigned to the regions specified?  The only way I can get these to appear is to set them manually.  Kinda defeats the purpose of defining a region in the first place.

function custom_module_block_info() {

  $blocks = array();
  $blocks['footer_touts'] = array(
    'info' => t('Footer Touts'),
    'status' => TRUE,
    'region' => 'footer',
  );

  $blocks['carrousel'] = array(
    'info' => t('Carrousel'),
    'status' => TRUE,
    'region' => 'hp_content',
    'visibility' => BLOCK_VISIBILITY_LISTED,
    'pages' => '<front>',
  );

  return $blocks;
}


texts:
I wrote a callback in my hook_menu() implementation, wich won't work the way it is intended to because of caching. The callback just returns some text depending on a cookie. Something like that:

function _show_logoutpage(){
    if($_COOKIE['foo'] == true) {
        return 'foo';
    }
    else {
        return  'bar';
    }
}

The code is called after the user is logged out so I would say the user is anonymous. Problem is the the output is cached (since the last menu cache clear) so the logic won't work.
Any idea how to fix this in a simple way?


texts: How can I remove username from title on profile page?

texts: I am trying to remove the user name from the users profile page. I tried to remove the div using CSS, but it is the same div as for all other nodes, so this means all other titles disappear. I only want to remove the user name on the profile page. I am using the module Real Name, so this is the last place where the user name is visible. I have only found tips for drupal7 dated years back when googling. Any ideas on how this could be done?


texts: What is the purpose of a configuration schema file?

texts:
I created a /config/schema/drupolo.yml file with the following content.
drupolo.social_network.setting:
  type: config_object
  label: 'Sacd Menu module settings.'
  mapping:
    facebook_page:
      type: string #Type: can be string | integer |  boolean
      label: 'Facebook page'
    twiiter_page:
      type: string
      label: 'Twitter page'

I created the /config/install/drupolo.social_network.setting.yml file with a key that doesn't exist in the schema file.
The problem is that the module is installed and the configuration is stored in the configuration table, and it doesn't respect the schema file.
facebook_page: 'https://facebook.com/default'
twitter_page: 'https://twiiter.com/default'
linkedn_page: 'http://linkedin.com' # key that don't respect the "drupolo.social_network.setting" structure that has been declared in the drupolo.yml

What is the purpose of the /config/schema/{module}.yml file if the config/install won't respect that structure?


texts: How to find unused or old twig template files?

texts:
There are times when fields are deleted from a Content type, but there is no way of knowing if there is a related field twig template without manually looking in our repository.

Other than looking for file names, are there any utilities or other methods to find twig templates that are not being used?


texts: Delete all users and there content apart from user 1

texts:
I have been asked to help look after a Drupal site that was created by a third party. This site has lots of users (~13,000) and for each user lots of items of content was created.

I want to clean the database from users and content to improve performance. When a user try to log into the site via an ID a user account is created, a web service is called and the correct content is recreated. My next job is to create some cron tasks to keep the data controllable going forward.

I want a way to delete all the users apart from user id 1. I looked at VBO but every now and again it will stop running and I have to start again (it has never completed).

I have created a drush command which calls the following:

function delete_users_batch_delete() {
  drush_print('Deleting Users');
  $uids = delete_users_get_uids();
  $count = count($uids);

  $temp = 0;
  foreach ($uids as $uid) {
    $temp++;
    user_delete($uid);
    if ($temp % 25 == 0) {
      drush_print('deleted ' . $temp . ' from ' . $count);
    }
  }
  drush_print('All users deleted');
}

function delete_users_get_uids() {
  $result = db_query('SELECT u.uid FROM {users} u WHERE u.uid > 1');
  $uids = $result->fetchCol();
  return $uids;
}

However this is running very slow on my local machine. What would be the best way to delete everything quickly.

If I had started the project myself I would just run my install script which would set up a new instance of the site with it configured correctly. Sadly I don't have this and just one big database dump.


texts: How to troubleshoot errors after successful Drupal update?

texts:
Recently, I updated a Drupal core website from 7.31 to 7.34 and the process was successful, without any error during the upgrade.

It's showing the latest version of 7.34 core in the Status Report, BUT if I visit the home page or any other pages, then it's showing different different errors.

I can access the Administration pages BUT I don't know how to solve these issues.

Here you can see the details about it:

http://cityguest.norrwing.ro/en
http://cityguest.norrwing.ro/en/privacy-policy

I appreciate your help in advance!


texts: How can I set up roles and allow users to choose which role to be?

texts: I have some users and I want to offer them the chance to choose their role which will have different permissions settings? How can I include a field on their user profile to allow them to choose the role? Is having a select list and then check that value the best option or is their a module that takes care of this kind of 'roles and responsibilities' stuff. For example, there is a 'facilitator' role which I want to give more permissions with regards to messaging users.


texts: Print a taxonomy term and url D8 views template

texts:
I am totally new to drupal 8. I have used d7 and i am migrating now.

I have setup a view with 4 articles.

I have managed to print out in a custom views theme

my title
image url

 {% for row in content['#view'].result %}

   {% set image_uri = row._entity.field_image.entity.uri.value %}

   {{ image_uri|image_style('blog_298x200') }}

   {{ content['#view'].field['title'].value(row) }}

 {% endfor %}

My template file is called : block--views-block--main-article-block-miniatures-slider.html.twig

I would be very greateful for any tip for getting what i need :

The node url
The taxonomy (field_categorie) and its url
Created date

I have installed the tweak twig module to make things easier for me


texts: Programatically render field in specific language while leveraging core content language detection

texts:
I'm working on a contrib module port to D8 and can't seem to find appropriate Entity API documentation to figure out how to get a rendered field in a specific language. I have a controller that needs to generate some custom XML based on field data, and I would like to be able to use core's language detection to get an appropriately translated field that can be used to generate this XML.

(As an aside -- I realize that core services could be leveraged to get field data in a RESTful way, but the XML schema needed here is quite custom and warrents its own REST endpoint and controller.)

Consider a route for a REST endpoint, that simply accepts the entity and field specifics needed, via the path like:

mymodule.xml_field:
  path: '/mymodule/xml/field/{entityType}/{entityId}/{fieldName}/{displayName}'
  defaults:
    _controller: '\Drupal\mymodule\Controller\MymoduleXmlControllerField::xmlController'
  requirements:
    _access: 'TRUE'

And a matching controller method like:

class MymoduleXmlControllerField implements ContainerInjectionInterface {

  // ... Entity manager and other services are injected ...

  public function xmlController($entityType, $entityId, $fieldName, $displayName) {
    $entity = $this->entityManager->getStorage($entityType)->load($entityId);
    $field = $entity->{$fieldName}->view($displayName);

    // ... Extract needed data from $field, generate XML and return it in new Response() object ...
  }
}

This works great until I try to leverage content translations. If I use default URL language detection and then request the XML via a language specific path (with a prefix, like: /es/mymodule/xml/field/...) the default lanaguage is always still used in the $field output instead of the spanish (es) translation (which I've confirmed is available on the entity).

My initial expectation was that the entity load call, or the field view call, would internally trigger language detection (as in D7), but I see that it's now up to my controller to manually specify and set a langcode somehow as the loaded entity object seems to be language neutral. I'm just wondering how I do this given that the high-level entity/field interfaces I'm using don't take a langcode paramater, and (at the time of writing) the entity API docs don't seem to address this.

I'm assuming that I need to use a setter method somewhere on the entity or fieldlist object to declare a langcode before calling the view method. It looks like I can get the detected language easily via an injected language manager:

$langcode = $this->languageManager->getCurrentLanguage(LanguageInterface::TYPE_CONTENT)->getId();

But I'm not sure where to go from there.


texts: What are some specific reasons NOT to share a users database table between sites?

texts:
I'm building a site for a client, and surprise! Turns out they're using a shared users table between multiple Drupal 7 sites (completely different code bases, different config, etc). I'm only supposed to be working on the one new site, but obviously this new wrinkle has me considering how these other sites will mess me up.

In my heart of hearts I know this is a terrible, very bad, no good idea. I don't want to launch a new site with this timebomb lurking under the hood. But I can only think of one scenario where things go hideously wrong. Deleting users could lead to major complications.

Other than that, what are specific scenarios that you have faced, or that you could think of arising when sharing a users table between Drupal sites?


texts:
So I have a Webform called "Department". It contains "Marketing" and "IT" as submissions.

I have another webform called "Person". It is a form that contains a dropdown. This dropdown should be loaded with values from the "department" Webform data.

So I add a new webform, and add a "Entity Select" called "Person Department".

I go to build, in "Person Department", in the "entity references settings", I select "Webform Submission" as the "type of item to reference", and select "Department" as Bundle.

However, when I go to my "Person" form, the drop down is loaded with Person:webform submission5.

How can I display the value of the Webform data in "department", not the key?

Thanks


texts: Drupal 7: How may I customize the user profile? And how do I add to it profile2 fields?

texts:
The profile under user/n will only show the profile picture and the username.

I´m using an Omega subtheme.
I´ve copied and pasted the default user-profile.tpl.php file, deleted everything and  added these two lines, hoping that one of them would work:

print drupal_render(field_view_field('profile2', $profile['main'], 'field_nombrecompleto1'));
print $field_profile_nombre_completo['value'];

The second line refers to the original core profile field, and the first one refers to the imported field (I´ve imported using the migrate module in D6, before I´ve upgraded to D7).

None of the fields gets printed out.
I´ve added this at the top of the template:

print "<pre>";
$vars = get_defined_vars();
print_r($vars);
print "</pre>";

And nothing happend. So I´ve added that code to the top of my page.tpl file, and it appeared the whole list of variables.
At the very top it prints:

[template_file] => sites/all/themes/liga/templates/page.tpl.php

And at some points it actually recognizes the (core profile) field:

    [content] => Array
                                (
                                    [content] => Array
                                        (
                                            [system_main] => Array
                                                (
                                                    [field_profile_nombre_completo] => Array
                                                        (
                                                            [#theme] => field
                                                            [#weight] => 0
                                                            [#title] => Apellido y Nombres
                                                            [#access] => 1
                                                            [#label_display] => hidden
                                                            [#view_mode] => full
                                                            [#language] => und
                                                            [#field_name] => field_profile_nombre_completo
                                                            [#field_type] => text
...

I´ve then deleted everything at my user-profile template and printed just XXXXXX and it didn´t printed out. It stills print the profile image and the username.

Now I have two issues here:
How to customize the profile template (user-profile.tpl.php) because it´s not recognizing the file inside my theme folder, and how to print profile2 fields information inside the user profile.

Hope anyone can give me some insight or clue.
THANKS!!!

Rosamunda


texts:
Is there a way to add a selection button or a check box to the display of a default view? I am hoping to catch the node information of the selected row into a bucket or into a container. Below is the screen shot of my default view, I need to add the button or check box at the end of the 'Treatment' column. I have little understanding about the hook_views_default_views_alter(hoping that its implementation is relevant in this case) but not sure how a button could be added using it. Let me know if the question needs more clarification or any additional information is required.

Thanks


texts:
I try to remove descriptions of language, files (avatar) and timezone in user profile form:

function bartik_form_alter(&$form, $form_state, $form_id) {

if ($form_id == 'user_profile_form') {
    unset($form['account']['mail']['#description']);
    unset($form['account']['pass']['#description']);
    unset($form['account']['language']['#description']);
    unset($form['account']['files']['#description']);
    unset($form['account']['timezone']['#description']);
   }
}

This code removes mail and password descriptions but it does not removes language, files and timezone descriptions.

Please, what is wrong with this code?

Thank you


texts: Conditionally apply CSS class to a conditionally-rewritten View field?

texts:
[This will require some background explanation.] We have a View (D7) displaying a custom content type. Flag Lists provides the option to select items via checkboxes and add them to a personal list. However some items are excluded from being available to add to such lists, and that it established by a boolean checkbox ("allowed" if checked) in the creation of the node. If NOT checked, the Flag List Operations checkbox in the View is rewritten by something else – currently, replaced by a simple text "X".

Now we want to provide a tooltip message explaining why this item is not available to be selected – using Tipsy, Q-tips or something like that. To display such a message only for the ones where the checkbox has been rewritten with X or something else, I believe it needs to have a unique class that also applies to all other such instances. SO: Is there a way to make those instances have a unique class so they can trigger the tooltip message only when it's relevant?


texts: Use different indexes for Solr searches on local dev environment

texts:
I'm using the Search API Solr module for search on my Pantheon site.  Pantheon's Solr module automatically sets the search index for the dev, staging, and live environments.

But now I want to install Solr locally and I want to use that index instead on my local dev environment.  I know I can change the environment settings in settings.php-- I have already done this for some things on my local environment.

I defined the Server for my local copy of Solr at
admin/config/search/search_api.  I have two different Indexes on this page, and these default to the Pantheon Server.  I can easily switch them to the local solr Server, but I don't want to do this every time I reset my dev environment.

What variable can I set to force the Indexes to use my local Solr Server?


texts: How to use taxonomy terms(with depth) on a views exposed filter?

texts:
I have a taxonomy vocabulary with 'Countries' as parents and 'Cities' as children.
I want to expose the terms with two views exposed filters,one for the parents and one for the children.But both filters show all parents and children terms.
How can I accomplish that,to show only parents term to one filter and children terms to the other filter?
Thanks in advance


texts:
I'm a Drupal novice and struggling to build a webshop with Drupal Commerce.
It's really starting to work out, but I've still have some problems regarding overriding and restyling themes.

Is it possible to add an extra delivery address form to the Drupal Commerce address field module (different billing, delivery addresses with checkbox to show delivery address)?

How can I restyle the address form? Is there a template file for it, or does it have to be done through CSS?

It would be really usefull if somebody could help me with some information or maybe some kind of guideline.


texts:
I have a special page called www.mydomain.com/special (whcih is a page node type). Only on that specific page, I want an extra image in the header of that page (next to the logo)

The logo and sublogo's is contained in the page.tpl.php provided by the previous themer.

What I would like to add in the page.tpl.php is somthing like:

if I am on page xyz

extra logo

endif

It this possible or am I totally wrong?


texts:
I've defined a global table, like this:

  $data['custom_test']['table']['group'] = t('Custom: Test');
  $data['custom_test']['table']['join'] = array(
    // #global is a special flag which let's a table appear all the time.
    '#global' => array(),
  );

Next I added a custom field:

  $data['custom_test']['test'] = array(
    'title' => t('Test'),
    'help' => t('Show test field'),
    'field' => array(
      'handler' => 'custom_test_handler_test_field',
    ),

With this I could now make a field handler; This field handler adds a subquery:

$this->query->add_field(NULL, "(QUERY)", '(FIELD)');

And with this I can output the result.

However, when I add a filter, (using a default filter handler), the query looks something like:

AND (.test BETWEEN '20' AND '30') ))

So what it does is that it tries to prefix a table, however there are no tables (since it's a subquery).

Is there someway I can fix this by configuration, without having to say build my own filter?


texts:
I try to check if my sidebar second if empty. If it is not empty, I add a class col-md-8 on my section-main.
To check if the sidebar is empty I use this code in the page.html.twig template of my custon theme:
{% if page.sidebar_second and page.sidebar_second is not empty and
page.sidebar_second|render|striptags|trim is not empty %}

My problem is that sometimes the sidebar second if considered as empty but it is not. In the sidebar second, I have a views block that the content depends on the current node taxonomy or book id. The query to get the content of this views block if altered in my_custom_module_views_query_alter(ViewExecutable $view, QueryPluginBase $query) function.
When I checked for sidebar_second in page.html.twig, the content of this block is always empty, but if I have another block in sidebar_second (so the column is displayed), this block has actually some content and is displayed.
So to check if my sidebar is really empty or not, I tried to check that in the my_custom_theme_preprocess_page() function in my_custom_theme.theme, like this :
  $rendered_sidebar_second = \Drupal::service('renderer')->renderRoot($variables['page']['sidebar_second']);
  $with_sidebar_second = !empty(trim(strip_tags($rendered_sidebar_second)));
  $variables['with_sidebar_second'] = $with_sidebar_second;

Then , in my page.html.twig, I check the variable with_sidebar_second to know if sidebar_second is empty o not. This gives the right results, but induces a problem for assets : PHP Exception LogicException: 'A stray renderRoot() invocation is causing bubbling of attached assets to break.. Using renderPlain() gives the same result. Using render($variables['page']['sidebar_second'], false) does not give the good result.
Is there a solution to have the good result for the sidebar_second and have all assets too ?


texts:
I'm looking for a solution to display some of my PDF files with a viewer.

I found many solutions for Drupal 7 but not yet for Drupal 8.

Is there any module or open source solution to display PDFs in a Viewer ?


texts: How to get referring items from a Entityreference field in the opposing item list? (back reference)

texts:
Using an Entityreference field in a content type A makes it possible to reference multiple items from another content type B to it. On node teaser pages or any other Views lists you can list them additionally on each row of content item from the content type A as a sub-list of referenced items. But how can I list the reference sources the other way around automatically without using another Entityreference field on the content type B (needless double-edit)?

Example: A car (content type A) has been repaired in 3 different car service stations (content type B). So the content type "car" gets a Entityreference field to add them (items from B). When I build a list of service stations (B), I would like to see a list of the cars (A) being repared in them automatically without an additional back reference field or additional modules like CER, making things needlessly complicated in the database.

NOTE: Basically it's the behaviour we would expect from Taxonomy terms, which are also Entityreferences in Drupal 8, but they seem to have some more build in functionality to work from both sides in item lists.


texts: How to switch between conflictual hooks?

texts:
In a custom module I'm implementing the hook_menu_alter hook to alter the page callback for the $menu['taxonomy/term/%taxonomy_term'] menu.

I've noticed that my hook is not implemented because another contrib module ( Taxonomy Display module ) already implements the same hook (all works fine if I disable TD).

What I need is not to prevail on TD hook with mine, but to use my hook under a certain condition, and TD hook for all other cases.

The condition is the presence of parameter "v" in the querystring, like the following example:

if url == taxonomy/term/tid?v=value then use mymodule_menu_alter

if url == taxonomy/term/tid then use taxonomy_display_menu_alter

How I can do that?

Thank you very much!

MXT


texts: From my understanding, smtp just changes the smtp server you use to send your mail, while elastic_email is a web service. Do I still need smtp if I'll only be using elastic_email for all emails? Thanks.


texts: Use Ajax to load full node including comments and comment form

texts:
I tried to use Ajax links API Module, nice module it even replace url when loading page but it works so slowly... I can wait page loading even for few minutes. I found another solution seanbuscay.com it works better but it doesn't load comments and comment form. I would like to load full node including comments (create view reference field with related comments didn't help).

I found some similar topics

Ajax via Jquery and attach behaviors

Load and interact with a node comments from their related node

Is it the best solution for Drupal 7 t use drupal.attach.behaviours?

Have anybody experience with loading full nodes with comments via ajax?


texts: I wanted to add basic page content but I cant see in add content  why it is? can anyone tell me how to create it now please?


texts: Image upload broken when editing content

texts:
Sorry if I'm using incorrect terms here. What's going on is, when I edit any content, as the the types of content under 'Content Management > Content Type', there's the Image: field, which I think is provided by the CCK Imagefield module or Imagecache. (I'm on 6.x-3.10 of Imagefield)

When I choose a file and click upload, I get a thumbnail image (http:/mysite.com/sites/mysite.com/files/imagefield_thumbs/image.jpg?1357151034). When I click 'Preview', I get a preview with the image I uploaded (http://mysite.com/sites/mysite.com/files/imagecache/product/image.jpg). When I save, the image is gone, and going back to the edit form, it doesn't show up as an attached image. One possible clue; this content type isn't 'product', but it's in sites/mysite.com/files/imagecache/product/.

This all worked until a couple of weeks ago, when I updated a bunch of modules. I did a whole site backup before I ran the updates, and a development version of the site on my local computer doesn't have this problem on up to date modules. The only way I can replicate it on my local machine is to use a backup of the database from after this error occurred.


texts: Display multiple node edit forms on one page with one submit button

texts: Is there a module allowing to edit nodes as a list, like in a spreadsheet, not one by one? For example, display a list of nodes on a page (e.g. 100 nodes) with each node having input boxes instead of displayed fields, or a mixture of both. Each input box is associated with a field, if the field has value then this value is already inserted in the input box and available for editing. After making changes press "Save" and it would update all those nodes with relevant field values. It's like editing a spreadsheet.


texts:
I have content type called services which has multiple filtered views.

What I need to do is when a new user registers his information, than I insert into that content type (services) one or more services he will provide. That means the user has the multiple check boxes on register page if he choose one services the specific view should display his information.

Is my structure right? Do I need to re-construct the data/types to get this result? Is it possible to proceed that way? and how? give me hint at least!

best