• Hi Guest!

    We are extremely excited to announce the release of our first Beta for VaM2, the next generation of Virt-A-Mate which is currently in development.
    To participate in the Beta, a subscription to the Entertainer or Creator Tier is required. Once subscribed, download instructions can be found here.

    Click here for information and guides regarding the VaM2 beta. Join our Discord server for more announcements and community discussion about VaM2.

Easier links to resources or permalinks

Acid Bubbles

Invaluable member
Developer
Featured Contributor
Joined
May 11, 2020
Messages
1,403
Solutions
10
Reactions
5,807
It would be nice to reference resources directly. For example, if I want to reference Timeline right now I have to link to this, which will break later: https://hub.virtamate.com/dev/index.php?resources/timeline.94/

I'd like instead to be able to do something like this:

Code:
[VAMRESOURCE]AcidBubbles.Timeline[/VAMRESOURCE]

Or if it's easier include the resouce ID. Even better would be to have .var references auto-parsed (like it's happening already for embeddable links) but that's just bonus.

The alternative is a permalink, e.g. https://hub.virtamate.com?type=resource&author=AcidBubbles&name=Timeline with an option to generate it on the resource page.

Anyway those are all options to solve the same issue, reference resources easily and in a way that won't break if routing changes.
 
The link will point to the newest version of the resource. Is that not intended? The 94 is the resource ID, not the version.
 
I understand that this is the resource ID, but the /dev will go away and links will break. Eventually you might want to add routing and links will break (e.g. hub.virtamate.com/resources/foo.94/). Since links to resources will be posted everywhere (discord, reddit, patreon, etc.) I'm wondering if you want to rely on the /index.php base route "forever".

Nothing's broken, it's just future proofing :)
 
Yeah dev will go away, but I expect index.php to stay.
 
Did you look at implementing url rewriting? While it's not _that_ important, it should be fairly easy to enable (Apache's RewriteEngine rules are fairly straightforward) and would make much nicer urls :) This would also eventually allow you to handle them using a preprocessor if for _any_ reason the way to access resources have to change.

Code:
Before:
https://hub.virtamate.com/index.php?threads/easier-links-to-resources-or-permalinks.211/#post-558
After:
https://hub.virtamate.com/threads/easier-links-to-resources-or-permalinks.211/#post-558
 
I was thinking when I remove dev I'll have a rule that rewrites dev to new path so any links created to date using dev will still work. But yeah I see how it looks cleaner without index.php? in there. There are a lot of routes in XenForo and new ones can be added, so I'm not sure I want to maintain all those rewrite rules.
 
Actually the route would just take the query and send it as the path. I'm sure you can find rules for XenForo you can use as is. If not, not a big deal either :)
 
I discovered Xenforo actually has a friendly URLs option built-in. I'm testing on the test server now. So you will get your wish. :)
 
My wish is to invoke the triggers UI from a plugin, but nice urls are nice too :D
 
I'll eventually get back to working on VaM itself. :)
 
Seriously I consider myself a pretty productive person, but I hold you and what you're doing in very high esteem. Most people don't realize what's happening under the hood, but I peeked and it's damn impressive. So like I said before, no pressure from me! (just friendly reminders once in a while as long as you still consider it - if you think it's helpful)
 
@Acid Bubbles Thank you! Coming from you that means a lot! Yeah there is some complex shit under the hood of VaM, much of it too complex, and I have only myself to blame! I plan to remedy a lot of that in 2.X, as you are probably getting tired of hearing me say. :)
 
OK - friendly URLs are on. In addition, I have gone ahead and made 'dev' redirect to top-level. Any existing links you used should still work, but will redirect to top now. Hub is still not externally accessible from https://hub.virtamate.com since that is how I want it for now until public launch. :)
 
Back
Top Bottom