Preview URL pattern

Hi!

How could I pass a URL to “Domain for your application” like http://one/two/ ?

When I try to do this, I have an error. And it is Impossible to change the url for preview image of my site

Hello Sergey, welcome to the Prismic forum!!

I’m not sure I fully understand what you’re trying to do.

Could you tell me some more details about what you are trying to do?
Where are you trying to add this URL?

Hi!
Yeah, sure… I’m trying to set the preview mode for the site on prismic. And I have the site on the prod and stage environments. I want to make the “stage” one work with unpublished data. And this copy is has a domain name like this pattern: “http://blabla.dev/site/”. When I try to put this domain in prismic admin panel to preview section I have an error, which says that domain name is wrong

Hey Sergey,

Try setting your preview path like this:

Yeah! it works! Thanks Phil!

I have another question according to Preview mode. Can I somehow implement exiting from preview mode?

Hey Sergey,

There should be an ‘X’ beside the preview toolbar to close the previews.

Hey!

The thing is that it doesn’t help. When I click on cross icon, it closes the main toolbar, but the pencil icon is still in there. I need to exit from preview at all

So the pencil is just the edit button, which will bring you to that page in the prismic back end to make changes , rather than the preview. When you see the just pencil then the preview has been exited.

The Prismic toolbar which adds the edit button will always be active if you are a logged in Prismic user, this won’t be visible for your end users.

If you want to complete removed this, which means losing previews and edits, you can remove or turn off the toolbar script. What technology are you using?

Hi! I’m using NextJs. I’ve added toolbar in that way:
const PrismicScript = () => {
const [, repoName] = apiEndpoint.match(/https?://([^.]+)?.(cdn.)?.+/);
return <script async defer src={//static.cdn.prismic.io/prismic.js?repo=${repoName}&new=true} />;
};

I thought that, i can somehow close it at all, because sometimes this huge trigger with pencil overlaps a part of content, but I want to see all picture.

Thank you for your answer! Will think about removing toolbar )

1 Like

This issue has been closed due to inactivity.