SPECIAL OFFER: Only $69 for access to everything in OSTraining for 1 year! You save $75! 
Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!

add html code to my website

5 years 11 months ago #119803 by diamondmaxx
add html code to my website was created by diamondmaxx
I have some custom code I need to add to my website on the main URL of our website between the body and the /body tags. I am not sure how to best add this code from a marketing firm. What is the easiest way for me to do this since I am not that familiar with the file names using the File Mgr or exactly where to go in the J 2.5 interface.

thanks,
Maxx

Maxx Diamond

Please Log in to join the conversation.

5 years 11 months ago #119817 by Valentin
Replied by Valentin on topic add html code to my website
Hi Maxx,

You can add the code directly on the template file (templates/your-template/index.php) or in a custom html module as this post explains in "Save javascript in Custom HTML modules" section

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

5 years 11 months ago #119916 by diamondmaxx
Replied by diamondmaxx on topic add html code to my website
Here is a copy of my index.php file - doesn't look like the one I was expecting. I need to add some code between the <body> and </body> tags. This is the file I am looking for.

Am I adding javascript as you mention below?

cheers,
Maxx

Maxx Diamond

This message has an attachment file.
Please log in or register to see it.

Please Log in to join the conversation.

5 years 11 months ago #119922 by Valentin
Replied by Valentin on topic add html code to my website
Hi Maxx,

Due some security settings on OSTraining the index.php couldn't be uploaded correctly.
Paste in your next reply the portion of code you want to include in the body.

You can add the code just before closing the body tag or load it in a separate .js file as this tutorial explains in "Tip #1. Load CSS and JS files" - however in that case the code would be loaded in the head tag, not in the body.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

5 years 11 months ago - 5 years 11 months ago #119938 by diamondmaxx
Replied by diamondmaxx on topic add html code to my website
when I attempt to replay with copies of my code I get:

Forbidden

You don't have permission to access /support-forum/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

however this replay goes through. The one I get the error on is just copies of .txt files only.

Maxx Diamond

Please Log in to join the conversation.

5 years 11 months ago - 5 years 11 months ago #119941 by Valentin
Replied by Valentin on topic add html code to my website
Yeah, that message is because some code is beign blocked by the security of our site.

To add javascript inside the body , you can try this way:


Let me know if that is helpful for you

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

This message has an attachment image.
Please log in or register to see it.

Please Log in to join the conversation.

5 years 11 months ago #119956 by diamondmaxx
Replied by diamondmaxx on topic add html code to my website
We're getting closer. I just want to know what FILE via the filemgr to add this code to. I need to add my code between the <body> tags. Am I making any sense? I cannot identify the filename that has the html with the body tags. If I know this, I can add the code.

thanks,
Maxx

Maxx Diamond

Please Log in to join the conversation.

5 years 11 months ago #119959 by Valentin
Replied by Valentin on topic add html code to my website
In your file manager (I assume through cPanel) be sure you're inside public_html folder (that's the name in most cases), then go to templates/your-template/index.php where "your-template" means the folder of the template you're using.

That's the file to edit in a native template.

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

5 years 11 months ago - 5 years 11 months ago #119966 by diamondmaxx
Replied by diamondmaxx on topic add html code to my website
Valentin, we are getting closer each time. Here is the overall problem. You can't see the file names so you are guessing what the name of the file and the name of the template is. This is confusing to me.

So....here is my trail:

I go to cPanel in Arvixe.
I switch accounts (we have 5 of them) to golfcarsofaustin.com
I select the File Mgr
I now have 4 options:
home directory
web root (public_html/www)
Public FTP root (public ftp)
document root for
golfcarsofaustin.com

I have been choosing web root - is this correct?
I now see all the file folders and choose templates
Now here it is a little confusing......I have
atomic
beez5
beez_20
golfcars
sparky_framework
system
yoo_nano2
yoo_tasty
index.html

Just wondering why so many. So I choose golfcars (it is listed as the site default in Joomla listing of 7 templates shown.

Now I see more file folders and down the line is a file called index.php

I highlight and open it with an editor and this is all I see:

<?php
/**
* @package yoo_tasty
* @author YOOtheme www.yootheme.com
* @copyright Copyright (C) YOOtheme GmbH
* @license www.gnu.org/licenses/gpl.html GNU/GPL
*/

// no direct access
defined('_JEXEC') or die('Restricted access');

// include config
include_once(dirname(__FILE__).'/config.php');

// get warp
$warp = Warp::getInstance();

// load main template file, located in /layouts/template.php
echo $warp->render('template');


So it just doesn't like like the html file with the body tags I am looking for so that I can insert my code.

thx,m
maxx

Maxx Diamond

Please Log in to join the conversation.

5 years 11 months ago - 5 years 11 months ago #119969 by Valentin
Replied by Valentin on topic add html code to my website

Valentin, we are getting closer each time. Here is the overall problem. You can't see the file names so you are guessing what the name of the file and the name of the template is. This is confusing to me.

I understand what you mean, however each server has its own way to organize the files. Without the full access I can only suggest generic guidelines.

I have been choosing web root - is this correct?
I now see all the file folders and choose templates
Now here it is a little confusing......I have
atomic
beez5
beez_20
golfcars
sparky_framework
system
yoo_nano2
yoo_tasty
index.html

You're in the right path :)
Now, from that list: what's the template you're using?

Just wondering why so many. So I choose golfcars (it is listed as the site default in Joomla listing of 7 templates shown.

Joomla display all the templates you have installed, no matter if you only use one.

Now I see more file folders and down the line is a file called index.php

Remember I mentioned in my previous reply that my suggestion applies to native joomla templates?
If you're using a yootheme template, those include a bunch of extra files organized in different ways. To add custom code in the body of a YooTheme template is necessary to follow YooTheme developers way - check "Layout overrides" section

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

5 years 11 months ago #120131 by diamondmaxx
Replied by diamondmaxx on topic add html code to my website
If I set OST up a login, can someone tell me what file via the J 2.5 interface I can add html code to between the <bocy> tags?

Thanksl
md

Maxx Diamond

Please Log in to join the conversation.

5 years 11 months ago - 5 years 11 months ago #120158 by Valentin
Replied by Valentin on topic add html code to my website
Hi Maxx,

What is the style of your template? As seen in " Override cascade "?

Once you know the style your template is using, check "Layout overrides" section:
To customize the general theme layout, you need to override the /layouts/theme.php. To do so, create the /styles/STYLE-NAME/layouts directory, copy the file in there and start adding your own PHP code.

The theme.php file contain the body tag and would be located inside /styles/STYLE-NAME/layouts/

Kind regards,
Valentín

Follow us on Twitter - twitter.com/OSTraining
Like us on Facebook - facebook.com/ostraining

Please Log in to join the conversation.

Join today and get access to 1,000's of books and videos. Learn WordPress, Drupal, Magento, Joomla and more! Sign up today!