I want to be able to use custom anchors for my Tridion project that is publishing aspx pages. So not the 1, 2, 3 etc when using tridion:anchor="true". The reason for that is that we want to use words that make sens for the visitors.
What I did so far was adding a field "Anchor" in my different schemas and write out this anchor in the different dreamweaver component templates as div with id="value of the anchor"
I created also a menu schema with for the menu items a field anchor. That way I'm already able to link to an anchor on the same page. But now we need to be able also to link to an anchor on a different page. For that I added a component link field in the menu schema. Issue is that I'm a little bit stuck with finding a way to combine the component link and the anchor.
When using page links it seems that tridion:anchor can contain a string instead of true/false. So I was thinking to try to have the same behavior for component links. In that case I see 3 places where I have to do modifications:
LinkResolver
I need to pass the value of tridion:anchor as a string instead of the expected true/false value. Or pass it as a 'new' tridion: parameter.
We have already a custom link resolver so I can do the necessary modifications here.
.net controls
On this place I need to be able to add an extra property so that I can pass the anchor as text to the ComponentLink control instead of the expected true/false value.
I found an article from Will Price about this http://www.tridiondeveloper.com/extending-linking-for-net .
Based on this article I was able to overwrite the ComponentLink control with an extra property and as an extra I modify also the urls to lowercase without default.aspx (SEO stuff)
TCDL Link Taghandler
If I see it correctly than the last thing I need to do is a modifications related to TCDL Taghandler. So that the extra parameter that I added to the ComponentLink control will be added when I publish the page or component. And on this part I'm stuck.
I found an example again from Will Price: http://www.tridiondeveloper.com/cleaning-and-extending-dynamic-linking This is using a TagRenderer and if I understand it correct than this is not rendering the ComponentLink controls but a full url. Unfortunately I didn't find anything about how to overwrite the standard behavior of the tcdl link taghandler
Is the approach I describe above a good one or are there maybe better ways to have readable and manageable anchors to components and pages?
If it's a good approach would it be possible to guide me in the good direction about what needs to be done for the TCDL part.
Thanks for the support.