Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Soft link" element in HTML

Suppose that there is a given HTML subtree which is repeated across multiple points in my code:

<div class='content'>
    ...
    <p>This is repeated many times</p>
    ....
    <p>This is repeated many times</p>
    ...
    <p>This is repeated many times</p>
</div>

Is there a way to create a kind of "soft link" for the first <p> so that each repetition could just point to it? Or there is a better alternative for this kind of problem?

Update

It seems that my question is unclear, So I will try to clarify it by giving an example of a imaginary solution. Suppose that HTML provides an <alias>, which acts like a pointer to another element. So, instead of repeating the same element over and over, I could do something like that:

<div class='content'>
    ...
    <p id='repeat'>This is repeated many times</p>
    ....
    <alias from='repeat'/>
    ...
    <alias from='repeat'/>
</div>

And the HTML would be rendered in the same way.

like image 873
Metalcoder Avatar asked Nov 30 '25 00:11

Metalcoder


1 Answers

So, as @Cerbrus and @bfavaretto have commented, the answer unfortunally is no, there is no way to use something such as an <alias> without resorting to JavaScript. Since search engines ignore JavaScript, they would ignore part of the page, and that would really be bad for the site as a whole.

like image 78
Metalcoder Avatar answered Dec 02 '25 13:12

Metalcoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!