Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: maple on October 04, 2012, 18:21:33

Title: CKEditor - enter - anchor self page
Post by: maple on October 04, 2012, 18:21:33
Hi,

two questions about CKEditor:

1-When I press enter, generate the following html----->
Code: [Select]
<p>&nbsp;</p>
instead of

Code: [Select]
<br />. How I can change this?


2-For example, when I create an anchor self page, automatically generate the url:

Code: [Select]
http://www.mysite.com/#dest
instead of:

Code: [Select]
http://www.mysite.com/category/article/item.html#dest
It seems that don't take the entire path.

Thanks
Title: Re: CKEditor - enter - anchor self page
Post by: datahell on October 04, 2012, 20:31:18
This is valid for all editors:
To insert a paragraph (<p></p>) you click enter.
To insert a page break (<br />) you click shift+enter.

This is relevant to site base tag (see in your site's <head> section).
If you enter a relative path it will not be converted into a full path!

You should use elink plugin for internal linking.
elink accepts Elxis formatted URIs - generic syntax: {language}:{component}:{path} (language is optional, if omitted the link becomes multilingual)

So if your page's real URL is
http://www.example.com/sports/football.html
The Elxis URI is: content:sports/football.html
Instead of using the full real URL with the elink plugin you can insert links like this:
<a href="#elink:elxis_URI_here">
So, for our example:
<a href="#elink:content:sports/football.html">footbal</a>

The above syntax provide us portability as you don't use the site's URL, the links are automatically multilingual, follow your custom routing settings and your SEO PRO status.

For the anchor link you can simple write it like this:
<a href="#elink:content:sports/football.html#myanchor">footbal</a>
Title: Re: CKEditor - enter - anchor self page
Post by: maple on October 05, 2012, 13:22:36
Thanks you so much. Now works correctly.

The only think it's that I need to add about 2000-3000 anchors self page distributed in about 1000 articles. It's a slowly work.

Question: It's possible to use the CKEditor button "insert link > anchor in this page > name anchor (drop down)"? This way need to add the url path to the self page automatically. Perhaps modifying CKEditor or Elxis code?

The "insert anchor" works well.

Thanks a lot
Title: Re: CKEditor - enter - anchor self page
Post by: datahell on October 05, 2012, 13:37:37
I personally avoid anchors, I use them only on special occasions.
Your hard job is to add the anchors or to add 1000 articles????

Something related.
An interesting thing to look is the autolinks plugin. It automatically converts given words (or meta tag words) found inside the article into links to the tags page. Autolinks will help a lot internal site linking and grouping related articles.
Title: Re: CKEditor - enter - anchor self page
Post by: maple on October 05, 2012, 14:21:59
datahell:

My father have two volumes very big books that need to entry all data into Elxis articles (middle-big long page) form. This book have about 2000-3000 references anotations in the bottom of almost each page, and he want to do the same in the website. Each anotation need to link to an anchor reference. My father say that this is very important.

The hard-slowly work are both, entry about 1000 articles and about 2000-3000 anchors self page, one by one.

Or any other suggestion?

ps:  I will investigate the autolinks.

thanks a lot
Title: Re: CKEditor - enter - anchor self page
Post by: datahell on October 05, 2012, 18:42:33
Wait to test it, I will reply you back.

EDIT: The reason of the problem is wrong value on the base tag in Elxis head section.
I will fix it right now.
Thanks for reporting this!

EDIT: I think it is better to completely remove the base tag. Elxis does not need it as it uses full URLs. It only can create problems.
Open includes/libraries/elxis/document.class.php
Go to line 289
Change this:
$html = '<base href="'.$this->base.'" />'."\n";
To this:
$html = '';

Anchor links will now work correctly.
Title: Re: CKEditor - enter - anchor self page
Post by: maple on October 05, 2012, 20:01:05
datahell:

Oh yess, now works perfectly!!  ;)

Then, It is no necessary this base tag at all?
Do you'll change this in the next revision, or I need to change again when I update to a new revision?

By the way, where is the changelog notes?

Thak you very much, datahell
Title: Re: CKEditor - enter - anchor self page
Post by: datahell on October 05, 2012, 20:13:37
After a small research I see thatit is better to completely remove the base tag. I also see that most sites dont use it.
The base tag is used in order to keep relative urls but Elxis uses only full urls. So, it is not needed, it will only cause troubles.
I removed the base tag from Elxis 4.x head section. The next release wont have this line.
We don't publish the complete changelog we publish a summary of the changes in the News and announcement section.
Title: Re: CKEditor - enter - anchor self page
Post by: maple on October 05, 2012, 20:15:05
thanks a lot for all, datahell

Oh, you know what?? Now, when I copy from word and paste it into article's body using the ckeditor button "paste from word" also paste all the anchors and works well! (Did not work before the change in the document.class.php file code). And this magical button convert the rest of code decently from word to html. At first sight, it seems that I don't need to fix and clean too much code. All this save me a lot of time!!    :P


Title: Re: CKEditor - enter - anchor self page
Post by: maple on October 10, 2012, 21:24:28
Hey,

when I paste from elxis using "paste from word" ckeditor button, all the anchors links show up like:
http://www.mysite.com/estia/en/content/articles/edit.html?id=1#testing

But six days before working properly... I always do the same, copy from .docx and paste it from elxis ckeditor button "paste from word". The only change it's the update from 1311 to 1322 revision, at first sight, not seem that this update it's the problem.

Can't understand what happen...

thanks

UPDATE: Well... it seems that works well from chrome and firefox but not from internet explorer 9..