Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Default Master.TPL on open source

Simple questions - how does this even work? What programme should be used to open it? IS it PhP or something else? Does it work on open source when the forum is not hosted on open source? Not getting anywhere with it and the documentation isn't detailed enough. Is there a 'how to' anywhere? Reading through the discussions it seems this has been an issue since 2010 and there doesn't seem to be any clear instructions on how to use the TPL master to make changes. Thanks for any help.

«1

Comments

  • ngakaksngakaks London, UK New
    edited February 2015

    Try to open it with Notepad++ Editor

    Download here

    Once installed, right-click on the .tpl file, then select "Edit with Notepad ++"

  • R_JR_J Ex-Fanboy Munich Admin

    @Sar said:
    Does it work on open source when the forum is not hosted on open source?

    You aren't on a hosted plan, are you? If yes, you should better ask your question at vanillaforums.com.

    If not, here are some words concerning the default.master.tpl. It is a Smarty template file. So if you search this forum for "Smarty" you will find a lot of discussions that have directly to do with default master. Look at the directory /library/vendors/SmartyPlugins to get an impression what functionality you can insert into the template by simply adding {functionname} anywhere in the template.

    Besides of this (small) smarty functions, you have four main areas in the template, that are replaced with content by Vanilla. Those areas are called "assets".
    There is an asset "Head" which is in the <head></head> tag of your page.
    Asset "Foot" is the footer of the page. You must have an asset Foot in your page! You do not have to put content in there (more on that later), but it is needed for JS functionality in Vanilla.
    Asset "Panel" is the "sidebar" in Vanilla. It is the place where most modules are shown.
    The last and most important asset is "Content" where discussions are rendered to.

    So the default masters main function is to give your site a rough layout. The styling of comments, profile, etc. is not done with Smarty and no part of default.master.tpl

    The content for the assets are inserted by "controllers", which get their data from "models" and the rendering is done in "views" - you can read more on that by searching "MVC in php frameworks" or something like that on google. You can override views by copying them into your own theme folder. Most of the time it is better not to override them completely, but to insert code snippets with theme hooks.

    Theme hooks do what plugins can do: the hook into the program flow on predifned places and you have the possibility to add code to the output. You'll understand this best if you download a dozen themes and look at their source.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @Sar Well, the question of detail really depends on what you are trying to do.

    There are plenty of tutorials/threads/wiki entries covering pretty much most common end-use requirements.

    Vanilla is effectively open-ended in its scope for customisation, but it does require that the end user spends a bit of time learning how it works.

    I knew nothing of smarty and very little of css when I started using Vanilla.

    Personally, I found it easiest to learn by trying to do something specific, and then asking here when I got stuck.

  • Thanks Ngakaks and R_J. That does get me started, I appreciate your help. I can do some more research on this Smarty template thing now I have somewhere to start. whu606, I'm not trying do doing anything wild, just access the content so I can change the 'Howdy Stranger' message for one relevant to the forum and change some colours, font and header and banner sizes - I know styling is done through Css, but its accessing the content and then implementing the Css using the template that isn't clear. The forum is a Uni project - we've hosted it on the Uni server but even the IT tutors couldn't figure out what the template was and how to alter the content using it. Smarty isn't mentioned in the 'how to' documentation. At least I have a starting point now... thanks

  • R_JR_J Ex-Fanboy Munich Admin

    If you just want to change some text, look at that: http://vanillaforums.org/discussion/26597/tutorial-how-to-change-wording-how-to-change-text-how-to-change-language-how-to-change-locale
    The opening discussion has all you need for that.

    For changing some CSS you do not even have to create a custom theme anymore since there is a great plugin for small adjustments:http://vanillaforums.org/addon/cssedit-plugin

  • ooh thanks [clicks on links]

  • R_JR_J Ex-Fanboy Munich Admin

    Anytime :)

    Generally it is a good idea to also communicate what you try to achieve when you ask something.
    Most of the time there is more than one solution in Vanilla to get things done and the experience of the community can help you find efficent as well as informative solutions.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP
    edited February 2015

    @Sar

    Glad you are pointing in the right direction.

    Maybe try thinking of Vanilla like building a Lego house

    You have a variety of different 'blocks' you need to get the final outcome (windows/doors/walls/roof etc.).

    Customising Vanilla is mostly like changing those blocks before you get to build the house.

    Many of the blocks in Vanilla are pre-defined assets, which you can edit. You can also build your own assets.The defaultmaster.tpl file would be like the final instructions, once you've got all your blocks the way you want them.

    You can make changes directly in defaultmaster, but there is normally another way to achieve the same effect.

  • do I use HTML to make alterations under the TPL asset tags? I notice that a href is used as an example in the template? thanks

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... MVP

    @Sar

    It is normally better to say what it is you are hoping to do; that way you can get the best advice.

  • what I am hoping to do is change the content: such as category titles, and the row headers ( discussion, activity etc) and the forum title

  • Thanks but I read that a few days ago and it didn't help, well it did a bit- but not enough to get the file uploaded and working.
    I have a definitions file and it is not being read. This is why I was thinking of doing the changes via the master template instead. Where would I find the guest message module so that I can change the wording directly?

  • I don't have access permission to change the cache/ini file - is this a server issue or something I should change on vanilla?

  • R_JR_J Ex-Fanboy Munich Admin

    I guess you have either wrong file rights or owners. That's how I set up my installation. Not sure if this is the best practice concernign the owner groups, but I think the file right parts should be quite okay.

    find ./ -type d -exec chmod 755 {} +
    find ./ -type f -exec chmod 644 {} +
    chmod -R 775 cache/
    chmod -R 775 uploads
    chmod 775 conf/config.php

    chown -R root:root ./
    chown -R www-data:www-data cache/
    chown -R www-data:www-data uploads/
    chown www-data:www-data conf/
    chown www-data:www-data conf/config.php

  • R_JR_J Ex-Fanboy Munich Admin

    If I'm right that this discussion is basically the same issue as this one: http://vanillaforums.org/discussion/29373/howdy-stranger-changes-using-locale-technique#latest you might want to ask a moderator to close it.

  • If I go to the file in win SCP and try to read the cache file ' locale_map.ini' or any other cache file it says the owner is apache and the rights are :rw-r-----, so I can't read it or get into it to change the rights.
    In the above example are you using the command line to do this?

  • ...public_html/cache$
    find ./ -type d -exec chmod 755 {} +
    find: './Smarty/cache': Permission denied
    chmod: changing permissions of './Smarty/cache': Operation not permitted

    This is what happened when I typed this into the command line

  • R_JR_J Ex-Fanboy Munich Admin

    If the owner of this directory is apache, you have to change it. Do a sudo chown -R apache:root cache and retry.

    Maybe someone with knowledge of system permissions ( @x00 ) can tell if that owner combination makes sense...

  • Anyone have any ideas as to what to do?

Sign In or Register to comment.