When you insert a link with the WYSIWYG editor, the default Link type is "Local page". If you want to insert an external/full URL you must click the dropdown menu, then select "URL".
Is it possible/can you think of a way to change this, so that the default is "URL" instead of "Local page"?
(Or even remove the "local page" option, I don't really need it)
this function deals with the link-dialogue: "function ckeditor_add_page_link()" in template_functions.php
I just identified it, I never modified it, so it's up to you!
Carlos,
if you uncomment lines 811 and 812 in admin/inc/template-functions.php
Code:
// content.items.unshift(['Link to local page', 'localPage']);
// content['default'] = 'localPage';
links to local pages (internal links) will not be listed in the select-box
But I do not recommend that, this is absolutely non-GetSimple-style ;=(
Thanks a lot Connie!
I tried by removing the call to the function you identified,
ckeditor_add_page_link(), and seems to work.
I changed admin/edit.php
line 340 (in GS 3.0, or line 360 in 3.1 beta) to:
Code:
//ckeditor_add_page_link();
(I inserted "//" in the beginning, to comment it)
Update: in
GS 3.1 stable it is
line 363.
Update: in
GS 3.1.2 it is
line 360.
You're welcome...
BTW the change has to be made to line 363 in GS 3.1 stable/final, not line 340 (that was for GS 3.0).
It would be nice to have a gsconfig setting or something for this, so that we (us who don't need/like/want the "link to local page" default option) don't have to edit core files.
It would be nice if there was not a drop down, and just both on the same tab.
We can fix this in the future. THE FUTURE tm
(2013-02-05, 07:56:23)shawn_a Wrote: [ -> ]It would be nice if there was not a drop down, and just both on the same tab.
Sorry I don't understand what you mean.
Why have a dropdown to pick between, just put the dropdown of pages and the url on the same page.
IMO a gsconfig setting to be able to disable the "link to local page" option would be nice anyway. This would be useful for:
- sites with many pages
- sites where most links are to external ones
- sites using the I18N plugin with a custom permalink structure having %language% or %nondefaultlanguage%, where links in the dropdown are broken - even the plugin itself could disable this.
I'd rather make this a filter, its json anyway so we could just turn it off, if there are no lists.
Ideally the picker would be replaced with a popup, like filebrowser, not a silly combobox and correct for static urls.
So i am thinking the proper way to fix this would be to have proper permalinks, since that would automatically fix this.
In 3.3.0 beta the removal can be handled in config.js ( naturally you would make a copy and use gseditoroptions to use your own copy custom config cke js file )
You can then remove whatever you want or change the code.
Now that GS 3.3 has changed this stuff...
Could it be possible to change (with some jquery, I suppose) the default link type to "URL" instead of "Link to local page"?
Or if I wanted to remove "Link to local" option, must I use a custom config.js or could it be possible to remove/hide it with jquery?
You can define this before cke inits, js global linkdefault
Code:
<script type="text/javascript">
var linkdefault = 'url';
</script>
You can also write your own ondialogdefinition
content.setup = function(data) {}
To override the one core loads
but you probably cannot modify it with jquery since that code gets instantiated every time a dialog opens
But this is tied to all ckeditor instances, it gets to be a pain if you need to modify individual ckeditors.
(2014-11-04, 05:40:02)shawn_a Wrote: [ -> ]You can define this before cke inits, js global linkdefault
Great! Thank you Shawn.