Supporting each other

Community forums

Welcome, Guest
Username: Password: Remember me
The place for more technical questions for those who want to create new pagetypes or bespoke functionality.
  • Page:
  • 1

TOPIC:

Styles optional property 7 years 8 months ago #4240

  • takeshi
  • takeshi's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 27
  • Thank you received: 1
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!

Please Connexion or Create an account to join the conversation.

Styles optional property 7 years 8 months ago #4241

  • ronm
  • ronm's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 847
  • Thank you received: 260
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:
#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/
The following user(s) said Thank You: takeshi

Please Connexion or Create an account to join the conversation.

Styles optional property 7 years 8 months ago #4245

  • takeshi
  • takeshi's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 27
  • Thank you received: 1
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?

Please Connexion or Create an account to join the conversation.

Styles optional property 7 years 8 months ago #4246

  • ronm
  • ronm's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 847
  • Thank you received: 260
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/

Please Connexion or Create an account to join the conversation.

Styles optional property 7 years 8 months ago #4247

  • takeshi
  • takeshi's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 27
  • Thank you received: 1
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?

Please Connexion or Create an account to join the conversation.

Styles optional property 7 years 8 months ago #4249

  • Fay
  • Fay's Avatar
  • Offline
  • Elite Member
  • Elite Member
  • Posts: 229
  • Thank you received: 92
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.
The following user(s) said Thank You: takeshi

Please Connexion or Create an account to join the conversation.

  • Page:
  • 1
Moderators: JohnSmith
Time to create page: 0.057 seconds
Copyright © 2024 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search