html links

Topics: Troubleshooting, Visual editor
Mar 28, 2011 at 8:05 PM

My editors have created a page with a similar format to this. The top of the page contains links to the sections that will be covered on the page. These links will cause the page to scroll down to the proper section.

 

Overview of sections:

Jump to section 1

Jump to Section 2

 

 

Section 1:

randomtext...llkajflkaflkalkflkajlkjfalfjkjklfjlkkdas

randomtext...lasdfjl;adsjfalk;jfklajklfjfalkadfkla

Section2

This is very simple to do. One simply would go to the code editor and type <a name="Section1"> <h2>Section 1:</h2></a> near the section that the links should link to,

and then create a link at the top of the page with the Composite link button. When they create the link at the top of the page, they will select the url of the page they are on already and they will just add #Section1.

This is really just basic html here. What I'm wondering is, does composite have a way to do the <a name="jump to here"></a> without having to go to the code editor. My editors are not very good at html. I can train them...but they still will not get it.

 

 

 

Coordinator
Mar 28, 2011 at 8:36 PM

Tooling for anchor links isn't available in the visual editor at the moment - suggest it as a feature request and with enough push behind it we would add it.

You could also handle this slightly different - instead of editing all the sections as one large text blob and doing manual linking etc. you could use the 'page folder feature' and have your editors manage 'sections' as individual elements. A rendering would then take care of doing the link list and the individual elements. I could write up a quick how to if this would be of interest. In that case, let me know if you dig XSLT or ASP.NET for renderings.

Mar 28, 2011 at 8:44 PM

Since the wysiwyg editor in C1 is based on TinyMCE, and TinyMCE supports anchors out-of-the-box it should be a difficult thing to include. I did try to thinker a bit with the xml-file that defines the toolbar - it is located under ~/Composite/templates/wysiwygeitor/toolbar_simple.xml, but i didn't manage to get a new button to show up. According to this page TinyMCE supports a command/button named anchor which should give us what we are after.

Maybe we can get some of the core devs to step in at give their opinion :)

Coordinator
Mar 28, 2011 at 9:55 PM

Anchor support isn't achieved just by getting a button in the toolbar - some handler logic and cutom dialog would be required as well. Tiny MCE is indeed the core running in the visual editor, but if you compare it to the original (like http://tinymce.moxiecode.com/tryit/full.php) you should note some differences.

The file to change to get a new button in there would be \Composite\content\misc\editors\visualeditor\includes\toolbarsimple.inc but as far as I can see there is no 'magic word' that will bring about anchor support.

@WiredEarp ?