Definedlinks
Allow users to select predefined links from a list.
Add a link to the text by selecting it from a predefined list in the link popup.
Code
<!DOCTYPE html>
<html>
<head>
<title>Redactor X</title>
<meta charset="utf-8">
<!-- css -->
<link rel="stylesheet" href="/your-folder/redactorx.css" />
</head>
<body>
<!-- element -->
<textarea id="entry">...</textarea>
<!-- js -->
<script src="/your-folder/redactorx.js"></script>
<script src="/your-folder/plugins/definedlinks.js"></script>
<!-- call -->
<script>
RedactorX('#entry', {
plugins: ['definedlinks'],
definedlinks: {
items: [
{ "name": "Select...", "url": false },
{ "name": "Google", "url": "http://google.com" },
{ "name": "Home", "url": "/" },
{ "name": "About", "url": "/about/" },
{ "name": "Contact", "url": "/contact/" }
]
}
});
</script>
</body>
</html>