We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42101
    • 125 Posts
    Dear People,

    how can I redirect to a page with anchorpoint?

    like this:
    index.php?id=13#contact


    I am using:

    [[!FormIt?
    &hooks=`email, redirect`
    &emailTpl=`email.tpl`
    &emailSubject=`check`
    &emailTo=`[email protected]`
    &redirectTo=`13`
    &redirectParams=`{"#":"contact"}`
    ]]
    


    But this is not working...
    Any suggestion would be very kind! smiley

    Thanks,

    AD
      • 3749
      • 24,544 Posts
      That will give you url?#=contact and that's not going to work. Looking at the FormIt Redirect code, I don't see any way of doing what you want.

      The only thing I can think of is to make the full URL with the anchor the uri of the resource (13) you're redirecting to and check "Freeze uri". That will mean any link to that page will end up at the anchor, though.

      Being able to do it with &redirectParams is a great feature request, though. wink

        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
        • 42101
        • 125 Posts
        Hi BobRay,

        I checked "Freeze uri" but had no success.

        But I found out that if I am using &redirectParams=`{"":"#contact"}` - it could work out - only the "#" is rendered as "%23contact"...
        I also tried html code for the # but it didn't work. It seems to be the json encoding...

        edit: oh no.... it was so easy:

        [[!FormIt?
        &hooks=`email, redirect`
        &emailTpl=`email.tpl`
        &emailSubject=`check`
        &emailTo=`[email protected]`
        &redirectTo=`13`
        &redirectParams=`"#contact"` <---
        ]]


        AD
        [ed. note: ad2003 last edited this post 11 years, 1 month ago.]
          • 3749
          • 24,544 Posts
          I thought of that, but from a quick look at the code, I didn't see how it would work. I'm glad you got it sorted.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 42101
            • 125 Posts
            thanks again for your help