Jump to content
  • 0

Custom Pages


Beware

Question

Hello all,

Sorry if this is in the wrong section.

 

I would like to know how to create custom pages within Blesta.

I have setup a trial install on my PC locally to develop the Blesta system with a custom developed theme that i created and i am having trouble figuring this out.

 

I'd like to be able to use my custom order page and link the order buttons to "add to cart" type of functionality & order that product.

I'd also like to know how you modify the portal page.

 

I'm having trouble locating the portal page template.

I am currently just developing the entire main site for my hosting company (I haven't started it yet, Just in development) and would like to get all this figured out so i can develop this software with my custom design and test it all out.

 

Thanks

- Beware

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 0

Hey scary username :),

 

The portal is found in: Settings > Company > Plugins > Installed > Portal click on Manage and you can edit that. If you only want one page you can do so by editing that page and the structure.pdt in /app/views/client/bootstrap/

 

If you would like to make pages like ourselves you can use our BlestaCMS which allows this functionality. You can try the edits by Rodrigo which is free: http://www.blesta.com/forums/index.php?/topic/2943-blesta-32-351-how-to-make-static-pages-by-modifying-portal-plugin/

 

Or Naja7Host has a Order system for free but it's not out yet.

Link to comment
Share on other sites

  • 0

Hey scary username :),

 

The portal is found in: Settings > Company > Plugins > Installed > Portal click on Manage and you can edit that. If you only want one page you can do so by editing that page and the structure.pdt in /app/views/client/bootstrap/

 

If you would like to make pages like ourselves you can use our BlestaCMS which allows this functionality. You can try the edits by Rodrigo which is free: http://www.blesta.com/forums/index.php?/topic/2943-blesta-32-351-how-to-make-static-pages-by-modifying-portal-plugin/

 

Or Naja7Host has a Order system for free but it's not out yet.

 

Thanks,

Although i can see how that would work for the portal itself, How does one go about creating custom pages like Contact (with Custom content), A custom order page (i have one just need to find a way to implement the order buttons with products and getting the page on Blesta in the first place), etc. ?

 

By looking at Rodrigo's code it appears as though it only modifies the portal?

There isn't much in terms of documentation to that modification as to how to add more pages than just modify the portal.

 

I have experience in doing this sort of thing with WHMCS, BoxBilling isn't too hard either but BB has way too much in it, It's more of a CMS / Billing system but contains way too many modules for what i need and it's a pain to work with when you get down to its javascript (error popups).

 

I see that Blesta uses it's .pbt files with a mix of HTML / PHP but implementing custom pages would be the main goal to get my custom template ported to a Blesta template then working from there.

Figuring this stuff out is the first step towards that :)

 

Thanks again :)

- Beware

Link to comment
Share on other sites

  • 0

Custom Order form:

If you are making a custom order form (aka something like this):

 

post-38-0-18648400-1453411204_thumb.png

 

You need to make a new template for the Order plugin, you can see them in /plugins/order/views/templates/

 

Custom Pages:

If you mean a custom webpage like:

post-38-0-72115900-1453411348_thumb.png

 

You can use the free edit to the portal, or use the Portal plugin for one page, or use our BlestaCMS (third party addon) for unlimited pages, a custom menu and a blog, but you'd have to integrate your design into Blesta via /app/views/client/Custom_template/structure.pdt.

Link to comment
Share on other sites

  • 0

Custom Order form:

If you are making a custom order form (aka something like this):

 

wizard_boxes.png

 

You need to make a new template for the Order plugin, you can see them in /plugins/order/views/templates/

 

Custom Pages:

If you mean a custom webpage like:

21 Jan 2016 09-22-03.png

 

You can use the free edit to the portal, or use the Portal plugin for one page, or use our BlestaCMS (third party addon) for unlimited pages, a custom menu and a blog, but you'd have to integrate your design into Blesta via /app/views/client/Custom_template/structure.pdt.

 

Similar to them both actually.

 

But rather this:

post-11924-0-31369400-1453430501_thumb.p

 

With BB all i would have had to do was insert the javascript call & add the order button variables and bam that would of worked.

 

Now i see that you guys are trying to help, & I'm probably making this much harder than it needs to be.

But is there a step by step guide on doing this or a tut or something? I hate trying to blindly modify a bunch of things. It makes doing the coding take forever by having to locate the files and modify them properly.

 

If Blesta had a proper template engine this wouldn't be a problem but since the entire system is based on a file loaded with html wrapped around PHP (or the other way around, w/e) it's much more complicated and actually needs some kind of guide to do this without taking forever to do properly.

 

Thanks again guys,

Sorry if I'm making it more work than it needs to be.

 

- Beware

Link to comment
Share on other sites

  • 0

Similar to them both actually.

 

But rather this:

sgM7s8M.png

 

With BB all i would have had to do was insert the javascript call & add the order button variables and bam that would of worked.

 

Now i see that you guys are trying to help, & I'm probably making this much harder than it needs to be.

But is there a step by step guide on doing this or a tut or something? I hate trying to blindly modify a bunch of things. It makes doing the coding take forever by having to locate the files and modify them properly.

 

If Blesta had a proper template engine this wouldn't be a problem but since the entire system is based on a file loaded with html wrapped around PHP (or the other way around, w/e) it's much more complicated and actually needs some kind of guide to do this without taking forever to do properly.

 

Thanks again guys,

Sorry if I'm making it more work than it needs to be.

 

- Beware

 

Well if it's pure HTML like a table you can do it by copying it into a page like: https://www.evolvewebhost.com/shared-hosting that's the easy way. PHP is server powered so depending what the PHP is you would put it in the /structure.pdt.

 

Then the HTML would go in the portal page or / custom page either with a edit of the portal, Naja7Host free admin_tools or our BlestaCMS.

 

 

So PHP / JS goes into the /app/views/client/theme_name/structure.pdt

post-38-0-24377700-1453460815_thumb.png

 

 

Then html goes into the Portal:

post-38-0-42764600-1453460838_thumb.png

Link to comment
Share on other sites

  • 0

You can't inject javascript/jquery on CMS pages . We have already discussed this subject , in new release of CMS It should take care of this and multi-languages .

The only way for you is a custom plugin to do that.

You can add your own table prices ,just search for thos that didnt need a jquery code .

Link to comment
Share on other sites

  • 0

You can't inject javascript/jquery on CMS pages . We have already discussed this subject , in new release of CMS It should take care of this and multi-languages .

The only way for you is a custom plugin to do that.

You can add your own table prices ,just search for thos that didnt need a jquery code .

 

Well if you put it in the structure.pdt file you can...

 

And it's not hard to put:

<?php if( $page_title == 'Shared Hosting' ){ ?>
<script type="text/javascript">
    window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
    d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
    _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute("charset","utf-8");
    $.src="//v2.zopim.com/?2T9YAhGuHLZdcbKamI0eNQi7QMbVlWqf";z.t=+new Date;$.
    type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script");
</script>
<?php }elseif( $page_title == 'Resellers' ){ ?>
<script type="text/javascript">
      (function (w,i,d,g,e,t,s) {w[d] = w[d]||[];t= i.createElement(g);
        t.async=1;t.src=e;s=i.getElementsByTagName(g)[0];s.parentNode.insertBefore(t, s);
      })(window, document, '_gscq','script','//widgets.getsitecontrol.com/14201/script.js');
</script>
<?php } ?>

You make it sound like you can't do anything lol you can it just means editing the structure.pdt not injecting it via a cms page.

Link to comment
Share on other sites

  • 0

I'm so confused...

 

Blesta needs a proper template system... This makes no sense, This is so confusing.

I have never had this much trouble working with a billing system in my life... And i haven't really even tried to do much cause its so damn confusing.

 

My template is pure HTML / CSS.

No biggy.

 

Then you look at the blesta .pdt files and i go wtf? where does half these go?

 

I don't want the standard Blesta theme.

All i want to do is place the Blesta PHP wrapped inside my custom HTML and bam done.

 

But what i keep getting here is i have to do a ton of work or something... All i should have to do is edit a file, change all the HTML and place the template calls where they belong and it should work....

 

I can't get any of this straight... I just keep getting told to use this mod or edit this portal and that shouldn't be needed... I can't even get it straight, I'm so confused on this entire subject it's almost worth just bailing on Blesta and creating a WHMCS theme and spending the money on WHMCS rather than Blesta simply because of simplicity regardless of security. This is just plain outright stupid.

 

 

EDIT:

Like seriously.... Theming Blesta is so confusing it's ridiculous.

 

This:post-11924-0-76291800-1453524813_thumb.p

vs

This:post-11924-0-81558000-1453524820_thumb.p

 

 

What's easier to work with and more appealing? Definitely not Blesta.

The opponents script is a million times easier to work with, Why? Because they have a proper system. Regardless of security and how much better Blesta is I'm almost just flat outright tempted to dump the Blesta idea entirely and code on a script that doesn't take ages to figure out let alone design.

Link to comment
Share on other sites

  • 0

I'm so confused...

 

Blesta needs a proper template system... This makes no sense, This is so confusing.

I have never had this much trouble working with a billing system in my life... And i haven't really even tried to do much cause its so damn confusing.

 

Blesta has a template system. It follows the MVC design pattern where the views (templates) are constructed dynamically from the needs of the controller and injected into the page structure where necessary. This is common practice now to save processing resources over less efficient designs and to separate business logic from presentation.

 

If you find the design confusing, as you've mentioned at least three times, that's usually a good point to stop and take a step back to analyze what you're doing and to understand the constraints of the design you're working within.

 

 

My template is pure HTML / CSS.

No biggy.

 

Then you look at the blesta .pdt files and i go wtf? where does half these go?

 

The template (.pdt) files for the admin and client UIs are found under /app/views/admin/ and /app/views/client/ respectively. Most template files are named according to the controller and method from which they extend for the page that they render. This naming scheme can also be derived from the URI of most pages in your browser, e.g. a URI of '/admin/clients/' is constructed from the /app/views/admin/default/admin_clients.pdt template file.

 

 

I don't want the standard Blesta theme.

All i want to do is place the Blesta PHP wrapped inside my custom HTML and bam done.

 

I'm not sure what you're intending to do. After reading this thread, I don't think you've adequately described the behavior you're expecting to accomplish. "Wrapping" Blesta code means you are nesting it within your own. Blesta generates complete HTML pages, so unless you're using an iFrame or using the Blesta API to display your own content, "wrapping" it is not something that would work for you.

 

 

But what i keep getting here is i have to do a ton of work or something... All i should have to do is edit a file, change all the HTML and place the template calls where they belong and it should work....

 

Blesta does not contain all HTML in one file. This is why we have templates. You could change the parent template (structure.pdt) which generates the header and footer of every page, but that depends on the results you intend to achieve.

 

Per the MVC design and the separation of business logic, templates do not make calls to anything in code. Curious which template calls you are referring to.

 

 

I can't get any of this straight... I just keep getting told to use this mod or edit this portal and that shouldn't be needed... I can't even get it straight, I'm so confused on this entire subject it's almost worth just bailing on Blesta and creating a WHMCS theme and spending the money on WHMCS rather than Blesta simply because of simplicity regardless of security. This is just plain outright stupid.

 

As I mentioned above, when confused, step back and take a look at the bigger picture.

 

Blesta is designed to be developer-friendly, where the source code is available for edit, natively. I get the feeling that you are not a developer per se, but rather an end-user programmer. It's common for end-user programmers to shy away from better designs, if only because they appear complex and unfamiliar. However, the MVC design is far superior to many other designs, which is why it has become popular in web application development.

 

The mods/plugins others have mentioned are extensions to Blesta, like the Portal plugin, to enhance functionality beyond the core system. The Portal plugin currently only allows the edit of the main homepage of your Blesta installation. Anything else that is more custom needs to be written as such. naja7host's Admin Tools plugin, for instance, allows you to define more custom pages beyond simply the homepage of your Blesta installation like the Portal plugin allows.

 

 

EDIT:

Like seriously.... Theming Blesta is so confusing it's ridiculous.

 

This:

vs

This:

 

 

What's easier to work with and more appealing? Definitely not Blesta.

The opponents script is a million times easier to work with, Why? Because they have a proper system. Regardless of security and how much better Blesta is I'm almost just flat outright tempted to dump the Blesta idea entirely and code on a script that doesn't take ages to figure out let alone design.

 

You say the competitor's script is easier to work with because they have a proper system? To which proper system are you referring?

 

Contrary to your interpretation, your screenshot comparison of a template shows me that Blesta is easier to work with from a developer's stand-point.

Here's a few reasons why:

  • Blesta provides access to source code in templates, that is, the source PHP that renders template HTML, giving you complete control over its use
  • Blesta does not obfuscate code through a middle-ware system, like Smarty templates, which adds additional syntax to understand and an unnecessary second layer to UI presentation
  • Blesta makes it easy to secure your display of variables by using the HTML helper. Using the helper keeps you from making common mistakes that lead to XSS vulnerabilities by forcing variables to be output HTML-safe
  • Blesta makes it easy to generate forms using the Form helper. The Form helper also embeds a CSRF token to prevent users from being the victim of CSRF attacks in Blesta.
  • Blesta appears to be tabbed better for read-ability
  • Blesta defines a more modern structure of HTML and CSS to avoid out-dated uses of multiple line breaks (e.g. <br /><br />) where paragraphs or CSS padding/margin should be used instead. Additionally, inline attributes (e.g. "align=") like "<p align='center'>" are avoided in lieu of proper CSS styling defined in stylesheets.

I'm not sure why you think the second screenshot looks more appealing, but looks are subjective. I work within objective constraints.

 

tl;dr

What are you looking to accomplish with your theming exactly? It may be better for us to understand what you're doing if you could describe what parts of the system you intend to change, in what way, and provide examples to illustrate these points.

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
Answer this question...

×   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...