Unable to Save File with Route to ./ in HREF

Wappler Version : 3.5.7
Operating System : Windows 10
Server Model: ASP.NET
Database Type: MSSQL
Hosting Type: Local IIS

Expected behavior

Setting ./ in href to go to home page should save in the file.

Actual behavior

On selecting route from picker in properties panel

<li class="nav-item active"> <a class="nav-link style2 active" href="./">Home</a> </li>

After saving the file

<li class="nav-item active"> <a class="nav-link style2 active" href="/">Home</a> </li>

Loosing the . means the page does not route to home, instead it just loads the home page as a redirect (page refresh).

Current Workaround

<li class="nav-item active"> <a class="nav-link style2 active" href="#" dmx-on:click="browser.goto('./')">Home</a> </li>

@Teodor Can you please confirm if this is a bug or am I doing something wrong?

@patrick can you please help with this?

Do you have set the links relative to the site root? I believe it gets saved correctly when you set links relative to the document. We will have a look at it.

Yes, its site root.
Its a ASP .NET SPA project. Would changing to document affect anything else like other route links?

I’m sorry but I think you had tried to explain this to me sometime ago also, but I still don’t understand how “links relative to” works.

A link relative to your document looks like:

../../some_link.html

when relative to root, It will look like

/some_link.html
1 Like

Thanks Teodor. But I still can’t wrap my head around it. :cry:

The actual location of the file some_link.html is same in both cases right?
And the page where I have this link, eg: some_page.html, is in the same location as some_link.html right?

Sid,
In the following situation:

where the page you create your link on is located in such a nested folder structure. The link to a document located in the site root level will look like:

With links relative to document: <a href="../../index.html">Link</a>

With links relative to site root: <a href="/index.html">Link</a>

really not that complicated. This option sets how the links to files are generated on your pages.

2 Likes

That does it. I think I get it now. Thanks :slightly_smiling_face:

1 Like