Orchard Core Razor Tag Helper unexpected redirection - razor

I'm building a decoupled CMS site using Orchard Core. I have a strange issue where asp-page tag helper redirects me to a URL path on the admin panel. Example:
<a class="nav-link text-dark" asp-area="" asp-page="/Privacy">Privacy</a>
redirects to
https://localhost:7181/Admin/OrchardCore.Settings/Admin/Index?page=%2FPrivacy
I might have accidentally messed up something in the Orchard configuration, I've been playing with it a lot, but now I cannot quite make it behave as expected.

You need to specify the 'asp-area' attribute to be the name of your module.

Related

No webpage was found for the web address: http://localhost:XXX/login in ASP. NET CORE 6 Web App

I have created a web app using razor pages in ASP.NET Core 6 and I am reaching a problem when it comes to adding a new razor pages link into the _Layout.cshtml. Every time I try to test the website and press the link to new page I added, it does not send me to that page.
I have looked into the razor pages properties and matched the Build property with Content hoping that was the reason why it was not working but I was unsuccessful.
I have also tried adding to the page link so that it can clearly find it, but it did not work.
<li><a asp-page="Pages/Login"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
The value that you pass to the asp-page attribute is the relative path to the page rooted in the Pages folder, which means that you should not include "Pages" as part of the value:
<a asp-page="/Login">

Why do links to social media do not work using html?

I have the following code in my html. When I click on the icon I want to be taken to my websites facebook account.
<li><a href="www.facebook.com/mywebsitename"><i class="fa fa-facebook" aria-
hidden="true"></i></a></li>
However instead I get my webpage without any css and the url changes to the following url. Why is this?
https://mywebiste.com/www.facebook.com/mywebsite
The URL is considered as a directory Path. try to replace
href="www.facebook.com/mywebsitename"
to
href="https://www.facebook.com/mywebsitename"
Your URL should be starting with a scheme:
<a href="https://www.facebook.com/mywebsitename">
See more here: What_is_a_URL
This happens because you didn't write the beginning of the line address. He directs you to your own page in this project because he doesn't know where to go. Use https://.
<a href="https://www.facebook.com/mywebsitename">

Why do links with rel="noopener noreferrer" always open in a new tab?

We have a website with multiple links to a web application. The intended behaviour is that the first click on any of the link should open the web application in a new tab, any subsequent click should open the web app in the same new tab.
We do this because our users only want one instance of the web app open at the same time.
This works with adding the targetattribute to the links:
<a https://example.com" target="webapp-tab">Link 1</a>
<a https://example.com" target="webapp-tab">Link 2</a>
But our CMS automatically adds rel="noopener noreferrer" to all links, so the links will look like this:
<a https://example.com" target="webapp-tab" rel="noopener noreferrer">Link 1</a>
<a https://example.com" target="webapp-tab" rel="noopener noreferrer">Link 2</a>
The problem is that this changes the behaviour. Each click on any of the links will now open a new tab.
Is there a specific reason why the behaviour changes? From what I understand the difference should only be that no referrer and opener information will be sent with the request, but why does it open in a new tab?
Is there anything I can do to keep the original behaviour even if rel="noopener noreferrer" is added to the links.
but why does it open in a new tab?
Seems to be specified that way, https://developer.mozilla.org/en-US/docs/Web/HTML/Link_types says:
Note that when noopener is used, nonempty target names other than _top, _self, and _parent are all treated like _blank in terms of deciding whether to open a new window/tab.
My guess - with a different tab name specified by the application itself, there’s probably concerns that some sort of info that is not supposed to leak, could leak nonetheless - for example if a different script opened a tab with that name first, but without noopener - then it could have a reference to that tab, and still use that reference to access the contents later on, when the user opens a link that explicitly has noopener set.
Is there anything I can do to keep the original behaviour even if rel="noopener noreferrer" is added to the links.
That would likely undermine the security this feature is supposed to provide in the first place.
You can try and have a JS run over your document after it is loaded though, and have it remove the rel attribute from those links, resp. remove the noopener part from its value.
Then you would of course not get any of the “protection” this feature provides, but opening the links all in the same tab should still work.
Edit: A simple way to set the attribute value to an empty string for all links that have this particular target set, would be
document.querySelectorAll('[target="webapp-tab"]').forEach(function(e) { e.rel = ''; } )
(Make sure to execute that after the document has loaded, of course.)

Anchor tag not working on mobile bootstrap 3

I've recently added an anchor tag to our homepage and it works fine on desktop but on mobile the link is not working.
I've searched for answers that do not involve adding additional Java or CSS amends (I do not have the ability to make those changes). Is there anything via the html that can ensure this works without me having to wait for one of our developers to investigate (lack of resource is killing me right now).
<a class="btn btn-lg navbar-btn btn-dollar" href="#works">See how it works</a>
I've added the corresponding id to a <div id="works"> further down the page.

What does rel="nofollow me" do?

I notice on SO userpage all urls have rel="nofollow me" (i was thinking of putting nofollow on my site so i checked here to see what SO does). What does the 'me' part do?
This is a combination of two independent uses of the rel attribute.
rel="nofollow" tells search engines to ignore the link when ranking pages.
rel="me" is a microformat
rel="me" is a link from a page about a person to another page about the same person.
Basically Rel="nofollow" not to follow link or not share your website repo to that page. This page could be internal as well it could be external page.
Rel="me" To give a social Repo to that page.
Rel="nofollow me" Means not to follow link but pass social repo to that page. Usually Facebook is a great example. From SEO point of view, now SEs are also considering social factors and I recommend to build your link on relevant page with high rate of traffic.
<a rel="me nofollow" href="https://example.org">
"me" instructs the search engines that the external website being linked(example.com) is another expression of me.
The page where "me" appears and the destination website listed into the href field have the same owner.