franciccio-ITALIANO

How change any thing on body text?

Recommended Posts

Hi, 

I see that the PW text-editor is poor.

I can't change color and align of the text.

I can it by code, but for example when I put  <p style="color:red;">This is a paragraph.</p>

the PW text-editor remove all!

Someone may help me? :/


 

Share this post


Link to post
Share on other sites

It is not a "PW text editor", it is the "CK-Editor". Please follow the given links in the editorfields configuration screens to all those documentations of the CK-Editor.

  • Like 3

Share this post


Link to post
Share on other sites

CKEditor is meant to be composed with different plugins, so the core is as small as possible, while people can add the things they need without the overhead of things they don't need. 

  • Like 1

Share this post


Link to post
Share on other sites

If you feel you are starting to struggle with CKEditor, you might want to use Repeater Matrix instead. As Ryan puts it: "One use case for a Repeater Matrix is as an alternative to a rich text editor for those cases where you want more fine-grained developer control."

Share this post


Link to post
Share on other sites

I often (have to) customize the Style drop-down list in CKEditor.

The styles applied can add classes to elements, like p for example. So these classes already exist if you are using a framework and/or you can add your own css rules, and you can add colors, align to the right, justify, etc.

You can see some summarized information here: 

 

Share this post


Link to post
Share on other sites
21 hours ago, franciccio-ITALIANO said:

mmm ok thank but I don't find the instructions for change color and text align. Is that in this page? I must study all this page? http://docs.ckeditor.com/#!/guide

Sorry for being unclear, I have meant the instructions on the textarea field input tab.

In my opinion, styling of colors or alignment should be handled via an separate css file or the custom styles section of CKEditor. The custom styles would probably be enough for you and shouldn't slow down the CKEditor too much. ;)

Share this post


Link to post
Share on other sites

Francicio, my opinion would not differ from the rest here. I have always thought that a good editor should have everything in it (color changes, anchors, and all the cool features), however I came to the conclusion that I am losing control over the content and if for some reason I decide to switch to another editor, then some or all of the codes, styles etc. might break and cause big headaches. That is why I am trying to type most of the commands manually, type the stylings manually and define them in separate CSS (depending on the case) so the code is clear having just the styles call and the rest is done by CSS.

In your case the code become much easier to read:  <p class="blablabla" ; >This is a paragraph.</p>

And in CSS you add the desired styling to .blablabla {....} Adding code inline would require you to change it on every instance once you change your mind for the appearance and in some cases having 10-20K of pages might be the worst nightmare. Having to change a few CSS lines of the .blablabla would be the cool and easy fix ;)

Share this post


Link to post
Share on other sites

Hi, 

exuse me I'm italian e I don'able to explain my problem.

My probem is:

1. How can I change the color of 1 word into the text? I can do it only by addon?
2. How can I change the align of 1 row into the text? I can do it only by addon?

For change the style of all document I use CSS, but I cant'use CSS per change the color of 1 word or the alignment of 1 row.

I don't know how to install addon of CKeditor into processwire. There is a guide for processwire?

I don't Know if is possible to put a blank row, a empty space, because CKeditor clean all and remove the empty row, but I need blank row.

With Repeater Matrix the site became more slowly?

 

Thanks!  


 

Share this post


Link to post
Share on other sites
51 minutes ago, franciccio-ITALIANO said:

My probem is:

1. How can I change the color of 1 word into the text? I can do it only by addon?
2. How can I change the align of 1 row into the text? I can do it only by addon?

I think you are much better off defining distinct "styles" for Ckeditor rather than allowing full manipulation - if you give editors free reign to change colors, you're likely to end up with a really ugly site.

You can read more about setting up styles here: https://github.com/processwire/processwire/blob/dev/wire/modules/Inputfield/InputfieldCKEditor/README.md#custom-editor-css-file

  • Like 2

Share this post


Link to post
Share on other sites

 

...sure, I would like change colour of 1 word by Editor Panel rather that css doc. 

BUT, how can I install addon to CKEditor? There is a guide for in processwire?

 

Thankk you very much!

Share this post


Link to post
Share on other sites
29 minutes ago, franciccio-ITALIANO said:


BUT, how can I install addon to CKEditor? There is a guide for in processwire?

Hi @franciccio-ITALIANO take a look at this post:

 

  • Like 2

Share this post


Link to post
Share on other sites

Thanks Flydev! 
I red your link, don't need install any CKE Addon!! :)

For new entry, the "CKEditor Toolbar" is in Setup -> Fields -> Body -> Imput. Here, add only words not plugin:

 

Save, NewPage, Preview, Templates
Cut, Copy, Paste, PasteText, PasteFromWord, -, Undo, Redo

Find, Replace, -, SelectAll, -, Scayt, -, Sourcedialog

Form, Checkbox, Radio, TextField, Textarea, Select, Button, ImageButton, HiddenField
Bold, Italic, Underline, Strike, Subscript, Superscript, -, RemoveFormat
NumberedList, BulletedList, -, Outdent, Indent, -, Blockquote, CreateDiv, -, JustifyLeft, JustifyCenter, JustifyRight, JustifyBlock, -, BidiLtr, BidiRtl, Language
PWLink, Unlink, Anchor
PWImage, Flash, Table, HorizontalRule, Smiley, SpecialChar, PageBreak, Iframe
Styles, Format, Font, FontSize
TextColor, BGColor
Maximize, ShowBlocks

 

For each word PW install one CKE Plugin. Remove the words for to remove the plugin! 

 

  • Like 2

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Lemoratoire
      Hi guys, 
      For a school work, I need to be able to write my own HTML code in the editor, but when it comes to "complexe" code such as a .DIV or a SRC, the "source" page doesn't recognize it. 
      So my question is the following: Is there a possiblity for me to enable the fact that I could work on a page by using my own html, without touching the .php doc?
    • By clsource
      Hello,
      I just want to point out this framework for making html apps https://onsen.io/
      it's compatible with jquery, angular, vue, react or any other js framework.
      So far I made an app using this and bootstrap with https://propeller.in/
      for the desing and some libs like jquery and lodash for the app logic
      I prefer this to other alternatives like ionic since it does not bound you to angular or react.
       
      Cheers
    • By ryanC
      Hi, I have php includes in my template file that are working fine....however I need to have some additional includes within a text area field, where I enter my HTML content.
      For example, this code at the top of my template file:
      <?php $myPath = $config->urls->templates;?> Allows me to have something like this on every page:
      <?php include("includes/footer.inc.php"); ?> So far so good, but I have a text area field named page_content, where I would like to manually enter additional includes. 
      If I enter this in that text area field, I get a photo:
      <img src="images/photo.jpg" />
      But if I enter this in that same field, nothing happens at all:
      <?php include("includes/phone.inc.php"); ?> Any thoughts? I have reviewed this thread https://processwire.com/api/ref/files/include/ but I don't think it gets at what I'm looking for.
      Thanks!
    • By franciccio-ITALIANO
      Hi, I know the the templates in processwire are html files.
      I search it into foleder "site" of standard installation of processwire standard theme (blanck and that blue) but I don't find any html file to modify it by html code.
      So, I must modify it only by php code?
      Can I traduct php pages templates in html page?
    • By antknight
      I am after a bit of guidance on importing content to ProcessWire. I am using a program called Clarify to generate work instructions. I would like to use ProcessWire to put together a knowledgebase of work instructions.
      I have Clarify outputting an HTML file and a folder of images for each work instruction which I would like to become a page in PW.
      An example of the HTML output is attached.
      How can I import these pages and the folder of images and keep the image links intact?
      Many Thanks
      Anthony
      clarify-example.zip