Hi.
Looking for a simple NoDB CMS for two small websites, I started checking out GetSimple one month ago. I have set up several installations to test everything thoroughly and ran into several problems.
As the backend users of one of the websites will need a simple-to-use interface, CKEditor is required, editing HTML source is no option for them.
- Test installation of GS with Bootstrap 3 theme installed
- Added a couple of pages with filler text
- Tried to create a link to page B from page A using CKEditor's link insertion dialogue. Link type: Link to local page; Select page: page B.
Instead of the expected relative link with the title of the page as link text, <a href="pageB">page B</a> I get, <a href="http://domain/path/pageB">http://domain/pageB</a>.
This happens with all four installations of GS I have currently running locally.
How do I get relative Links without editing the source?
I expect I will have to sync my own local (edited) installation with changes made on the (test) server frequently and want to avoid frequent unneccessary manual changes to the files.
Andreas
You can't . See the many threads about cke relative links.
And the solutions
What about using links like: http://../data/uploads/img.jpg or http://../page2 (other page at same level) or http://./page2 (subpage)?
(2015-01-09, 23:43:22)datiswous Wrote: [ -> ]What about using links like: http://../data/uploads/img.jpg or http://../page2 (other page at same level) or http://./page2 (subpage)?
Sorry, I do not understand this. Can you please rephrase it? Thank you.
By the way: I am also wondering why ckeditor does not use the selected pages title as link text (i.e. the part between <a> and </a> but inserts the URL.
no gs uses absolute urls, 3.4 will allow this to change.
those threads provide possible solutions from plugins that rewrite them using content filters or modifying the code to remove the $SITEURL from the path.
cke editor inserts whatever we give it
(2015-01-11, 01:48:49)shawn_a Wrote: [ -> ]no gs uses absolute urls, 3.4 will allow this to change.
those threads provide possible solutions from plugins that rewrite them using content filters or modifying the code to remove the $SITEURL from the path.
cke editor inserts whatever we give it
Hi Shawn,
thanks for the info. When will 3.4 be ready? I only found a 3.3.5 beta.
No time soon your best bet is to use one of the plugins made for this or modify the urls from the function that provides them.
(2015-01-10, 23:06:53)WerWieWas Wrote: [ -> ] (2015-01-09, 23:43:22)datiswous Wrote: [ -> ]What about using links like: http://../data/uploads/img.jpg or http://../page2 (other page at same level) or http://./page2 (subpage)?
Sorry, I do not understand this. Can you please rephrase it? Thank you.
Well I just found out you can use links with an url like:
http://../data/uploads/
yourimg.jpg (this is the full url, apart from the filename)
instead of:
http://
www.yoursite.com/data/uploads/
yourimg.jpg
So if it was http://
localhost/data/uploads/
yourimg.jpg and now http://
www.yoursite.com/data/uploads/
yourimg.jpg it would both work with http://../data/uploads/
yourimg.jpg
In the output the links have the right url.
Edit: It seams the
http:// in the url isn't needed. The Ckeditor gui doesn't work propperly with it though.
Also in the source of the page you still see the ../data/uploads/
yourimg.jpg , so maybe bad for seo. Also, I didn't test this with more than one browser.
(2015-01-12, 20:56:13)datiswous Wrote: [ -> ]...
Well I just found out you can use links with an url like:
Thank you! Sounds interesting as a workaround.
(2015-01-12, 09:58:38)shawn_a Wrote: [ -> ]No time soon your best bet is to use one of the plugins made for this or modify the urls from the function that provides them.
Yes, I shall check out the plugins.
Thinking about the problem again, I believe it may yet be a problem inside ckeditor: I get the weird result for selecting a local link inside ckeditor, not only after saving, but right away after entering the link. Is there interaction between ckeditor and GS at this time? Not only after saving the contents of an editor field? And why the wrong text between <a> and </a> (i.e. the URL again, instead of the selected internal page)?
I am wondering: does anyone here know why GS is using http URLs for local files?
There is no advantage I see in this, but these disadvantages:
- Clicking on such a link results in additional DNS requests for a local file, or doesn't it?
- Migrating pages (which should be super-easy as GS is a flat file CMS) becomes more problematic as internal links have to be fixed.
Am I missing something?
Oh, and thank you very much for your replies!
We use absolute because every one uses them, wordpress uses them.
I have no idea why the decision was made, but 3.4 has experimental relative urls to see why.
ALSO
ckeditor gets its links from
PHP Code:
/**
* List Pages Json
*
* This is used by the CKEditor link-local plugin function: ckeditor_add_page_link()
*
* @author Joshas: mailto:joshas@gmail.com
*
* @since 3.0
* @uses $pagesArray
* @uses subval_sort
* @uses GSDATAPAGESPATH
* @uses getXML
*
* @returns array
*/
function list_pages_json(){
GLOBAL $pagesArray,$pagesSorted;
$pagesArray_tmp = array();
$count = 0;
foreach ($pagesArray as $page) {
if ($page['parent'] != '') {
$parentTitle = returnPageField($page['parent'], "title");
$sort = $parentTitle .' '. $page['title'];
} else {
$sort = $page['title'];
}
$page = array_merge($page, array('sort' => $sort));
$pagesArray_tmp[$count] = $page;
$count++;
}
$pagesSorted = subval_sort($pagesArray_tmp,'sort');
$links = exec_filter('editorlinks',get_link_menu_array());
return json_encode($links);
}
as you can see there is a editorlinks filter hook in there
anyone can write a plugin to change this behavior, as of 3.3 or something
( I added it to the wiki, it was missing )
(2015-01-13, 01:30:49)shawn_a Wrote: [ -> ]We use absolute because every one uses them, wordpress uses them.
I have no idea why the decision was made, but 3.4 has experimental relative urls to see why.
Thank you for the clarification.
Quote:ALSO
ckeditor gets its links from [...]
Hey, great! Though I am not sure I can reprogram this myself as I am a PHP newbie. Maybe I will try it anyway.