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

Styles optional property 3 years 9 months ago #4240

  • islitech
  • islitech's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
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 Log in or Create an account to join the conversation.

Styles optional property 3 years 9 months ago #4241

  • ronm
  • ronm's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 639
  • Thank you received: 170
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
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/
The following user(s) said Thank You: islitech

Please Log in or Create an account to join the conversation.

Styles optional property 3 years 9 months ago #4245

  • islitech
  • islitech's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
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 Log in or Create an account to join the conversation.

Styles optional property 3 years 9 months ago #4246

  • ronm
  • ronm's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 639
  • Thank you received: 170
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
Need direct commercial support with Xerte? mitchellmedia.co.uk/contact/

Please Log in or Create an account to join the conversation.

Styles optional property 3 years 9 months ago #4247

  • islitech
  • islitech's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 0
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 Log in or Create an account to join the conversation.

Styles optional property 3 years 9 months ago #4249

  • Fay
  • Fay's Avatar
  • Offline
  • Gold Boarder
  • Gold Boarder
  • Posts: 177
  • Thank you received: 60
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: islitech

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Moderators: jjs
Time to create page: 0.046 seconds
Copyright © 2020 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search