WordPress.org

Ready to get started?Download WordPress

Ideas

Easy and bulletproof internal links

  1. thomask
    Member

    12345

    Today's linking from posts/pages to other internal pages, posts, categories, custom post types ... is stupid - you have to first look for the actual URL, click anchor, and type the URL. The URL is then absolute, it cannot be changed (easily for all articles, e.g. when you change the url schema, domain etc.) , it cannot be managed by filters etc.

    There are some ideas here with similar needs, mostly with 5 stars, but this one is going to more depth. Sometimes they are commented that this is plugin area, but i strongly disagree - this should be global wordpress function - same should be not only for linking in creation of anchors, but also for links created when placing image with anchor, for links in Links etc.

    My idea: When you click [A]nchor button in TinyMCE, there would be
    a) plain inputbox as today
    b) Select box with all Pages
    c) Other select boxes for other custom post types if allowed in them
    d) search box with ajax, which would search all Posts, Pages and custom post types
    e) Select boxes with categories, tags ....

    If you e.g. select some page, it would not insert it's actual page, but it could do one of theese
    a) put there relative permalink (?p=1 for page with ID 1, c=1 for category with with ID 1 etc.)
    b) put there some shortcode, e.g. [p=1]
    c) some special code in anchor class, e.g. class="internal-link-page-1"
    etc.

    Theese permalinks/shortcodes/etc. would be then examined and replaced for their actual address (with some options e.g. if to show relative/absolute).

    There need to be caching, so the database should be not examined for every link on every post/page on every request, but the actual link should be somehow saved and rebuilded for whole database only on request (e.g. on permalink structure change).

    Posted: 4 years ago #
  2. Sluff
    Member

    12345

    This should feature would be really nice. I actually use a plugin for this, but it should be a "native" function of WP.

    One extension to your idea: There should be a function for template designers that provides the "witch internal page is linking to me" information.

    Posted: 4 years ago #
  3. CircleReader
    Member

    12345

    This is really a great idea! It could be used to add hand-picked related posts, as with the Microkid's Related Posts plugin (though that can make those links reciprocal, which would be out of scope here), but it would make any sort of cross-linking easier, and cross-linking is good!

    I'm wondering how the scheme above would scale. What if you have lots of Pages, custom post types, categories, etc? A drop-down "select box" could get unwieldy. Could it be done with an AJAX search box as in (d) and the MRP plugin, but with check boxes to indicate what to search: posts, custom thingie types, categories, tags/taxonomies, etc. When searching categories, tags & custom post types, the option to link to the whole category or whatever could be the first search result.

    For Networked sites in 3.0, I'd definitely want a check-box to search other sites/blogs in the same network. In that case the shortcode (or whatever) that was inserted would have to indicate site/blog ID as well as post/category, etc IDs. (Right? Does WP.com have an easy way to link to other WP.com blogs?

    I agree that this should be a core feature, but what plugins besides MRP do this sort of thing?

    Posted: 4 years ago #
  4. spacechampion
    Member

    12345

    I have been thinking about this idea before I saw your post, including the idea of making links searchable from the tinymce interface.

    I think Links should have categories and tags associated with them. Internal pages/posts and media (which should also be tagged and categorized) should have their pretty permalink urls listed in the Links table of the database, instead of the post table.

    Then you could list on the tag page ALL posts, pages, media and other links that have that tag. Imagine a tag for Tiger Woods, the tag page for that would list everything you every wrote about him, everything you linked to about him, and every media file you uploaded about him.

    By the way, the new Menu system in 3.0 beta1 is interesting, but why are nav_menu_item types listed in the post table? Nav_menu_items are just urls, they don't need content fields and what not that are part of the post table.

    Back the original poster's idea -- I'd say make the shortcode work for external links too, like use ?link=ID. And why are posts referred to by ?p=ID and pages by ?pages=ID -- you don't search for all pages by the url link, you search for them by post_type field. So all pages, posts, media and links could have their reference url formatted the same way, ie. ?link=ID.

    In the Link table then you'd have fields for the link_ID, link_type, link_url, link_terms, and pretty_link for the internal post/page/media permalinks.

    And instead of just post_meta, options and user_meta, maybe all meta data in one table and including link_meta and media_meta so whole new plugins to add custom meta data to links and media could be created -- for example child/parent relationships so that galleries and presentations could be constructed, sequences of links could be ordered in some fashion (by date for news links for instance).

    I think this would put WordPress at the forefront towards moving to the Semantic Web.

    In terms of hooks, we'd need things like:

    get_tag and get_category to have an extra parameter to search for type ie. link, media, post, page, resources (both links and media), content (both posts and pages), and all (all 4 types). You could host a video site with embeds and/or hosted video and not have to create a post for each video in order to display them. You could make a custom link type for iPad or Android apps, and link to a collection of your apps from the respective app stores without having to create a post but still get it into search engines and feeds.

    I'd guess media and links would have to be retrievable from the loop query independent from posts and pages. Or rather, the loop query would search through the link table for the link_type you want (including posts) instead of the post table for the post IDs. Okay, I realize that would maybe break most plugins, but I think it makes better sense and those will probably have to be update anyway.

    Posted: 4 years ago #
  5. ambrosite
    Member

    Sluff, what plugin are you using for this? I've thought about writing a plugin myself to do some of this, but I don't want to duplicate anyone else's work.

    Posted: 4 years ago #
  6. Paolo Melchiorre
    Member

    12345

    Great Idea!

    I just use this function with Kupu (default editor) and TinyMCE in Plone, and is a necessary function for the evolution WordPress for a real CMS.

    For example:

    <li>
    <ul>
    <a href="http://plone.org/documentation/manual/plone-3-user-manual/adding-content/adding-pages">Inserting internal links in Kupu (default editor)</a>
    </ul>
    <ul>
    <a href="http://plone.org/products/tinymce/documentation/manual/tinymce-user-manual/links">Inserting internal links in TinyMCE</a>
    </ul>
    </li>
    Posted: 4 years ago #
  7. IstanbulMMV
    Member

    12345

    Excellent idea. Easy internal linking based on somethimg like the RB Internal Links plugin would be a very nice addition to the WordPress core.

    Posted: 4 years ago #
  8. roadie
    Member

    This would be really useful for me.
    At the moment I am developing a blog on my own computer and my links in the content are of the form e.g.
    http://localhost/wordpress/about/purchase/

    Presumably I could use relative links which would be something like
    ../../../about/purchase
    depending on where one is in the page structure, but that would be easy to get wrong, especially if you change the page structure.

    At some point I will want to move all this to an internet domain.

    What would be the easiest way to reduce the amount of editing I will have to do?

    Posted: 4 years ago #
  9. Micah Cooksey
    Member

    12345

    This would be very useful, especially if you build the site on a test install and plan on moving the site. That way you wouldn't have to change the urls for all your internal links.

    Posted: 4 years ago #
  10. Andy Macaulay-Brook
    Member

    12345

    Use the Link to Posts plugin?

    Posted: 3 years ago #

RSS feed for this topic

Reply

You must log in to post.

  • Rating

    12345
    26 Votes
  • Status

    This idea has been implemented