2

I am using CKEditor in my drupal 7 website. I am designed a new content type, in which I am writing about project activities in the following manner.

(1) Project A [anchor]
     This project describes about the design and analysis of Binary Search Tree
(2) Project B [anchor]
     This project describes about the design and analysis of Red Back Tree

Now, from a different page, I want to provide a link to anchors in following way-

The Binary Search Tree [as described here] also called an ordered or sorted binary tree.

I wanted to know using CKEditor-

  1. How to create links (anchors) inside a page?
  2. How to add these links to text on a new page?

closed as off-topic by Mołot, Елин Й., Letharion, Krishna Mohan, kiamlaluno Oct 28 '14 at 10:34

  • This question does not appear to be about Drupal within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 1
    This question appears to be off-topic because it is about CKEditor, not Drupal. – Letharion Oct 15 '14 at 4:55
  • @Letharion: The question is already answered. See below before posting – Ravi Joshi Oct 15 '14 at 5:45
  • Yet, it is not a Drupal-related question since CKEditor can be used without Drupal. – kiamlaluno Oct 28 '14 at 10:36
5

How to create links (anchors) inside a page?

There is an icon with a flag. You click on it and you create the anchor.

Anchor icon

If the icon is missing, go to /admin/config/content/ckeditor , edit the respecive profile and customize the icons under section 'Editor appearance'.

How to add these links to text on a new page?

You add a link as you would:

enter image description here

  • Based on your answer I can add the anchors but I am still unable to link anchor to text. The website URL is 127.0.0.1/drupal I notieced that after linking this anchor in another page, the URL becomes 127.0.0.1/projects/#project_a (I don't want to declare the complete website URL) . Please see the screenshot here – Ravi Joshi Aug 29 '14 at 10:38
  • The picture shows that you have specified as link: /projects/#project_a, so this will drive you to 127.0.0.1/projects/#project_a if the site is deployed on 127.0.0.1. If you want it to go to 127.0.0.1/drupal/another_page#my_anchor then you have to specify /drupal/another_page#my_anchor. See also this. This is an HTML-related comment btw, not CKEditor/Drupal. – Wtower Aug 29 '14 at 11:42
  • Thank you for the info. As I said earlier, I don't wanna enter absolute URL. Is it possible to work with relative URL? (Since my website is going to be deployed in live server. At that time I can't afford to change all these URLs) – Ravi Joshi Aug 29 '14 at 11:56
  • So I assume that your issue is that you have installed Drupal in a subdirectory in your development server. You can deal with this in many ways, but what I do and I recommend is to create a virtual host at your development server and move Drupal to the document root. – Wtower Aug 29 '14 at 12:06
  • 1
    Also make sure the select list next to the URL is set to Other. – FatGuyLaughing Aug 29 '14 at 14:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.