I'm developing a new version of a project. I'm developing on the old project itself and I'm not sure if there's something prohibiting access to that folder.
I try to access the images, css, js and it says that it does not find.
I don't know what to add here so ask me in the comments please.
Related
Static Files in Odoo
I'm new to Odoo, and am working through developing a custom theme for a client. I've worked through the theme tutorial despite the many errors and omissions that exist in that documentation (going to make a pull request to update that after I'm done). My latest struggle is dealing with static files in Odoo, specifically images in the theme.
The Setup
Running Odoo 13.0.20200323 on Ubuntu 18.04 in VirtualBox managed by Vagrant and provisioned with Ansible
The Problem
Changes to image files in the static folder are not reflected on the website. This includes updating the theme in the website theme settings (the update function seems to update everything else). I've changed image names, image content, moved them into other folder, and have not been able to figure out how to have any changes updated on the website. I've restarted the server, doesn't change anything. Updated the theme as stated above, doesn't work. The only way I've been able to have any changes reflected on the front end is to completely destroy and rebuild the server.
Questions
What am I missing? Is there a function I'm not running to trigger Odoo to update what it serves from the static folder?
How does Odoo work with static files in general? On the fly updates to files in the static folder don't seem to have any changes on the front end. Are the files in the static folder copied somewhere else on install, and then served from that other location?
Understanding
I understand that having images and other files change in a folder called static, doesn't make much sense functionally, and that's not my intention for this. Since I'm in development I need to make changes to files, like SCSS, JS, and images, and have those updates reflected on the front end without having to destroy and rebuild the server every time. To be clear, changes to SCSS and JS files that I've registered in .xml files and bundled with various Odoo bundles update just fine when I make changes to them and then update the theme on the backend in the theme management view.
My desire is to understand how Odoo handles the files in the static folder in general, how to update those files properly, and how to manage them while developing and for release.
Answers
I've figured out an answer to the first part of the question as to what I'm doing wrong. It seems like a browser caching issue. When performing a hard reload, empty cache and hard reload, or visiting the site in an incognito window changes are reflected to imagery.
As far as I can tell Odoo is just serving files from the static folder directly. Please correct me if this is not the case.
Follow-up
Does anyone have a good solution for working with changes like this and dealing with browser caching issues?
Answer: I've set up a a couple gulp tasks that use gulp-rev (will replace with gulp-rev-all soon) rev-del and rev-rewrite to handle cache busting through appending hashes to the file names.
I'm going to try setting up Browser-sync in proxy mode to see how that deals with changes to files on reload. I'll report what I find!
Update: Browser-sync has worked well so far as expected. But was kind of useless until I figured out how to work out a fix for the problem below
Does anyone know of how to automate Odoo rebuilding SCSS, JS etc. bundles? So that on file change the theme can be updated and the results seen without having to manually update the theme on the backend to see the results?
Answer: The main task was figuring out how to get live HTML/XML updates working. Which meant building Odoo from the source, and not making any updates or changes to the theme on the backend or frontend from within the Odoo interface. Passing the option --dev xml to Odoo when starting it with odoo-bin allows for the XML code to be evaluated directly, and makes live updates possible. But this extremely helpful (almost necessary) functionality is broken when you make any updates to the them from within Odoo. I'll report on any work arounds to this, but for now as long as I don't touch the theme from within Odoo (update the theme or make edits to it with their editor) then it works great. Also I had to bypass bundling my CSS and JS with their bundler initially to get those updates working live, but may be able to go back and rebundle them now that the code is being evaluated directly.
⭐️Boilerplate and Tutorial Series ⭐️
I'm going to get my whole process for theme building dialed in and then I'll be sharing the boilerplate and build tools on GitHub and also writing and filming a tutorial series on it. Since the built in documentation on that front is straight up error filled, omits critical information and also
I'm wondering how to best incorporate PHPSpreadsheet into Joomla! applications, on shared hosting.
With PHPExcel, you just uploaded the library.
PHPSpreadsheet is using Composer, which is new to me, but looks straightforward enough. However, I see Joomla! includes it to manage dependencies in the core, but does not publish the composer.json file, and commits the /vendor subfolder.
Any advice on the best way to safely add PHPSpreadsheet so its available to Joomla! extensions, without messing up Joomla! core?
You can just add a normal composer.json file in Joomla's root folder. Composer will then create a vendor folder on the main level, and leave the libraries/vendor folder unchanged for the Joomla core.
Any extension that wants to use libraries from the root vendor folder must take care of loading the corresponding vendor/autoload.php by itself.
use
JLoader::registerNamespace('PhpOffice', $pathToPhpOffice);
Similar lines to the above.... But how do you get PHPSpreadsheet installed on my hosted website, where I have limited access to the back end.
I can FTP to the root of the site.
I am totally new to this stuff. I have installed Joomla on my windows pc to test my changes to the site before I try them on the actual site and mess things up.
I was given a backup using XCLONER. I installed xcloner but cant seem to restore the website.
I am using XAMPP.
I am also unsure where to place the directory where the restore file should be.
Any help will help. Any tutorials on this? again, just starting out with this stuff.
Thank you in advance.
There are so many references and tutorials out there:
Google
Also Joomla.org has adequate documentation for this.
I can't say exactly about how the XCloner works, but the general steps to replicate Joomla is:
Copy and place the files and folders at the new location
Download the database
Create a new database at the new host (your computer) and import the data from the one you downloaded.
Configure Joomla (configuration.php) to connect to the new local database (host,user, password, prefix -if changed).
At this point you should be able to run your site to the new location, but you probably want to change also the path for logs and tmp folders, to reflect the new location.
I am looking for an extension to my joomla site where users can download pdf instruction sheets, forms, etc from a list of files available. I would must rather it forced them to log into the site to be able to download but I can adjust that by just making the module accessible to registered people only. So that is not a must have.
Anyone knows of any extension like this one? I know JoomlaShine has this extension in their JSN CUBE template but they don't offer it by itself.
Akeeba Release System (ARS on JED) is probably the best solution of it's kind and is free to download, we use it on several of ours and our client sites.
You can also combine it with the Akeeba Subscriptions (AkSubs on JED) system to manage site access including integrated access to file downloads.
Of course there are lots of document download extensions on the the Joomla Extension Directory.
I am new to moodle. I created a file upload in plugin. The file will be uploaded inside /moodledata/logoimage. I don't know how to display the file in UI.
I tried to display like /file.php/logoimage/logo1.jpg in the browser.
It says Invalid Course Id. If I access any image like /file.php/7/logoimage/logo1.jpg where 7 is the course ID the image works.
I didn't quite understand what you are trying to do and I don't think you want to store files in moodledata root, but the first thing you must pay attention to is that file management changed radically changed from version 1.9 to 2.x.
You should look for information in Moodle documentation (http://docs.moodle.org) and in the forums (http://moodle.org/forums/).
Moodle community forums are very active and I am sure you will get answers to your questions very quickly.