Hi all,
I have the same problem as the original poster. Recently I installed the Semantic Plugin to get link preview for social media. It works in principle, but I would like to exclude some elements from the automatically generated description.
Specifically, we use the Include Plugin to include navigation bars on some pages and I would like to exclude these navigation bars from the description. An example is visible here: https://www.lugamun.org/en/grammar/emphasizing_parts_of_a_clause. The wikitext of the page starts with {{page>nav}}
– in the description that is replaced with the text of the included page, but I would prefer to exclude it altogether. Next is the section header (====== ... ======
) which I would like to exclude as well, since it's identical to the title which is already accessible as metadata.
We also use the Wrap Plugin on certain pages, e.g. https://www.lugamun.org/trans/deklara_unibersi_de_haki_jen. Here I would like to exclude the contents of certain WRAP blocks (specifically, WRAP orig
and, for the navigation bars, WRAP nav
, but not other WRAP blocks) from the description.
I have already found out that the desciption is read from meta['description']['abstract'
, which is written in inc/parser/metadata.php
based on the $this->doc
field in that class. However, I have trouble finding out where and how exactly that field is actually filled and how to skip certain paragraphs when generating the metadata. Any hints appreciated!