The place for more technical questions for those who want to create new pagetypes or bespoke functionality.

Styles optional property

  • takeshi
  • Onderwerp Auteur
  • Offline
  • Junior lid
  • Junior lid
Meer
9 jaren 6 maanden geleden #4240 door takeshi
Styles optional property werd gestart door takeshi
Hi, first time posting here - looking to customise my XOT installation.

What is the "Styles" optional property is for (as opposed to Stylesheet)? I see it exists on the main LO as well as each of the pages, and appears to expect some code. What type/structure of code is expected? Can anyone give some example code?

Many thanks for any enlightenment!

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 6 maanden geleden #4241 door ronm
Beantwoord door ronm in topic Styles optional property
The stylesheet option is for attaching a stylesheet that applies across the whole LO.
The styles option attached to the first icon in the tree allows adding css directly that will apply across the whole LO.
The styles option attached to each page type added to your project allows css to be added that only applies to that specific page.
There are similar script options too.
e.g. in the styles option attached to the parent icon you could add:
Code:
#x_pageHolder{background:yellow;}
To change the background colour throughout the LO to yellow.
HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/
De volgende gebruiker (s) zei dank u: takeshi

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • takeshi
  • Onderwerp Auteur
  • Offline
  • Junior lid
  • Junior lid
Meer
9 jaren 6 maanden geleden #4245 door takeshi
Beantwoord door takeshi in topic Styles optional property
Thanks Ron for the informative reply. I had wondered if Styles was related to creating custom text styles (like the Block Styles or Inline Styles) that can be chosen from the text field dropdown menu, but it appears it was not the case. Or is this still something I can do with Styles/Stylesheet?

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 6 maanden geleden #4246 door ronm
Beantwoord door ronm in topic Styles optional property
No you can't add css/styles to the optional styles property and have those appear in the drop down menu of the editor. You would have to customise the editor code for that. The styles and stylesheet options that you can add to a project control the playback of the project not how the editor works.
HTH
Ron

Xerte developer & trainer
e-learning & m-learning consultant
mitchellmedia.co.uk | xerteacademy.com | learningapps.co.uk
Note: Support here is voluntary and meant for users to support each other.
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

  • takeshi
  • Onderwerp Auteur
  • Offline
  • Junior lid
  • Junior lid
Meer
9 jaren 6 maanden geleden #4247 door takeshi
Beantwoord door takeshi in topic Styles optional property
Ok, thanks, I understand. I'm more dabbler than developer - would customising the editor code for that purpose be a simple task, or best to shelve that idea?

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Meer
9 jaren 6 maanden geleden #4249 door Fay
Beantwoord door Fay in topic Styles optional property
Hi, the file you'd need to edit to add new options to the styles drop down is editor/js/vendor/ckeditor/styles.js

It would be pretty straight forward to do i think - just duplicate one of the existing styles, change its name and edit its styles properties.
De volgende gebruiker (s) zei dank u: takeshi

Graag Inloggen of een account aanmaken deelnemen aan het gesprek.

Moderators: JohnSmith
Tijd voor maken pagina: 0.196 seconden
Copyright © 2026 The Xerte Project.
Xerte logo Apereo logo OSI Logo