HTML: href to index page with clean url - html

I have my button that targets to index.html, but after I click them, my url above is domainname.lt/index.html, but all I want is domainname.lt. What should I do? I have no knowledge what to search. I'm using 'href' attribute.
Thank you in advance.

You should use PHP with the $base_url global variable. Here is a good tutorial on how to use it: https://api.drupal.org/api/drupal/developer!globals.php/global/base_url/7
Hope this is what you mean :D

Both domainname.lt/index.html & domainname.lt will display the same. If needed peculiar,
your link should be like this:
link

Use full url or set it to a variable as global.
$GLOBALS['a'] = 'domainname.lt';

Related

using href or routerlink with #

I'm fairly new to changing paths / position of page so I would like a little help on this.
Say, when a button is clicked, I want to scroll down to another portion of the page. (where id of that section is 'xyz') however, I'm using an entirely different component to access that section.
If I were to use href, I can easily do : href="/app/appid#xyz"
however, if appid is a variable retrieved from the ts file, how can I insert it into my href?
It's easier to to use [routerlink]="['app', appid]" but how can I insert the "#xyz" into my string?
Or is there a completely separate and easier functionality I can use?
Thank you
Add the frament attribute:
<a [routerLink]="['app', appid] fragment="xyz">Link</a>
https://angular.io/api/router/RouterLink

How to remove hyperlink from: a href

How can I remove/prevent a link from being linked to go for a page?
I want it to still be clickable but instead going to a page, just do nothing, stay on the same page.
For example, I have this:
Hyperlink
How can I disable the link of it? Presumably I have to write something else than "nothing"?
use
link
You can try like this:
<a href"#" onclick="doSomething(); return false;">Hyperlink</a>
The return false will prevent the href to go anywhere.
or simply
<a href='#'>Hyperlink</a>
# doesn't redirect but show cursor pointer.
something
if you want to change the cursor property.
add the css
.demo{
cursor:default;
}

How to disable link using bootstrap

Is there a way to disable a image link using bootstrap? Below is my jade code and I tried adding the 'disabled' class and it did not work...
Any ideas?
a(href='/home/action2')
i.fa.fa-share-alt.fa-lg.img.disabled
Try using this:
a.btn.btn-lg.disabled(href='/home/action2')
i.fa.fa-share-alt.fa-lg
a(href='/home/action2' id="myAnchor")
i.fa.fa-share-alt.fa-lg.img.disabled
How about using javascript to change the link to #
and vice versa when you need it.
a(href='/home/action2' id="myAnchor")
i.fa.fa-share-alt.fa-lg.img.disabled
script
document.getElementById("myAnchor").href = "#";
document.getElementById("myAnchor").href = "/home/action2";

hard link a Rel in the URL

Is it possible to make a link such that it brings up the REL of a topic,
for example if a link is
Click here
Is it possible to have a user link so when they go to the page it automatically opens the lightbox?
For example http://example.com/?rel=lightbox&src=picture.jpg
or something like that?
Yes, but no browsers include a lightbox, so you'd need to write or find code to make one of those as well.
Yes, it is possible. You may better use URLs like http://domain.com/#lightbox, and write a little script:
//jQuery sample
$(document).ready(function() {
if (location.hash == "#lightbox") {
//Just show your lightbox manually
}
});
you can do that with a bit of jQuery
$(a[rel=lightbox]).click(function(e) {
// open the lightbox with the link url inside
return false
});

Setting proper relative URL

If I am on the following page:
http://subsite.mysite.com/sites/department/class/SitePages/Home.aspx
and want to have a link to
http://subsite.mysite.com/sites/department/SitePages/Home.aspx
i.e. I want to keep /sitepages/home.aspx and move it one step up in the hierarchy
and not hard code http://subsite.mysite.com/sites/department/
Is this possible?
Thanks in advance.
Try:
My Link or
My Link