hello,
i cant seem to use this feature properly on the pages i create using the design page feature.
i create a link anchor on a text (example: professional) then make another text item on the same page call "professional".
but when i click it, it goes to: http://myurlname.com/#professional
im confused . com
any help please?
i cant seem to use this feature properly on the pages i create using the design page feature.
i create a link anchor on a text (example: professional) then make another text item on the same page call "professional".
but when i click it, it goes to: http://myurlname.com/#professional
im confused . com
any help please?
You mean you created a link like so...
<a href="#professional">Professional Information</a>
and created the anchor...
<a name="professional"></a>
And it doesn't work?
<a href="#professional">Professional Information</a>
and created the anchor...
<a name="professional"></a>
And it doesn't work?
http://www.alreadymade.com
Follow me on twitter.com/alreadymade
so my coding kinda looks like:
this is the link button.
then half way down the page i want it to jump to the coding of:
is that right? because when i click on it i get: http://myurlname.com/#consumer
this is the link button.
Code: Select all
<h3><a href="#consumer">For Consumers</a></h3>
Code: Select all
<p class="intro"><a name="consumer">Consumer</a></p>
Try this:
You were trying to use a relative anchor.. but since the page load is relative to the root path, I don't think it will work that way. Not sure.. anchors are so 1999
Code: Select all
<h3><a href="<?php echo $_SERVER['PHP_SELF'];?>#consumer">For Consumers</a></h3>
cheers Q,
but when i tried that as you said i get this as the URL:
http://mydomainname.com/%3C?php%20echo%20$_SERVER['PHP_SELF'];?%3E#consumer
Not Found
The requested URL /< was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.41 Server at myurlname.com Port 80
but when i tried that as you said i get this as the URL:
http://mydomainname.com/%3C?php%20echo%20$_SERVER['PHP_SELF'];?%3E#consumer
Not Found
The requested URL /< was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/1.3.41 Server at myurlname.com Port 80
eh? why is it urlencoding... ill try it in a bitDannyMacD wrote:cheers Q,
but when i tried that as you said i get this as the URL:
http://mydomainname.com/%3C?php%20echo%20$_SERVER['PHP_SELF'];?%3E#consumer
I believe I've managed to solve this problem. Posting it here in case someone will need it someday
Link should be created this way:
Of course do not forget to set anchor somewhere in document:
Link should be created this way:
Code: Select all
<a href="<?php echo $_SERVER["REQUEST_URI"]; ?>#anchor">link</a>
Code: Select all
<a name="anchor">Jump here</a>
Put this in your header template:
Code: Select all
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("a[ href ^= '#' ]").each(function() {
var href = window.location + jQuery(this).attr('href').replace('/#.*/i','');
jQuery(this).attr('href',href);
});
});
</script>
thaaaaaaaaaaaanx promofire
I have the anchor problem with my website and ur code is v helpful .. It works with me
i wrote the code in the header of the source of every info page
I really appreciate your help
thanx again
a little modification on 11th may . i can understand more now the web developers & designers terms
I put the code in header template before head end. I think this is what u meant about "your header" to avoid putting the code every time I create an info page.
I have the anchor problem with my website and ur code is v helpful .. It works with me
i wrote the code in the header of the source of every info page
I really appreciate your help
thanx again
a little modification on 11th may . i can understand more now the web developers & designers terms
I put the code in header template before head end. I think this is what u meant about "your header" to avoid putting the code every time I create an info page.
Last edited by Lamiaa on Wed May 11, 2011 3:02 pm, edited 1 time in total.
I tried this method and it doesn't seem to work for me.
I added the above code to the header and used the following within the html editor of an information page...
The link is displayed as "#anchor">link" and when clicked it brings up "the page you have requested cannot be found"
The URL its directing to is
What am i doing wrong?
I added the above code to the header and used the following within the html editor of an information page...
Code: Select all
<a href="<?php echo $_SERVER["REQUEST_URI"]; ?>#anchor">link</a>
<a name="anchor">Jump here</a>
The URL its directing to is
Code: Select all
domain.com/<?php echo $_SERVER[
Try it like this, I think where you place the code matters.
In catalog/view/theme/YOUR TEMPLATE/common/header.tpl, look for this section (which should start somewhere near line 44, your line may vary slightly due to any mod differences):
AFTER that, immediately after the closing tag for the script (last line above), put the code from above (comments added here for reference):
The next thing, immediately after what you just added, should then be the opening tag of another script.
In catalog/view/theme/YOUR TEMPLATE/common/header.tpl, look for this section (which should start somewhere near line 44, your line may vary slightly due to any mod differences):
Code: Select all
<script type="text/javascript">
$(document).ready(function() {
<?php if($fancy_default) { ?>
$("a[rel=fancy_group]").fancybox();
<?php } else { ?>
$("a[rel=fancy_group]").fancybox({
'transitionIn' : '<?php echo $fancy_transition_in; ?>',
'transitionOut' : '<?php echo $fancy_transition_out; ?>',
<?php if ($fancy_overlay_show) { ?>
'overlayShow' : true,
<?php } else { ?>
'overlayShow' : false,
<?php } ?>
'overlayColor' : '<?php echo $fancy_overlay_color; ?>',
'overlayOpacity' : <?php echo $fancy_overlay_opacity; ?>,
<?php if ($fancy_autoscale) { ?>
'autoScale' : true,
<?php } else { ?>
'autoScale' : false,
<?php } ?>
'padding' : <?php echo $fancy_padding; ?>,
'margin' : <?php echo $fancy_margin; ?>,
<?php if ($fancy_cyclic) { ?>
'cyclic' : true,
<?php } else { ?>
'cyclic' : false,
<?php } ?>
'speedIn' : <?php echo $fancy_speedin; ?>,
'speedOut' : <?php echo $fancy_speedout; ?>,
'changeSpeed' : <?php echo $fancy_changespeed; ?>,
'changeFade' : '<?php echo $fancy_changefade; ?>',
<?php if ($fancy_show_closebutton) { ?>
'showCloseButton' : true,
<?php } else { ?>
'showCloseButton' : false,
<?php } ?>
<?php if ($fancy_show_navarrows) { ?>
'showNavArrows' : true,
<?php } else { ?>
'showNavArrows' : false,
<?php } ?>
<?php if ($fancy_enable_escapebutton) { ?>
'enableEscapeButton' : true,
<?php } else { ?>
'enableEscapeButton' : false,
<?php } ?>
<?php if ($fancy_title_show) { ?>
'titleShow' : true,
<?php } else { ?>
'titleShow' : false,
<?php } ?>
'titlePosition' : '<?php echo $fancy_title_position; ?>',
'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' ' + title : '') + '</span>';
}
});
<?php } ?>
});
</script>
Code: Select all
<!--START Anchor Redirect-->
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("a[ href ^= '#' ]").each(function() {
var href = window.location + jQuery(this).attr('href').replace('/#.*/i','');
jQuery(this).attr('href',href);
});
});
</script>
<!--END Anchor Redirect-->
The jQuery piece of code in the header is nice, but know that it may break the DIV tabs functionality. For example, the Description and Reviews tabs on the product page, which look like this:
Code: Select all
<a href="#tab-description"><?php echo $tab_description; ?></a>
<a href="#tab-review"><?php echo $tab_review; ?></a>
Hello all - just in case anyone else is still struggling with this - I think I've figured it out!
All you need to do is create the anchor as normal for the part of the page you wish to reference and then choose link to URL when you are creating the hyperlink to the anchor, and not link to Anchor.
When you type the URL in just add #anchorname at the end and it seems to work.
Hope this helps someone else.
I'm using vs 1.5.1.
All you need to do is create the anchor as normal for the part of the page you wish to reference and then choose link to URL when you are creating the hyperlink to the anchor, and not link to Anchor.
When you type the URL in just add #anchorname at the end and it seems to work.
Hope this helps someone else.
I'm using vs 1.5.1.
No, if you're doing it as it should be, it won't affect these at all. I have it in place and these tabs work exactly as they were designed.marioj wrote:The jQuery piece of code in the header is nice, but know that it may break the DIV tabs functionality. For example, the Description and Reviews tabs on the product page, which look like this:
Code: Select all
<a href="#tab-description"><?php echo $tab_description; ?></a> <a href="#tab-review"><?php echo $tab_review; ?></a>
@Sidecutter - is your system better for SEO reasons than just adding the full URL and #anchorname to a URL Hyperlink? If so and you are sure that it works perhaps I should be doing your method instead! Any thoughts? The system I have been using does seem to work well but I'd like to know if its stuffing anything else up!
Will
Will
To be fair, it's not my system, it's all Promofire's. I just tried to pass on what I did to make it work properly so it would be easier for others to do. Granted, the info I gave is good for 1.4.9.3 to 1.4.9.6 based on my personal testing of those versions, I don't have 1.5 going even as a test right now so the use of the code there may vary wildly, or the code itself might need to be different.will_c wrote:@Sidecutter - is your system better for SEO reasons than just adding the full URL and #anchorname to a URL Hyperlink? If so and you are sure that it works perhaps I should be doing your method instead! Any thoughts? The system I have been using does seem to work well but I'd like to know if its stuffing anything else up!
Will
I don't think either method would make any difference in terms of SEO. Since for me it only really comes into play on the FAQ, it's not anything I'd be worried about optimizing for anyway. Both ways lead to the same data when the links are followed since the site automatically fills in the rest of the URL - hover over a clean anchor versus your method, and you'll see they point to the exact same address. The only difference is it would seem to be more of a pain in the arse to redo it or alter it using hard-coded links that included the full URL.
I've been trying to make this work with 1.5.1.3 so that when someone clicks the "read a review" and "write review" links, it jumps to the review tab. Cannot figure it out though - with the javascript added above, my page jumps to the reivew links when the page is loaded.
What do I need to change for it to work?
What do I need to change for it to work?
Running Opencart v3.0.3.2 with multi-stores and the default template from https://www.labeshops.com which has links to all my stores.
Who is online
Users browsing this forum: paulfeakins and 67 guests