You need to sign in to do that
Don't have an account?

Anchor links as VF inlines on standard Account page
I have a large Account detail page. I'm putting a snap shot section on the top, which duplicates data seen elsewhere (via formula fields mostly). I want to put a link to the part of the page where the source data is, and a return link to get back to the snap shot section.
Here are the two VF pages I'm placing as inline VF pages:
<apex:page standardController="Account" > <a name="Snap"></a> </apex:page> <apex:page standardController="Account"> <a href="#Snap"> Back to Snapshot </a> </apex:page>
The "Back to Snapshot" link shows up, but it doesn't do what I'd hope ... reposition the viewer to where I've place the anchor.
What am I doing wrong?
If this isn't possible, what other HTML is not allowed inbetween VF page tags?
Thanks in advance,
This goes in the right direction...
All Answers
This is one of those rare things that will be much trickier than it seems it should be. Here's why - each embedded VF component actually gets its own iframe. They're all pointing to the same record, but basically you have three windows.
So when you click on your href, that particular page has no anchor on the DOM. So it doesn't go anywhere.
In order to resolve this, you'd need to try to jump frames back up to the parent, force a window.scroll() (in a browser friendly way). However, VF might complain about jumping domains, since it is served differently than the standard page layouts.
The most straightforward path is a VF override with the apex:detail component, and then using something like jQuery to add an anchor link / link where desired.
Thanks.
Does anyone have a code snippet which illustrates this (the latter approach)? I found this Stackoverflow Comment which suggests something like:
and I looked in the source of my detail page and noticed block headers are of the 'h3' flavor.
But my jQuery skills aren't as strong as I'd like. Could someone offer some pointers?
Tia,
This goes in the right direction...
If Josh Birk hadn't jumped in and told us what to do, we'd still be floundering. Thanks, Josh, you continue to exceed our expectations by leaps and bounds.
I hope this code snippet helps out other users.