Resources? #2 - Post ID 259191

User 2488786 Photo


Registered User
190 posts

Can you explain how, why and when I would use the resource tab?
I understand adding pictures, but I saw somewhere where someone had suggested that someone add some code to their resources.
I have been copying and pasting the code in my head section to make modals and RCS work, so would just add it here and what else might I use resources for?
Thanks,
Rick
An expert at using the wrong tool the right way.
User 2088758 Photo


Senior Advisor
3,111 posts

Hey Rick,

You cannot add code there per say. You can add other files say like if you had a Menu Builder menu. You can import the folder with all your stylesheets, images, js and such. I wouldn't recommend it unless you are completely aware that if you were to make changes to your menu in Menu Builder you would have to go back to your resources and remove and readd the new folders.

That probably sounds confusing.
Taking over the world one website at a time!

Steve Kolish
www.misterwebguy.com

YouTube Channel:
https://www.youtube.com/channel/UCL8qVv … ttneYaMSJA
User 10077 Photo


Senior Advisor
1,096 posts

I agree with Steve. When it comes to adding items to the resources, it is most efficient to add static items such as images. For example, you can add menu builder javascripts and css files, but if you make a change later, you have to remove them from resources and then re-add them. It only took once for me to realize that it's not efficient.
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/
User 2488786 Photo


Registered User
190 posts

OK then there you have it!
I'm going to stick with the basics, and just keep on doing it like I have been.
Wouldn't be that bad, but I have reloaded pages so many times as I learn these programs that I was just hoping for the easy way out.
Thanks,
Rick
An expert at using the wrong tool the right way.
User 10077 Photo


Senior Advisor
1,096 posts

If you have a large site, it gets tedious having to update every page when you make a small change to something that appears on every page. The two areas I run across the most like this are info that goes in the <head> (such as css and js links) and navigation menus.

Depending on your hosting setup, you should be able to use .htaccess to set up your server to execute PHP in html pages. Once that is done, PHP includes make it very easy to update things sitewide.

For example, in the settings tab there is a box called "header." For every page, in the header section, add
<?php include('includes/inc_head.php'); ?>

Once you export your site, create a folder called "includes" (no quotes), and create a file called "inc_head.php" (no quotes) in that folder. Now add whatever you want to inc_head.php (such as MB <head> code, Google Analytics code, etc.), and it will be included in the <head> section of your page(s).

You can do the same for MB files. Put the <head> parts of your MB export in inc_head.php (see above). For the body part of the MB export, add an html element on every page where the menu should appear. In the html element, put
<?php include('includes/inc_menu.php'); ?>

In the includes folder you created earlier, add a file called "inc_menu.php" (no quotes). Put the <body> part of the MB export in the file inc_menu.php. Your menu now appears on every page that has that html element, but you only had to add the actual menu html one time. Later, if you update your menu, just replace the code in inc_menu.php and it is updated across the entire site.

Being able to do this is contingent on you being able to change your server to run php code in html pages. Check with your web host about how to do it and be sure to test it before going live. If you need help, my contact information is below.
ASK ME ANYTHING
I provide personalized help for Coffeecup Users including personal or group training for Site Designer, Web Form Builder and more via Zoom.
Email me at support@uscni.org or call 865-687-7698.

Did you know that Web Form Builder can be used for both simple and complicated forms and that it's not limited to the default fonts and buttons? Take a look at a form we developed for WindowTinting.com.
https://forms.windowtinting.com/forms/w … ppingcart/

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.