How to include CSS into a IntraWeb Project? - html

Explanation:
I created a new Standalone IntraWeb application via the "IntraWeb Application Wizard", and i put some buttons and edits with events inside, all the things worked fine, but the buttons and edits needs some style, because they are ugly.
Objective:
I want to stylize them using CSS to overwrite default style and add some new styles.
Problem:
I cannot find how to include a CSS File to my project for later using it in the StyleSheet property on my TIWForm.
What I've Tried:
I tried to put the css file manually into the Debug folder "same folder of the .exe" and too i tried to click File -> New -> Others -> CSS Stylesheet and then pasted the css code and saved it into the Debug folder "same folder of the .exe".
I need to solve this problem, otherwise i will be unable from using IntraWeb App.

The Standalone IntraWeb application by default looks for a folder named \wwwroot\ in the application directory. The Stylesheet.Filename path is relativ to this folder.
To solve your problem, just create ..\Win32\Debug\wwwroot\ and place your bee.css in there. Then in the object inspector change StyleSheet.Filename to bee.css.
If you prefer setting it up per code, you can do it in the onRender event like this:
procedure TIWSomeForm.IWAppFormRender(Sender: TObject);
begin
Stylesheet.Filename := 'bee.css';
end;
If you want to change the content folder, you can do the following:
function IWServerController: TIWServerController;
begin
Result := TIWServerController(GServerController);
gsc.ContentPath := 'Full\Path\Here';
end;
Be aware that you need to do this in the constructor!
Documentation can be found here: http://docs.atozed.com/docs.dll/classes/TIWServerControllerBase.html
PS: Don't forget to apply your CSS classes in the Css property.

Locate your compiled (exe) file (usually located in \Win32\Debug).
Create a folder named 'wwwroot' there and put your CSS file in that folder. (The folder MUST have this exact name. Any other name will not work!)
Click your form and edit the StyleSheet property:
Hint: The background image can be edited the same way.
Note that you might prefer to use but Intraweb is using .

Related

How to create non Django files in the static files template in a Django Project

I have a folder in my Django project called "templates", its linked to my main project which can access the files (HTML...) correctly as I can make it display stuff like "Hello World" but the project considers the files in the folder as Django files even though when creating them I typed stuff like main.css or main.html. The issue is it doesn't tell me if I have errors and it doesn't let me auto-fill so I was wondering if there was a way to fix this.
Picture of my Project
On the bottom lower right on your attached picture where it says django.txt, press it. This opens the select language mode utility function. Choose auto detect or the extension if you know it.
This automatically detects the file type and changes it to html or css; depending on the file type.

Navbar links with varying directory

my directory is shaped like this
image
in order to use my navbar between different html files, I made it into a seperate html file and use a placeholder to insert it where i need it. the problem is that now the links get thrown off.
for example: when im on the index file, the link works without a problem. however, when im in the about_us file, the link throws a cannot find in directory error because it would need ../ in front of the link.
any javascript I have also does not work for the nav.html.
any suggestions? is there a way to create links and start the directory from the root?
To navigate to the correct HTML file, you have to pass the full path of the HTML file.
For eg: If your application is running in https://localhost:8080 than you have to pass the full path as below:
Home
About Us
Or if you directly opening the HTML file in your browser without any server, than pass the full path of your project folder as below:
Home
About Us
Note: Always use the file or folder name with a hyphen - or underscore _.
For eg: instead of html files rename your folder name as html_files or html-files.

How to use SVG for logo in storefront theme

I want to use a SVG logo in my woocommerce storefront theme. I can't use the Customizer b/c it won't allow SVG uploads. Is there a way around that restriction?
If not, how would I edit the hook/action to use the SVG?
I see the storefront_site_branding template function in the storefront/inc folder and I tried creating an inc folder in the child theme but apparently the override does not work on files within the inc folder.
If you are using a child-theme you can add this to your functions.php, if you update you themes functions.php it may override during your next patch/update.
I sourced this code from:
https://themeisle.com/blog/add-svg-to-wordpress/
Method 1: Use the SVG Support plugin
If you’re looking for the fastest way to add SVG to WordPress, this is it. We’re going to use the SVG Support plugin, which enables this particular image format and adds support for it to your media library:
The process is simple. You just need to install and activate the plugin as usual, and then you’ll be able to add SVGs to your WordPress site.
WordPress now requires us to have the tag in our SVG files before uploading. Please open your SVG file in any code editor (such as sublime text) and add the following to the very first line of your SVG file and save, so that you don’t encounter security errors:
<?xml version="1.0" encoding="utf-8"?>
However, there are two more settings you might want to change depending on your needs. First off, let’s go to the Settings → SVG Support tab:
How to add SVG to WordPress using SVG Support plugin
Inside, you’ll find two options. The first turns on the plugin’s Advanced Mode, which lets you target your SVGs with CSS. If you don’t want to animate your SVGs, then you can skip this option.
Second, you can also restrict the ability to upload SVGs to administrators only by enabling the Restrict to Administrators? feature. That one’s up to you!
Method 2: Modify your site’s functions.php file
Every WordPress website has its own functions.php file. This essential component includes important functions, classes, and filters. It’s also your ticket to adding SVG support to WordPress through a few lines of code.
To reach this file, you’ll need to access your website via FTP. If you don’t have a client, we recommend using FileZilla. Once you’ve found your FTP credentials and accessed your site, you’ll want to head to your root folder, which is usually either called public_html or named after your site:
The WordPress root folder.
Now, enter the wp-includes folder and look for the functions.php file within. It’s important to note that this is the parent file, while there are also individual functions.php files for each of your themes:
The wp-includes folder.
For this example, we’ll add the code to the parent file. However, you may find the changes are lost when WordPress is updated, so feel free to alternatively add it to your theme-specific functions.php file depending on the approach you’re more comfortable with.
(Editor’s note: Doing this in your theme’s functions file is actually the recommended approach.)
Access the functions.php file now by right-clicking on it and choosing the View/Edit option. This will open it using your default text editor. Now, scroll to the bottom and paste this code snippet there:
function add_file_types_to_uploads($file_types){
$new_filetypes = array();
$new_filetypes['svg'] = 'image/svg+xml';
$file_types = array_merge($file_types, $new_filetypes );
return $file_types;
}
add_filter('upload_mimes', 'add_file_types_to_uploads');

How to add non scribble file to a scribble based website

I can use image to embed an image in my scribble document, and the render function will copy it to the target destination. Now, I would also like to include files with my document that is not an image, such as an MP3 or PDF file that can be downloaded.
Additionally, I can't just include the file in the source folder and link to it, because if I render the document into a different target folder, it does not get copied.
Finally, I know I can just create the target directory by hand, and paste the file there. Or I can modify whatever file I'm using to build my document to copy the file. This is not satisfying though because now I have to track the image in two places. The .scrbl source file, and either the target directory or the build file.
So, is there a way in scribble that I can include a non scribble (or image) file such as an MP3 or PDF such that the render function knows to grab it and include it with the document?
Although it is a bit of a kludge, you can combine image with hyperlink to get your desired result. You use the image function to get the render function to copy the file, and hyperlink to add a link to it. Your document will look something like:
Here is a #image{file.mp3}#hyperlink["file.mp3"]{file}.
This works because the image function also expects a list of extensions to try to embed, but this list defaults to the empty list, and such it won't embed the file, but only copy it into the destination. You can then use hyperlink to link to the now copied file.mp3 file.
You can combine this into one operation with the following function:
(define (embed-file file . content)
(list
(image file)
(apply hyperlink file content)))
And now you can use embed-file in your own document with:
Here is a #embed-file["file.mp3"]{file}.
(I should note that this idea came from Ben Lerner.)
I took over somebody's code base and they had solved this issue using the solution above/below mine provided by Leif Andersen. However, this caused problems when linking to files that were part of subfolders in the source directory. The file in question was moved to the root of the output directory, while the hyperlink did not correctly update. Instead, I found the following less hack-y solution.
You can make use of the link-resource structure of the scribble/html-properties module. This expects the path of the original file. You place this link-resource into a style struct of the scribble/core module. Finally, this style is passed as an argument to hyperlink.
Putting it all together, the embed-file function instead becomes
(define (embed-file file . content)
(apply hyperlink
file
content
#:style (style "place-resources-in-output-folder" ; name
(list (link-resource file)))))
Where the "place-resources-in-output-folder" is just a name I give to the style.
This ensures the files are both moved to the root output folder and correctly linked.

joomla 3.3 css module overriding doesn't work

I have use the backend feaure to create an override for the module djmenu. This automatically create the folder mod_djmenu in template/protostar/html and create a default.php in this folder.
I want to override the djmenu.css which is originally placed in module/mod_djmenu/themes/default/css, so I created in template/protostar/html/mod_djmenu the folder themes/default/css and copy paste the djmenu.css there.
I changed some simple but obvious CSS properties (background...) to test the override but it's not changing anything on my website and when I use firebug I still that the original file is used and not the override. I went across several tutorials but without success.
What I am missing?
Here is what you should do to make the css overrides work (it's working for the dj-menu module only not every modules though)
1) copy paste the css files you want to override in the template/protostar/css folder
2) in dj-menu module setting, select - override from template - on the theme field (first tab in the module page).