Jump to content

Loading javascript/css blesta core from outside template


Blesta Addons

Recommended Posts

in every release blesta update some files that are used in templates. and this can lead as to every time update the template folder with a cloned files from bootsrap folder, like the blesta-X.X.0 and some template files, we prefer if blesta make at least blesta-X.X.X loaded from another placement that is not related to a custom folder created by user, why not create a new vendor folder called javascript and put in it all the core javascript files .

also it would be nice to update the view in case of a pdt file is not exist in the custom template try to load it from the boostrap folder, this way if a custom file exist use it, if not load the default one (same approuch for a lot of CMS like wordpres, e107 ... ect ) , with this tip developper will concentrate only in a part that will be changed based in their design and is easy to make a revision in case for new release . a sample tip by updating the view Class

        if (!file_exists($file)) {
			// Use default template file in case the file not exist in the custom template folder
			$file = $this->container->get('minphp.constants')['ROOTWEBDIR']
				. $this->view_path . 'views' . DIRECTORY_SEPARATOR
				. 'client' . DIRECTORY_SEPARATOR . 'bootstrap' . DIRECTORY_SEPARATOR . $this->file . $this->view_ext;
        } elseif (!file_exists($file)) {
            throw new Exception(sprintf('Files does not exist: %s', $file));
		}

in my template folder i have only about 3 changed core files, all others are fetched from the bootstrap folder .

Link to comment
Share on other sites

I'm not sure what you mean by this:

On 8/31/2018 at 8:22 AM, Blesta Addons said:

...we prefer if blesta make at least blesta-X.X.X loaded from another placement that is not related to a custom folder created by user...

As for the idea of falling back to the default template if a file is unavailable, that may be something we could support in the future.

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