How can I attach a newly added paragraph to existing records?

While editing a form, I need to delete some fields and add a new paragraph. The issue here is, the newly added paragraph is not initialized in the edit form and that makes sense because the old data don't have that field so I have to initialize it manually by clicking on "Add Paragraph", then Save otherwise I won't be able to access it programmatically, but I have hundreds of users and I can't do that.

How can I add a paragraph to existing records?

I'm unable to use Drush on this server.

Change the language prefix for node links in a node list page.

When I visit a node list page e.g. https://my_site/en/admin/content/my_nodes with default English language all links for each node in the list shown with English prefix "en" in its URL i.e.
"https://my_site/en/my_node/custom_alias/50"
so far so good ...    
...
but
 when i visit it with other than default language e.g. with fi (For finnish). i.e. with 

Change the node's link(URL) in a node list.

When I visit a node list page e.g. https://my_site/en/admin/content/my_nodes with default English language all links for each node in the list shown with English prefix "en" in its URL i.e. https://my_site/en/my_node/custom_alias/50 , so far so good ...                      ...      

Why do some keys in a .routing.yml file start with an underscore?

The following is an example .routing.yml file:

example.content:
  path: '/example' 
  defaults: 
    _controller: '\Drupal\example\Controller\ExampleController::content' 
    _title: 'Hello World'
  requirements: 
    _permission: 'access content' 

As you can see, the keys '_controller', '_title' and '_permission' begin with an underscore.

I already figured out, that every key without an underscore under the 'defaults'-key is considered to be a parameter to the controller.

How to create field_collection_item in DRUPAL 8 ?

Hi guys,

In d7 field_collection_item can be created with
 

$fc_item = entity_create('field_collection_item', array('field_name' => 'field_pro_block'));

and to assign the block to the node can be done by this
 

$fc_item->setHostEntity('node', $node);

and to save the entity can be done with this
 

$fc_item->save(TRUE);

So, My question is how can I achieve the same thing in Drupal 8 ?

Error When MS Office Program Name (Excel, Word, Outlook, PowerPoint) In Article Title

This is a weird one.  It only occurs with one of my content types, "How To Article".

Pages

Subscribe with RSS Subscribe to RSS - Drupal 8.x