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
  • 2

TOPIC: New Page

New Page 2 months 4 days ago #6736

  • Alan
  • Alan's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
I'm trying to create my own page, based on the pages that are available.

All I can find to help me with this is what's available on this link:
'https:// xot.xerte .org.uk/USER-FILES/11-fay-site/media/NewPage.docx.pdf ' (without the spaces)

Although informative, it doesn't correspond with the state of things now. So I'm assuming this documentation needs updating to the newer versions.
The only '.xwd' files are 'data.xwd', but I should be able to create my own based on the '.xwd' files for each page type.
e.g., 'mcq.xwd' doesn't exist.

Please could someone give a bit of guidance.

Please Inloggen or Create an account to join the conversation.

New Page 2 months 4 days ago #6737

  • jjs
  • jjs's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 377
  • Thank you received: 62
Hi Alan,

The document that you attached is quite accurate - you'll find all of the separate xwd files in \src\Nottingham\wizards\en-GB

If you follow the steps on Page 2 then you'll see that once you have created the xwd file then you need to run the " sh ./rebuildNottingham.sh" (in the /build folder) which will merge your file into a new data.xwd file and place it in the location where you found it before.

You then also need to write the html file (and now also a css file) which makes up the container, logic and presentation of the page - it's probably best if you duplicate one of the existing ones (from \modules\xerte\parent_templates\Nottingham\models_html5) and then modify - the text.html one is probably the simplest one to start from.

Regards,

John
The following user(s) said Thank You: Alan

Please Inloggen or Create an account to join the conversation.

Last edit: by jjs.

New Page 2 months 3 days ago #6742

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 990
  • Thank you received: 210
Please be aware that these folders are NOT available in the zip files on the community website. For development, you need to retrieve the pacakge from github
https://github.com/thexerteproject/xerteonlinetoolkits

You can just unzip over your installation and run https://<xerte url>/upgrade.php
The following user(s) said Thank You: jjs, Alan

Please Inloggen or Create an account to join the conversation.

Last edit: by tom.

New Page 2 months 3 days ago #6743

  • tom
  • tom's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 990
  • Thank you received: 210
That should have been
https://github.com/thexerteproject/xerteonlinetoolkits
The following user(s) said Thank You: jjs, Alan

Please Inloggen or Create an account to join the conversation.

Last edit: by tom.

New Page 2 months 3 days ago #6750

  • Alan
  • Alan's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 14
  • Thank you received: 0
Riiiggghtt
So I gave it a look on local and on the server I have Xerte running on - they only had 'data.xwd', hence my confusion. (dataxwd.jpg as proof)
I had assumed some update had knocked the documentation off (it has been 5 years since their creation in fairness)

I got the zip off of Github as stated by Tom, unzipped onto htdocs as I should, ran through the setup and I can see the files on local - now I can get going with it.
So, big thank you to you both!

I may have to throw the files up to server now, which is a bit tricky (using HostGator)

Is there anything anyone would suggest to upgrade my files on server, rather than just replace them?
I'm assuming I can't run through the 'New Page' process without the files being upgraded, i.e., make a new .xwd on local, put that on server, perform a rebuild etc...

I just want to add new pages, if that makes the process easier...
Any help much appreciated and so far, much appreciated :)
Attachments:

Please Inloggen or Create an account to join the conversation.

New Page 2 months 3 days ago #6751

  • jjs
  • jjs's Avatar
  • Offline
  • Moderator
  • Moderator
  • Posts: 377
  • Thank you received: 62
Hi,

So you don't need to send the /src or /build files up to the server, only the newly built data.xwd file, which is used by the editor so it knows what attributes and structure that you can add to the page.

Then you need to take (probably easiest!) the .html and .css pair from the \modules\xerte\parent_templates\Nottingham\models_html5 folder, duplicate them and rename them the same as the page.xwd file you added to src before running the build script. So for example, you want to create a Sudoku page, you:

take the text.xwd (in /src/....),
duplicate it and rename it sudoku.xwd
and then edit it

You'll see something like

<wizard menus="Text">
<pageWizard remove="true" duplicate="false">
<newNodes>
<text><![CDATA[<text name="Enter Page Title">En.......

You need to change the menus="Text" to "Games" (or whatever menu you want it to live in the editor
Change the <text> to <sudoku> and the <text name=...etc to <sudoku name=
(Also find the closing xml tags and rename them also)
Save it and now you need to add or change the attributes in the xwd file to reflect what data you need to be able to add for your new page to work - this is going to be really longwinded to explain so it's best you just compare some of the other page type xwd files with what you see in the editor for those pages.

Next you go to the models_html5 page and duplicate the text.html and text.css files to the equivalent sudoku ones. Inside the html one you will have to rename the javascript object also and any references to it in the code (NOTE text is a reserved word in javascript so the text page is called simpleText internally but all other pages will follow the same naming convention as the filename). Once you have done that you should end up with:

var sudoku = new function() { .......

and lower down

sudoku.init();

That should be enough to get you started at least with creating a page.

One thing to watch for though is that when you make updates or changes to these files the old files WILL BE CACHED so while testing you need to clear the cache between tests or in Chrome, open the Dev Tools -> Network tab and make sure the disable cache option is ticked)

Regards,

John
The following user(s) said Thank You: Alan

Please Inloggen or Create an account to join the conversation.

Last edit: by jjs.
  • Page:
  • 1
  • 2
Moderators: jjs
Time to create page: 0.051 seconds
Copyright © 2020 The Xerte Project.
Xerte logo Apereo logo OSI Logo

Search