Forums | Mahara Community

Developers /
New entry for achievements page


Arnold Mühren's profile picture
Posts: 2

24 October 2010, 4:43 AM

Hi there

I'd like to add a new form block (Presentations) to the Achievements page of the Resume builder. How would I do that? Which file(s) in the code call a block (for instance Books & Publications) to this page? 

Any pointers?

Arnold

Andrew Nicols's profile picture
Posts: 214

25 October 2010, 6:21 AM

Hi Arnold,

Off the top of my head, to create the relevant classes and the edit interface:

  • artefact/resume/achievements.php -> Add 'presentation' to the compositetypes array
  • artefact/resume/lib.php -. you'll need to add a new ArtefactTypePresentation class similar to the Book and Certification classes
  • artefact/resume/theme/raw/fragments/presentation.tpl
  • artefact/resume/theme/raw/achievements.tpl

You'll also need to create a table to store the data in, so you'll need to edit:

  • artefact/resume/db/install.xml
  • artefact/resume/db/upgrade.php

I'm not 100% certain whether you'll need to modify anything else, but this should point you in roughly the right direction.

Perhaps you'll consider submitting a patch (git format-patch -s) or pushing to a new branch on gitoriouos to share with others?

Good luck,

Andrew

Arnold Mühren's profile picture
Posts: 2

26 October 2010, 10:12 AM

Thanks Andrew!

The new 'Presentations' block popped up fine and seems to be in full working order. I tested things on a newly installed Mahara site with a replacement resume folder. Perhaps you Andrew or others could also run some testing.

The files that needed to be changed or added are

artefact/resume/achievements.php
artefact/resume/lib.php
artefact/resume/theme/raw/achievements.tpl
artefact/resume/theme/raw/fragments/presentation.tpl
artefact/resume/blocktype/entireresume/theme/raw/content.tpl
artefact/resume/export/html/theme/raw/index.tpl
artefact/resume/export/leap/lib.php
artefact/resume/import/leap/lib.php
artefact/resume/lang/en.utf8/artefact.resume.php
artefact/resume/lang/en.utf8/help/sections/addpresentation.html
artefact/resume/theme/raw/static/style/style.css
artefact/resume/lang/en.utf8/help/forms/addpresentation.date.html
artefact/resume/lang/en.utf8/help/forms/presentation.date.html
artefact/resume/db/install.xml
artefact/resume/db/upgrade.php

15 files
- 4 new files
- 11 adapted files

The code for 'presentation' has been added by copying and pasting equivalent code snippets/blocks for 'book'.

I have uploaded the replacement resume folder with the listed files in place (resume.zip) to Files. Perhaps one of the more knowledgeable members of this community can take this further as far as a patch or whatever else is concerned.

 

(screenshot showing the new item)

Cheers, Arnold

3 results