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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With