franciccio-ITALIANO

How change any thing on body text?

15 posts in this topic

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.

3 people like this

Share this post


Link to post
Share on other sites

Hello @franciccio-ITALIANO,

the CKEditor is not poor, you just have to read the instructions. ;)

There are plugins available for color and align.

In case of the color, in my opinion, I find the default behavior of stripping out inline styles preferable and much cleaner to define your own styles.

Regards, Andreas

4 people like this

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. 

1 person likes this

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

2 people like this

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:

 

2 people like this

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! 

 

2 people like this

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 MilenKo
      Greetings to all of you gorgeous people here. I have stumbled across ProcessWire while looking for functionality info on MODx Revo and I felt in love with it. As far as I am not a programmer and have enough books to read and learn throughout my IT job, I was looking for something to be easy (for starting) and that can let me have fun and learn something extra.
      To make the learning memorable, I am always diving into the matter so following my habit in PW too, I decided to pick up a more complex HTML theme and make it dynamic using PW.
      Am I a programmer - well, I can read and eventually modify some code, but to write it from scratch - not anywhere close. Am I an HTML guru - not exactly, and that is why I decided to grab a theme I like and play with it. My only requirement was to have a well written and fully validated responsive theme. So I found THIS ONE and plan to work with it (already purchased to support the developer).
      I am planning to share my approaches and the progress so would appreciate any shared thoughts, advice, and even some criticism if you see me getting into a wrong direction. Having done most of the project under ModX it should not be that difficult for me to have all the bits and pieces in place. Where I am not sure yet how that would be done are the pull up of the latest posts/comments, the categories with listings, search, and some other stuff. What I found great in PW was the fact that it already has a fully working theme that I can dissect, read through a zooming glass and take some code from there. 
      My first question is - which way should I go for the repetitive pieces of code (chunks) - should I create an include folder in site/templates and put all my pieces as XXXX.inc or I should just add those in the database as templates with no file assigned to them and set as not searchable etc. I would appreciate if you share your best experience and give some info why that is the better option so that I can understand the approach and turn it into a proper habit.
      Once I have this cleared out, I would start documenting the process so any corrections or better approaches can be suggested.
      Wish me luck on that journey and let's make it happen together. Shall we?
    • By modifiedcontent
      Why does the forms API use lists - ul, li - to style forms? It makes them much harder to control with CSS.
      Why not something like this?
      <style> .field { float: left; width: 100%; } .inputfieldheader { float: left; width: 100%; } .input { float: left; } </style> <form> <div class=field> <label class=inputfieldheader>Field one</label> <input class=input> </div> <div class=field> <label class=inputfieldheader>Field two</label> <input class=input> </div> <div class=field> <label class=inputfieldheader>Field three</label> <input class=input> </div> </form>  
    • By hellomoto
      I can't tell what's wrong; my local development version appears just fine, but I copy over the site files and db online and the homepage content is not being contained. See mad-web.agency. This is what it should look like (same site in the same browser, running on my localhost): http://imgur.com/UFZFzrd
      What could be the problem here? Sorry to bring up something so irrelevant to PW here, I just know that you all are a valiant and helpful group, and no one on StackExchange seems to even know what I'm talking about.
      Thanks a lot.
    • By Pete Jones
      Hi,
      We're looking for a PW freelancer (preferably based around Gloucestershire/South West - but will consider further afield) to build the front-end for a PW site we're currently building.
      The site has been designed (files available) and prototyped. Currently we are building the backend (members) area which pulls in a JSON feed and stores it in PW. This information is then shown to the Members. A restricted view of the data is shown to the public.
      Timescales for this project are to go live on W/C 18th April.
      Please post here with contact details and website URLs and I will contact you.
      Many thanks
      Pete Jones
      Head of Digital
      www.jfd.co.uk
    • By Esther
      Hi - I am not a developer or have any understanding of computer programming.  I do have a site built on PW.  The person who built my site is busy atm, and I cannot get through to him.  Another person who is doing my marketing is setting up a landing page for me and has asked me this question:
      Does your site support html?
      I'm not sure what the correct answer is.  If someone could give me a yes or a no, that would be great.
      Thank you and appreciate it