• Register
    • Help

    striker  0 Items
    Currently Supporting
    • Home
    • News
    • Forum
    • Wiki
    • Support
      • Manage Subscriptions
      • FAQ
      • Support For
        • VaultWiki 4.x Series
        • VaultWiki.org Site
    • What's New?
    • Buy Now
    • Manual
    • 
    • Support
    • VaultWiki 4.x Series
    • Feature
    • Option to remove Prefix from link

    1. Welcome to VaultWiki.org, home of the wiki add-on for vBulletin and XenForo!

      VaultWiki allows your existing forum users to collaborate on creating and managing a site's content pages. VaultWiki is a fully-featured and fully-supported wiki solution for vBulletin and XenForo.

      The VaultWiki Team encourages you to join our community of forum administrators and check out VaultWiki for yourself.

    Issue: Option to remove Prefix from link

    • Issue Tools
      • View Changes
    1. issueid=5313 November 29, 2017 8:49 PM
      Forsaken Forsaken is offline
      Junior Member
      Option to remove Prefix from link

      I am going to be using vaultwiki for multiple games, and each area will be a separate game. Having the prefix on each link to another page in the area makes the output look less clean, and is a bit redundant.

      Is there a way to prevent this or can this be added?
    Issue Details
    Issue Number 5313
    Issue Type Feature
    Project VaultWiki 4.x Series
    Category URLs / Routing
    Status Closed (Merged)
    Priority 7 - Minor Features / Enhancements
    Suggested Version 4.0.20
    Implemented Version (none)
    Milestone (none)
    Software DependencyXenForo 1.x
    License TypePaid
    Votes for this feature 0
    Votes against this feature 0
    Attachments 0
    Assigned Users (none)
    Tags (none)




    1. November 30, 2017 12:18 AM
      pegasus pegasus is offline
      VaultWiki Team
      Since areas do not imply a specific prefix, there is no way to prevent this automatically. It would require some level of URL customization when creating/editing pages, which is a feature that is not expected to be ready in the near future. When URL customization is added, offering the option to remove the prefix is something we can consider, although I suspect the feature to be more like a text field which would allow for it anyway.

      In the mean time, you may be able to achieve this with a plugin at hook vw_load_model that extends class vw_URL_Model (see vw_Hard_Core::resolve_class_name in /vault/core/model/vw.php for more info). For example, something like this may achieve your desired effect:
      Code:
      class vw_MyAddon_URL_Model_Plugin extends vw_MyAddon_URL_Model_Proxy
      {
      	public function create_from_title_fallback(&$urlinfo)
      	{
      		$url = parent::create_from_title_fallback($urlinfo);
      
      		if (!empty($urlinfo['areaid']) AND $urlinfo['areaid'] == MY_ID AND !empty($urlinfo['fulltitle']))
      		{
      			$encoded = vw_Hard_Core::model('Encode')->encode($urlinfo['fulltitle']);
      			$url = substr($url, -1 * strlen($encoded)) . $urlinfo['title'];
      		}
      
      		return $url;
      	}
      }
      Reply Reply  
    2. December 2, 2017 5:34 AM
      Forsaken Forsaken is offline
      Junior Member
      Quote Originally Posted by pegasus
      Since areas do not imply a specific prefix, there is no way to prevent this automatically. It would require some level of URL customization when creating/editing pages, which is a feature that is not expected to be ready in the near future. When URL customization is added, offering the option to remove the prefix is something we can consider, although I suspect the feature to be more like a text field which would allow for it anyway.

      In the mean time, you may be able to achieve this with a plugin at hook vw_load_model that extends class vw_URL_Model (see vw_Hard_Core::resolve_class_name in /vault/core/model/vw.php for more info). For example, something like this may achieve your desired effect:
      Code:
      class vw_MyAddon_URL_Model_Plugin extends vw_MyAddon_URL_Model_Proxy
      {
      	public function create_from_title_fallback(&$urlinfo)
      	{
      		$url = parent::create_from_title_fallback($urlinfo);
      
      		if (!empty($urlinfo['areaid']) AND $urlinfo['areaid'] == MY_ID AND !empty($urlinfo['fulltitle']))
      		{
      			$encoded = vw_Hard_Core::model('Encode')->encode($urlinfo['fulltitle']);
      			$url = substr($url, -1 * strlen($encoded)) . $urlinfo['title'];
      		}
      
      		return $url;
      	}
      }
      It can wait for now I just have the people manually doing a wiki title, just in the future it would be more convenient to have the ability to strip the prefix from links.

      With your code, would it be somewhat similar to do the other feature I suggested, which would be a per-area navigation system? Even if it's through conditionals, or just including different templates that would work.

      We're likely going to have ~5+ active areas so being able to offer a per-area navigation to simplify finding information would be very important.
      Reply Reply  
    3. January 17, 2021 5:34 PM
      pegasus pegasus is offline
      VaultWiki Team
      Merged with: https://www.vaultwiki.org/issues/2007/, which will be implemented in 4.2.x. In the new branch, users with appropriate permission can set custom URLs for each wiki page, within admin-specified paths. To remove a prefix, you would use a custom URL with only the text you want.
      Reply Reply  
    + Reply

    Assigned Users
    Loading Please Wait
    Tags
    Loading Please Wait
    • Contact Us
    • License Agreement
    • Privacy
    • Terms
    • Top
    All times are GMT -4. The time now is 8:22 AM.
    This site uses cookies to help personalize content, to tailor your experience, and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Learn more… Accept Remind me later
  • striker
    Powered by vBulletin® Version 4.2.5 Beta 2
    Copyright © 2025 vBulletin Solutions Inc. All rights reserved.
    Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
    Copyright © 2008 - 2024 VaultWiki Team, Cracked Egg Studios, LLC.