Keeping in-doc links after copying a doc

I have in my doc a link like this:
image
It links to a page in my doc, not to a URL. But when I copy or template my doc, it links to to the original doc, not to the new doc.

Is there a way around this, is it a bug, or…?

Greetings,
Joost

1 Like

Hey Joost - to get around this I always create buttons that utilize the objectLink() formula.

What I will do is choose the first table or control on a page and have the button do something like this:
OpenWindow(table.objectLink())

Hello Scott,

It is a solution, but I go from a nice link (on the right) to a straight text link (on the left):
image. I guess there will almost always be something to link back to, but a page is a page no matter what, while what is on the page can change (your source to get to the modal can be a button, a table, a link, a formula, etc. Your solution is a good workable workaround, but it is not a replacement for a table link.

I don’t template or copy my doc that often, but I think Coda should fix this.

Thanks for your help,
Greetings, Joost

1 Like

Hello there @joost_mineur
You can accomplish this by using only a part of the link of your page
image

So the formula would look like this:
Hyperlink(“Page-1_suo_h”)

If you want to name it as a variable you could add a name to it in this stage, before pressing enter or closing the formula, as it becomes a link.
image

I usually make a table instead of this, with a column for the URL and another with the generated link and select the link I want with the help of the @.

I hope this helps!

4 Likes

Hey @Saul_Garcia ,
Thank you for your suggestions, I will give this a try and let you know my findings.
Greetings, Joost

1 Like

Your suggestion works.

And, the problem with a standard pagelink that doesn’t work after copying a doc seems to have been solved - I can use traditional pagelinks that survive to the next copy. Unless it is something I did wrong in the first place (which I can’t reproduce), it must have been fixed by Coda in a hurry…Coda, thank you for that.

2 Likes

I actually came across the exact same problem as you about ten minutes ago - It wasn’t fixed for me. But I did solve it via the objectLink() formula I was talking about AND it actually does bring over the icon

Hello there!
Just to wrap it up and leave no room for confusion, there are a couple of ways to do this:

I leave a doc with a bit more info on how to do this, so you can check for yourself how it would work:

3 Likes

Thanks! Lots of super useful resources.

Last thing to add - if you use the objectLink method and the object you are referencing is a control on the page (as opposed to a table) that is the first thing on the page, it actually ends up pulling the page name with icon

2 Likes

Ohhh that’s good to know! I’ll add it to the doc!

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.