No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    how to append slug at the end of URL after loading page

    Help
    3
    4
    714
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N
      netnod last edited by

      can someone point me out in the right direction how can we add route slug at the end of the URL after user navigation … i would like to build the same functionality like the quasar framework forum routing … when the user enters direct link like this one -

      https://forum.quasar-framework.org/topic/2927

      after the route is navigated the post title slug is appended at the end of the link

      https://forum.quasar-framework.org/topic/2927/sanitizing-labels-preventing-xss-attacks

      1 Reply Last reply Reply Quote 0
      • Hawkeye64
        Hawkeye64 last edited by Hawkeye64

        I am going to try and take a stab at this…
        In your src/router/routes.js file, as child data in children you would have the following:

              {
                path: 'topic/:topicId',
                component: () => import('pages/DisplayTopic') // <== name of page
              },
        

        Then, on that page, you can access it like this:
        this.$route.params.topicId

        You can read up on it here: https://router.vuejs.org/guide/essentials/passing-props.html#boolean-mode

        1 Reply Last reply Reply Quote 0
        • Z
          zeidanbm last edited by

          This can best be done server side and that will depend on your server language but will be whatever is handling your routes. So to better explain, you will do a 302 redirect when someone hits a route with topic id and redirect them to the correct url. (Not sure but I think this is how the forum here does it)

          And for the slug you can either store ahead of time in your db or create it on the fly from the title (I prefer the first one)

          Now if you don’t have access to the backend, another way would be using vueRouter (haven’t tested this one and personally prefer the one above) but if you need help on that let me know.

          1 Reply Last reply Reply Quote 0
          • N
            netnod last edited by

            Thank you guys ! i’ll do some experiments and will let you know about the results

            1 Reply Last reply Reply Quote 0
            • First post
              Last post