Anchor Links - Change Names

Rate this topic: Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.Evaluations: 1, 1.00 on the average.1.00 out of 6 based on 1 vote(s)
GK User
Wed Jun 12, 2013 4:28 pm
Reply with quote
Report this post
Hi...So I want to change the anchor link names, ie #gkHeader on the frontpage and Im not sure where to do it. I have tried the following:

I have tried editing the default.php in /public_html/templates/gk_creativity/layouts and renaming the id="gkHeader" to ourwork and it will jump down but to past the h1 Title for the Module not where it should jump to.

Any ideas?
User avatar
Fresh Boarder

GK User
Wed Jun 12, 2013 7:29 pm
Reply with quote
Report this post
Correct me if I'm wrong - You would like to change menu elements to point to different anchors than they point now?
Could You show me url to your site and point which element should point where, then Ill be able to tell You exactly what to do. No default.php editing is necessary - everything can be done from Joomla backend :).
User avatar
Moderator

GK User
Thu Jul 25, 2013 3:55 pm
Reply with quote
Report this post
Guys,

Nobody is answering the question when I search the forums:

We want to change the name #gkHeader in the url. Like: http://www.mysite.com/#gkHeader
Please give us a solution to change the name to #Whatwedo as example :)

Thanks in advance.
User avatar
Fresh Boarder

GK User
Thu Jul 25, 2013 4:08 pm
Reply with quote
Report this post
@remcosmit
I'm not quite sure what do You mean - where You would like to change this link?
If in menu on homepage of creativity, then go to administrator, Menus -> Main Menu, then click on desired position and change what is entered in "link" field.
User avatar
Moderator

GK User
Thu Jul 25, 2013 4:21 pm
Reply with quote
Report this post
Thanks for the quick response.

When opening the Creativity template on the frontend and click on the "What we do" button
the intro slides up and reveals "What we do"
Now in the url you see http://www.mysite.com/#gkHeader.

When you click on the menu Contact you will see http://www.mysite.com/#gkBottom1 in the url.

I like to change the url in someting else like http://www.mysite.com/#Whatwedo

If I change the link in the menu and in the module (intro) GK4 then onepage flow is gone. Links do not work.
User avatar
Fresh Boarder

GK User
Thu Jul 25, 2013 4:28 pm
Reply with quote
Report this post
You need to understand how it works.
#ANCHOR will look in source code of the page for element with ID ANCHOR and scroll to it, so If You would like to change name of the anchor, You would need to either edit template core layout files, or modify the way joomla generates the ID's of the elements. While first solution is less or more easy to do (while changing the ID's You also need to correct all CSS files), the second one is quite impossible to do.
So as long as You use ID's that are provided automatically You can add/remove or relink almost anything in menu, if You would like to change ID's of elements - now You know why there is no solution for that.

But there is an idea that comes into my mind. For elements that are entered with use of customHTML module, You can place empty div in the beginning of that module for example:
<div id="myAnchor"> </div>
and link to it with use of #myAnchor
User avatar
Moderator

GK User
Sun Jul 28, 2013 11:20 pm
Reply with quote
Report this post
Hi folks, any way to use rewriting (.htaccess) and solve this thread?
User avatar
Fresh Boarder

GK User
Mon Jul 29, 2013 7:07 am
Reply with quote
Report this post
Rewrite works only if page is reloaded and translate one adress into another. It doesn't affect #anchors in links anyhow.
User avatar
Moderator

GK User
Tue Jul 30, 2013 9:25 am
Reply with quote
Report this post
Thx Cyberek. I tried the trick you provide <div id="myAnchor"> </div> it works fine although it needs a css update otherwise the module doesn't display correctly. Too low in my case (title doesn't show up). Any css trick will be welcome. ;)
User avatar
Fresh Boarder

GK User
Thu Aug 01, 2013 5:27 pm
Reply with quote
Report this post
@aktineo - if You havent modified any core.php files, You might try to replace div with span or a element (there might be a css declaration that uses element > div addressing, and if Your div catches on it, this gonna be the cause).
So try:
Code: Select all
<span id="myDiv"></span>
<a id="myDiv"></a>
<i id="myDiv"></i>

one of them should work fine.
User avatar
Moderator

GK User
Mon Oct 21, 2013 5:10 pm
Reply with quote
Report this post
@Cyberek Thx, Implementing the code <div id="myAnchor">module_2</div> at the end of the module_1 for module_2 works like a charm
User avatar
Fresh Boarder

GK User
Mon Oct 21, 2013 7:09 pm
Reply with quote
Report this post
Well, its all because of paddings and spaces between elements. If element with anchor has top padding, it might scroll correctly, because top of element will go to top of the browser, but padding will move content down. If top padding of an element is to less - then menu overlaps scrolled content.
User avatar
Moderator


cron