Forums | Mahara Community

Developers /
Issue with side block development


Kristina Hoeppner's profile picture
Posts: 4863

03 March 2017, 12:59

Reposted from an email:

I have a question about sideblocks. I want to create a sideblock which will be visible on every Mahara page. I found out that for doing that I can use 'local_sideblocks_update()' function. That works even if that function is defined in the lib.php file of a new artefact.
 
The only problem is that I get this:
 
[Dwoo_Exception]: Template "sideblocks/eblogin.tpl" could not be found in any of your include path(s)
 
Obviously the sideblock template file can't be found...
 
What is the path if I want to have a template file inside artefact's folder (e.g. htdocs/artefact/someartefact/) - I am specifically interested in sideblock templates.
 
Thank you for pointing me to the right direction.
Robert Lyon's profile picture
Posts: 773

03 March 2017, 13:37

One thing you could try is to place the template file in the local template directory,

eg,

  htdocs/local/theme/templates/

or it might be

  htdocs/local/theme/raw/templates/sideblocks/

You may need to create the directories first.

The way we pick a template in mahara allows us to override any existing template with one in local/ subdir

See for example  https://reviews.mahara.org/#/c/7434/

Where I use a local template and include it

Cheers

Robert

 

Gregor Anželj's profile picture
Posts: 349

03 March 2017, 21:33

Thank you for your answer Robert.

Actually the folder structure is: htdocs/local/theme/templates/sideblocks

I just wanted to know if there is any way to include this somewhere under new artefact's folder so that the whole code for the new artefact would be as self contained as possible (that everything would be in the same folder and/or subfolders).

3 results