Drupal 9 and 10 PHP module changes page content

Drupal 9 and 10 PHP module changes page content

Drupal 9 and 10 PHP module changes the content of the displayed article or post.

  1. function module_node_view_alter(&$build, $node, $display){
  2. if(in_array($node->getType(),['article','page'])){
  3. $build['body'][0]['#text']=$build['body'][0]['#text'].' Added content';
  4. }
  5. }

Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
Image CAPTCHA
Enter the characters shown in the image.

neanky logo Neanky uudised

Liikluses on endiselt näha väga palju helkurita liiklejaid. Käes on pime aeg ja helkur on väga vajalik. Ilma helkurita pole sa autojuhile nähtav.

Jätka lugemist →

DPD nimel levib petukiri. Re: Pakk saadaval kohaletoimetamiseks. Tollimaks tasuda 24h jooksul. PETUKIRI!

Jätka lugemist →

Neanky tutvumine on turvaline ja mõeldud kõigile. Eestis asuv ja eestlastele mõeldud võrgustik. Lisa oma kuulutus ja leia kaaslane. Ei mingeid lepinguid.

Jätka lugemist →

Vennaskond soojendab Public Image Ltd-d 12. oktoobril 2023 Tallinnas Helitehases Madara 22 A. Johnny Rotten koos bändiga Public Image Ltd

Jätka lugemist →