Using anchor tags within content

15 posts by 6 authors in: Forums > CMS Builder
Last Post: September 16, 2011   (RSS)

By Ginslinger - October 21, 2009 - edited: October 21, 2009

Trying to use CMSB as a extension of a monthly newsletter. This will be setup much like Interactive tools Newsletter with links to a tagged area within the page. I need to be able to use anchor tags for a table of contents which links to the area of content on the page.

I could use some advice on the best way to accomplish this.

Re: [Ginslinger] Using anchor tags within content

Hi Ginslinger,

just a thought, you could use a field in your section editor for the anchor tag, with a "must be unique restriction" and then insert that field in both the "a href" and the "a name" link elements in your viewer.

Hope that gets you started.

Best,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php

Re: [gkornbluth] Using anchor tags within content

By Chris - October 21, 2009

Hi Ginslinger,

The WYSIWYG editor has an "Insert/edit Anchor" button (it looks like a ship's anchor.) You could generate a Table of Contents using some custom PHP code, or just manually create it each time.

I hope this helps. Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Using anchor tags within content

I have tried to use the anchor tag within the editor but could not get it to function correctly. Creating a table of contents within the page is what I would like to accomplish. Couldn't find any documentation on using the anchor tag. Is there something I could be missing?

Re: [Ginslinger] Using anchor tags within content

By Dave - October 26, 2009

Hi Ginslinger,

You can add an anchor tag as follows:
1) Select the place you want to create an anchor.
2) Click the wysiwyg button with a picture of an anchor
3) Enter an anchor name (eg: test)

You can link to the anchor like this:
1) Select some text you want to link
2) Click the chain link button in the wysiwyg
3) Beside "Link Url" enter # followed by the name of your link (eg: #test)

That's how you enter anchor links. There's no way I know of to automatically generate the table of contents content, though. We do ours manually.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Using anchor tags within content

Hi Dave and thanks for the reply. I understand that we cannot generate a table of contents automatically. My question is how do we generate the anchors in the editor so that they can just be selected rather than entering them manually. I have included image that shows how it is demonstrated on TinyMice site.

I spent sometime trying to find documentation on how to add these fields to the editor with no luck. I did finally get them to work manually though.

Thanks for the help.
Attachments:

anchors.jpg 40K

Re: [Ginslinger] Using anchor tags within content

By Dave - October 26, 2009

Hi Ginslinger,

Thanks for the image. It looks like that is using the advlink plugin for tinymce. That's not one we support or ship with CMS Builder, but it is possible to setup with a little work.

1) I've attached a file called advlink.zip. Unzip that and upload the folders to here on your site:
/cmsAdmin/3rdParty/tiny_mce/plugins/advlink

2) Edit /cmsAdmin/lib/wysiwyg.php

3) Search for "plugins:" and edit these two lines and add the code in red:

Around line 18:
plugins: 'safari,inlinepopups,contextmenu,table,fullscreen,paste,media,spellchecker,advlink',

Around line 53:
plugins: "safari,inlinepopups,contextmenu,table,fullscreen,paste,media,spellchecker,advlink",

Then reload the page in your CMS and see if it works.

Note that we don't use those advanced tinymce plugins, but there's some docs for them here: http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink and hopefully my instructions will point you in the right direction.

Hope that helps.
Dave Edis - Senior Developer
interactivetools.com
Attachments:

advlink.zip 16K

Re: [Dave] Using anchor tags within content

Thanks Dave. Very much appreciated.

Re: [Dave] Using anchor tags within content

Hi Dave,
Would this still apply for version 2.07 of cms builder? I'm trying to do the same thing but those instructions haven't changed the image dialogue in tinyMCE for me. I tried it with what I thought was a newer version of the plugin, but still no joy.

Ian