Jump to content

Customizing Blesta Interface


RRWH

Recommended Posts

After reading the excellent Site integration tutorial - I quickly came to realize that we can modify almost all aspects of the Site.

 

WARNING WARNING WARNING  - ALWAYS MAKE A BACKUP BEFORE MODIFYING ANY FILES

 

There are a LOT of *pdt files within a blesta install, and the one you want to modify is usually pretty easy to find.

 

From the doc root of your Blesta install, simply do the following

 

# find . -name "*pdt"

 

This will give you a list of ALL the PDT files used for the presentation of the site.

 

Now, say you have a little specific mod you want to do (and yes) I did.

 

The Mod I wanted to make was really quite simple - it is on the Support page.  (Portal -> Support)

 

We are setting up several Support departments - we only have a single Support department listed where you can raise a request without being logged in, all other departments you need to be logged in.  As it is not obvious, we wanted to add a little bit of extra text to the page.

 

First, look at the URL of the Page you are going to:

 

https://yoursite/client/plugin/support_manager/client_tickets/departments/

 

next list ALL the pdt files so we can identify what we want to modify, we went looking thru the list for a file that was a close match to the page path.

 

./plugins/support_manager/views/default/client_tickets_departments.pdt

 

looked to be a likely candidate for what we were trying to achieve.

 

First thing, we make a backup of the original file, just in case we mess it up and can easily revert to the original

 

# cp client_tickets_departments.pdt client_tickets_departments.pdt_orig

 

Then with your favorite editor, modify the file.

 

We wanted to add a very simple message to the page 

 

<div style="margin: 0 0 0 4em"><p><br />Existing Clients, Please login to see all Support departments</p></div>

 

Well, we took a moment, looked over the code and found what appeared to be the place where we wanted to add the text to the page.

 

                        <div class="heading first">
                                <h5><?php $this->_("ClientTickets.departments.heading_details");?></h5>
                        </div>
<div style="margin: 0 0 0 4em"><p><br />Existing Clients, Please login to see all Support departments</p></div>
                        <div id="departments" class="pad">
 
Now, when you go to Portal -> Support you will see what we added (see the attached Image) - In this case, it was pretty east to see where within the pdt file we needed to make the addition.
 
Pretty Simple!
 
The Final Step - remember, if you do an update or install a newer version that your mods may be removed.  You should also be keeping a document somewhere of what files you modify and exactly what you changed, so in the event that an upgrade replaces the file you modified, you can easily put your changes back in place - and of course, making a copy of the files you modified as well is probably a good idea as well.
 
Looking forward to seeing some of the other customization's that everyone does.

post-65-0-63191500-1378005136_thumb.png

Link to comment
Share on other sites

  • 1 month later...

On the subject of custom pdt files getting over-written - it would be a good idea if blesta supported a "custom" pdt file naming convention.

 

For example, if file client_tickets_departments.pdt is the original, and I want to make a change, I can create a file client_tickets_departments_custompdt.pdt. Blesta then for any pdt file, if it sees a _custompdt.pdt it will use this instead of the normal .pdt file.

 

This would mean there was no possibility of any custom view templates being over-written during an upgrade, and make it very easy to see which files have been customised.

 

-Barry

Link to comment
Share on other sites

  • 2 weeks later...

An idea I have that would be cool to be built in, is if blesta has git integration for revision control on files. This would allow easy diff/merging of updates to templates without overwriting customizations.

No reason you can't do this yourself. 

 

Every time there is an update I add the patch to my version control which allows me to see what the diffs are as well as manage any conflicts. 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...