Rest Export View multilingual content taxonomy filter fails

Rest Export View multilingual content taxonomy filter fails

I am going to create a REST API using Drupal 8 Rest Export with Views. It is working fine so far. I am showing some fields from content type article and added contextual filters for language and tags. I get results like this [ { “title”: “Autem Camur... read more
Rest Export View multilingual content taxonomy filter fails

Render a view in a given language in a custom command

I have written a Drupal Console command that creates a huge batch of HTML snippets. This is done by rendering a view programmatically (as in this StackExchange answer) The task Now I have to create these snippets in several languages. This works If I call the view in... read more
Rest Export View multilingual content taxonomy filter fails

Programmatically load node edit form

I’m able to load node create forms like so $node = DrupalnodeEntityNode::create([‘type’ => ‘avenue’]); $content = Drupal::service(‘entity.form_builder’)->getForm($node); return $content; However what if I want to load an... read more
Rest Export View multilingual content taxonomy filter fails

Get field (list type) label in a twig template

I have a content type (appel_offre) with a field_categorie_avis field, which is a list type with these values. ouvert | Ouvert toute l’année restreint | Restreint 24h concurrence | Appel public à concurrence In the node–appel-offre.html.twig template, I... read more
How to add a custom field to a taxonomy term

How to add a custom field to a taxonomy term

I am developing a module and I would like to know how to add a field to a taxonomy term? My section is named special and I want to add terms in this section I have this code: function add($form,&$form_state) { $form[‘name’] = array( ‘#type’... read more
Rest Export View multilingual content taxonomy filter fails

Modify "head-placeholder" in html.html.twig

that’s the first time I approach to Drupal or a CMS more generally but I’ve been working since years as FE dev. I’m creating a theme based on a template created from scratch for the Italian Public Administration(PA) in such way to define a standard... read more
Rest Export View multilingual content taxonomy filter fails

How to change autocomplete_route_parameters value on change of select option?

How to change autocomplete_route_parameters value on change of select option? I have a form element and inside autocomplete_route_parameters, I want to change $langcode value when I select any language from select list. $form[‘node_items’] = array(... read more
Rest Export View multilingual content taxonomy filter fails

programmatically enable and disable theme from update hook

I need to programmatically update my default theme and disable bartik on a live site. I know I need to update the config. In Drupal 7 I would have used theme_enable(), but I am not sure how to do this in Drupal 8. Below my function sets ‘mycustomtheme’ by... read more
Rest Export View multilingual content taxonomy filter fails

Filter views by current user taxonomy profile field

Entity type: Book I have entity type called “Book”. It has one field called “book_id”. Ex: science book(Book_name) -> 100(Bokk_id) Maths -> 101 english -> 102 User: I have user, he has one field attached with user profile called... read more
Rest Export View multilingual content taxonomy filter fails

Is there some way to compress CSS and Javascript only for certain users?

When I check the source of my web pages I am appalled at the amount of Javascript links in the page, but I have disabled the CSS and JS compression as I am often in development mode. Is there some way to disable the compression for admins and developers and enable it... read more
Rest Export View multilingual content taxonomy filter fails

Ajax callback not working with ‘language_select’ in drupal 8 forms

I’m trying to implement an ajax callback whenever language gets changed. Following code I have used: public function buildForm(array $form, FormStateInterface $form_state) { $language = Drupal::languageManager()->getCurrentLanguage()->getId(); $langcode =... read more
Rest Export View multilingual content taxonomy filter fails

How do I programmatically load a custom block?

I created a new custom block type in /admin/structure/block/block-content/types to which I added two fields. Then, I created a block with that block type. How can I programmatically load this block via code? How do I get the values of its fields (x, an image field,... read more
Rest Export View multilingual content taxonomy filter fails

Theme video-embed-iframe.html.twig by content type

I am using Drupal 8 and trying to theme video-embed-iframe.html.twig by content type. with the current naming suggestions this is not possible. I am using Media with video embed field containing in a field called video This is what I did so far. in the fields template... read more
Rest Export View multilingual content taxonomy filter fails

Share nodes and users across multiple sites

I understand sharing databases/tables is frowned upon as a practice, however, I need to share users and some nodes between two websites. What are the alternatives and what are the pros and cons of the most common strategies? To give slightly more detail. I need to... read more
Rest Export View multilingual content taxonomy filter fails

Updating modules fails with XAMPP on Windows 10

I’m pretty sure I installed Drush 8 correctly on Windows 10. I ran the command window as administrator. I changed to my Drupal directory, but I get “Command pm-update needs a higher bootstrap level to run – you will need to invoke drush from a more... read more
Rest Export View multilingual content taxonomy filter fails

How do I get a URL variable in a template?

I am trying to include a certain .html file if the URL has ?work=1. So far I have this, which I got from Check URL for string in a Twig file. {% if ‘work’ in url %} {{ include(‘work/index.html’) }} {% endif %} They say I need a function in my... read more
Rest Export View multilingual content taxonomy filter fails

Get URLs of taxonomies terms in Link field

I am having a link field in drupal 8. It can accept both internal and external links with autocomplete feature. But it works only with nodes means with content but i want to use it with taxonomy terms as well. How can i achieve this ? Any Help read more
Rest Export View multilingual content taxonomy filter fails

Change views exposed filter format

I am build a JSON export using a View in Drupal 8. Problem is that the parameters for retrieving the json doesn’t seem to work as I would want. In my View I need use two exposed filter criteria to select a date range. Both fields are Date and Time fields. When... read more
How do I create a conditional form field?

How do I create a conditional form field?

I have this dropdown menu of options in the user registration page of my site (image shown below), and i want when the user selects the employer, some text fields appear, like name of company, and when they select job seeker, the text field that appears asks for... read more
Rest Export View multilingual content taxonomy filter fails

Join user to custom table

I have a custom table (myusersession) which contains the uid field that is a reference to user entities. How can I add user entity fields (exactly ‘name’) to my view? I tried many variations of join, in hook_views_data(), but none of them works.... read more