CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

How to make a custom "insert link" dialog

by davenovo » 13 Apr 2018 06:07

I am trying to give the ability in my application for the user to create some custom web pages that will appear in the application, i.e. they can create web pages for themselves within the app where they can store notes to themselves for example.

It is pretty easy, there is a table with "page name" and "page content" and I put the page content field into the TIWCGJQHTMLEditor and let them edit it.

The only issue is that I want them to be able to link from one of their custom pages to another. When inserting a link, drupal for example has a special "insert link" dialog that lets you choose a link type

linktype.png


If you chose "internal path" it lets you choose from a drop down list from all the pages in the CMS. Then, when generating a URL for the link, it generates something like

https://mydomain.com/?q=<page_name>

where <page_name> is the name they selected.

Is there a way to create a custom "insert link" dialog that will allow me to return a custom URL that the selected text will be linked to. I already know how to parse a link in the form of https://mydomain.com/?q=<page_name> to show the correct page, but I dont know how to let the user generate that link from the UI
You do not have the required permissions to view the files attached to this post.
davenovo
 
Posts: 98
Joined: 03 Mar 2018 19:11

by davenovo » 13 Apr 2018 21:32

Also, I am not wedded to this editor. If it is easier in the TinyMCE editor I can switch to that as well.
davenovo
 
Posts: 98
Joined: 03 Mar 2018 19:11

by Alexander Bulei » 17 Apr 2018 17:27

Hi davenovo,

Definitely, you need use the TinyMCE.

Please activate the Link plugin in TinyMCEOptions.Plugins. Then, you can add your internal pages urls into PluginSettings.Link.List property.

Example of json:

Code: Select all
[{title: 'My page 1', value: 'http://www.tinymce.com'},{title: 'My page 2', value: 'http://www.moxiecode.com'}]


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQHTMLEditor

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.