user3365957
  • Member for 7 years, 10 months
  • Last seen more than a week ago
how to get the absolute path for files based on fid
10 votes

Drupal 8 $file = \Drupal\file\Entity\File::load($file_id); $uri = $file->getFileUri(); $url = \Drupal\Core\Url::fromUri(file_create_url($uri))->toString();

View answer
Custom display suite field
Accepted answer
2 votes

I found a better way to access the node so this will work anywhere. $this->entity(); Inside the current class it will load the entity, in this case, the node. Happy drupaling!

View answer
Print fields a different node
Accepted answer
1 votes

Are you loading the node first? If you are not getting anything returned then it's probably because $node isn't set. Also is the 'News node' a node type of article? I would start by trying to ...

View answer
Drupal as a RestAPI
Accepted answer
1 votes

In drupal 7 you can use a contrib module called services, this will help you expose json by default for all nodes. You can also output main from hook_menu. If you use laravel you may be more ...

View answer
"Page not found" with new content type
0 votes

Sound like you have removed a dependency from the codebase that a field a certain field depends on, usually it's a module. If that's the case you will need to reinstate it, then uninstall it. But also,...

View answer
Can not display user information?
0 votes

Remove your first contextual argument. You only need this one:

View answer
Is there a good way to inspect objects whose type is derived from the EntityDrupalWrapper class?
0 votes

Use the drupal cli $ drupal debug:entity // Displays current events

View answer
How do I fetch user profile data in search api entity (node) view?
0 votes

Your search api view is only able to list what has been indexed, so you should add the node author to the search api index. After this, in search api, you should be able to add 'related fields'. ...

View answer
Views Slideshow: how to change items per slide based on screen resolution
0 votes

I would recommend you do this in a custom way. Output the view in a simple unordered list and use a is library for the carousel. Owl carousel is my favourite, it's got the responsiveness you require.

View answer
Features - keeping Git up to date when changing features on production
0 votes

Great question. I work in a Drupal agency where we see this all the time. Imaging this scenario: Locally you've made some amends to a site that overrides a bunch of features. Locally you can run ...

View answer
Context taxonomy term
0 votes

Can you not change the condition to just be the vocabulary and not the term? That way it will work with any term in that vocabulary? Also you could use the path as a condition: taxonomy/term/*

View answer
Breadcrumbs from menu URL
Accepted answer
0 votes

You might want to try a community solution for this like breadcrumbs by path Your custom function isn't doing anything with the url path itself, it's just using the breadcrumb variable. You can get ...

View answer
Importing pre-built content into the site
0 votes

I would recommend looking into drush make and .make files and custom installation profiles. You can set up a pretty solid base sites this way.

View answer
How can I make sidebar_first narrower?
Accepted answer
0 votes

col-sm-4 will be applied via a function in the theme. if you search through the theme for where the variable is set you can change it there. Possibly in the .theme file.

View answer