New answers tagged

0

so this will assume you have set up your endpoints via REST UI + your chosen Authentication Method: if not you will need to google how to set this up but lest say you want to create an "article" this is the json structure to post to POST -> www.yoursite/entity/node?_format=json { "title": [{ "value": "THE TITLE" }], "body": [{ "value": "THE BODY",...


0

Yes, you are right :) In general, for each table from field_data_field_* family, if its entity_type is equal to the "node" value, then it can be associated with the n.nid from the node table and if the entity_type is equal to the "user" then the entity_id value is associated with the uid value from the users table. I hope it will help somebody.


1

Try adding the placeholder % to the path (in the main views UI in the middle column under "Page settings"), e.g. something like my-view/by-year/% which will accept URLs like my-view/by-year/2019


0

As you mentioned in the comments you field is multivalue field so you should loop over it and render the item inside <li> tag something like the following: <div class="lenders-block-content clearfix"> <ul> <?php foreach ($content['field_link'] as $key => $link):?> <?php if (is_numeric($key)): ?> <...


4

Right now, this isn't possible with content moderation installed without doing backflips such as replacing the moderation handler for the node entity type. This is however being worked on! Here are some issues which are relevant to the problem you are having: Allow 'syncing' content to be updated in content moderation without forcing the creation of a new ...


0

Try $node = Node::create([ 'type' => 'calendar_data', 'title' => 'testing finaly 1111111111111111111111111 ', 'field_current_month' => date('Y-m-d'), 'field_date_type_value' => ['value' => '1'], ]); $node->save();


0

Finally, after some (!!) digging, I did it in assoc_views_post_execute function assoc_views_post_execute(ViewExecutable $view) { switch ($view->id()) { case 'assoc_persons': if ($view->current_display == 'page_1') { $database = \Drupal::database(); foreach ($view->result as $key => $value) { $person = $value-...


0

Tokens are contextual based on where they are used, so it's not possible to reference arbitrary content. If you can add fields to the newsletter, the ideal way to resolve this would be to add a node reference field, then create your tokens by doing something like [newsletter:field_node[0]:entity].


0

There is another Drupal helper function that is not deprecated as of 8.7. node_type_get_names() returns: string[] An array of node type labels, keyed by the node type name.


0

It's very simple to create the tree structure output you're looking for: Create the Content type Views, add the Taxonomy term Field next to the Title field, under Format Views settings choose to group by the Taxonomy field Grouping field Nr.1 On the Taxonomy field choose Exclude from display. This will give you a list of nodes that are displayed in ...


0

I have a view set up that sounds similar to what I think you are trying to accomplish: Create your content view filtering by taxonomy. Create your taxonomy view. Go back to your content view and use "no results behavior" under "advanced" and insert your taxonomy view into your content view as a "global view area". Now where there is no content assigned ...


0

That's probably an opinion-based thing and actually also a too broad question. But here's what I'd do: Programmatically create a new block. Provide a hook_theme and your own template to later render the output the way you want. Follow one answer from How to get all node entities tagged with a specific term? to get the data you need. In the block's build() ...


0

Here is a solution for converting article nodes into a blog type. I tried Convert Bundles suggested in another answer, but wasn't able to filter which nodes to convert. With this, you can add additional conditions to the query, such like a taxonomy term value. $query = \Drupal::entityQuery('node') ->condition('type', 'article') $results = $query->...


0

You can Import and export the content by using "Node Export with Features". need to enable this module under node export module. next, you have to go this URL admin/structure/features/create and create the feature with the particular content type of content and download the module. next, this module you have to enable in another site. content will be ...


2

Basically, what you need to do is the following: Create a new vocabulary (taxonomy module) Insert your structure as you listed above (MArketing...etc) Add "entity reference" field to your content type Use "views" to create list the content in "table". Make sure to use the right filters Some other modules might help with the interface like menu taxonomy ...


0

Turns out this issue was due to my settings on the Detection and selection page at /admin/config/regional/language/detection. I reordered URL to be above User and the translations are now showing. Hopefully, this is able to help someone else in the future.


Top 50 recent answers are included