Is the concept of a link inseparable from its html markup?

I am looking for a link management strategy in articles. The body of the article is stored in the database and stretched during page assembly. What needs to be stored in a database for easy definition and link management?

Some purists believe that markup is NEVER stored in a database. Some people think that everything is in order. But for me, the concept of a link is almost inseparable from its html markup.

Is there a better, more concise way of presenting links in an article (in a database) than simply embedding anchor text?

One of the ideas I put in includes embedding enough markup for a semantic description of areas of interest, and in another table, compare these concepts with actual URLs. All meetings of a certain concept are wrapped in a link.

<p>Here is an example of a <span class="external-reference semantic-web">semantic</span> approach to link management.</p> 

The table can then associate the article URL and the semantic website key class with a URL, such as http://en.wikipedia.org/wiki/Semantic_Web

 <p>Here is an example of a <span class="external-reference semantic-web"> <a href="http://en.wikipedia.org/wiki/Semantic_Web">semantic</a></span> approach to link management.</p> 

What I like about this approach is that all my URLs are in one place in the database. I could technically modify or delete links without touching the body of the article. I have very good class names for CSS.

I don't like having another table for support, but another step / step in the rendering time. This can slow down response time.

Are there other strategies for superior link management?

+4
source share
2 answers

You can see templates (e.g. Smarty for PHP).

I agree that markup should not usually be stored in a database.

However, you can also think about implementing the concept of a "pointer", where for each link you break your memory on the page, add a pointer to the table to the link, and then a pointer in the link table to the next segment of the page content. (I don't know how difficult it would be - just an idea.)

Or see how various CMS tools cope with this idea. Some simply put everything in the database as one big block of text, while others rely on templates, while others can do something completely different (for example, object-oriented environments like Plone ).

+1
source

There are several attempts to do this that I have seen.

One way to do this is to redirect the URL. You can implement a logical component on the server that will interpret what the URL requests, not the path to the content.

Another attempt is that links originally set to a reference value [which can be found in the database] are requested at runtime / generation.

Regardless, you have to link to the material you want to link to with some sort of identifier.

+1
source

All Articles