I have a dolphin 7.0.9 website and was trying to figure out how to put a picture background on the home page?
I have a dolphin 7.0.9 website and was trying to figure out how to put a picture background on the home page? | ||
You would upload the image to some part of your site, say /media or make a new directory /images or you can upload it to the images directory of the template; the example below is a file that is uploaded to the template's images directory. Then in the common.css file you would find the body entry and add the url for the image.
body {
background: url("../images/background.jpg") fixed center top #000000;
}
Look up the css background selector to see how to set up for your particular image.
Note, the ../ is telling to go up from the css directory of the template; you can also code an absolute path to the image as well.
Geeks, making the world a better place | ||
You said Home Page. The code I presented will add it to all pages of the site. If you want different images on different pages, then it gets a bit more complicated. The way I put different images on different pages was to use Deano's head injection module. Not only will it allow you to put different css on each page but javascript as well and anything else you might want to put in the head tag. Geeks, making the world a better place | ||
I cannot find the source code for my homepage anywhere, spent hours looking for the correct file to make the change? | ||
I answered on other page then saw where you deleted so I deleted. Here we go again. There is no source code for your home page since the page is generated dynamically from template files and blocks. The layout of a Dolphin site is dependent on template files. Dolphin will come with the base template files, and then an Uni (do not delete Uni as it is needed for the admin section) and Alt. You will need to read up by searching the forum here about how Dolphin's template system works. Now, the common.css file holds a body tag that gets applied site wide. There is also an index.css file that HL mentioned above. HL indicated that if you add a body tag with background to the index.css file, that the background would get applied to the index page; the home page, overriding the body tag in common.css. If index.css is loaded after common.css, then it is lower in the list and that would be true. Try it and see. Geeks, making the world a better place | ||
Sorry about the double posting, new at this, and worry about posting to correct forum. Thanks for your effort to help. I will read up on templates for sure. But how in the heck and where (folder/file) did I add that line of code (line 500 in screen shot). I did it about 6 months ago and cannot remember how I did it. Have I some how messed up and the code I inserted for the homepage to show background-image for HP only and it's in the wrong place. My site works great, Homepage displays the background-image and all other pages do not, just as I wanted. But I need to change the background-image to a different image. If I could access folder/file?? line 500 in the Cpanel for now that would handle my problem???? | ||
If I could access folder/file?? line 500 in the Cpanel for now that would handle my problem????
Looks like from you screenshot, index.php line 801. ManOfTeal.COM a Proud UNA site, six years running strong! | ||
Poor resolution, it's Line 500. But cannot access the folder/file that would access the code on line 500. I would think that if I opened up index.php in cpanel code would be there but all I get is..... see screen shot attached. Only 77 lines of code. | ||
index.php does not create the home page directly; there are lots of things involved. For the background, you should have added it to the css for the template. Which template are you using? You can find that by looking in your admin section. If you added the background correctly the first time, you added it to the css in the template file. /templates/(template_name)/css/ If you turn off caching of css in the backend, then firebug will show you not only the class or id but also which css file that class or id is located in; you will still need to know the template you are using. Then you can navigate in your cPanel file manager and edit the file. Geeks, making the world a better place | ||
Poor resolution, it's Line 500.
You have a PM ManOfTeal.COM a Proud UNA site, six years running strong! | ||
OK, I was not paying enough attention; I was thinking of the way you are suppose to do it; not how you had done it. Styles should not be coded into the index.php file that way, you should have used the template system; or at least set up an external style sheet and called it. Geeks, making the world a better place | ||
If Newton is offering to help on this, you can trust him to get it resolved. Geeks, making the world a better place | ||
I thought I had done this wrong. OK, so is there a fix to get me back to the way it should be so I can control what I'm doing now (successfully, my site works), but in the correct way. I would like to use css to have background-image show only on homepage only. But main problem will still exist, how do I access line 500 in my homepage to delete the style I added?? Have spent hours looking for that code without luck. Thanks! PS - www.faceclubusa.com if you wanna look see | ||
If Newton is helping, then I am going to stand by because two will just be stepping on each other's toes. You could have added it to any of the files that work to generate the home page. Geeks, making the world a better place | ||
I'm not good with css, go right ahead GG. They may have found the solution. ManOfTeal.COM a Proud UNA site, six years running strong! | ||
It will have to wait until sometime tomorrow. Friday, Geeks, making the world a better place | ||
If you are using the default UNI template then open /templates/base/page_1.html and put this at the top then add any css style you want in between the style tags.
<style type="text/css"> body {background-color:#CCC;} </style>
If you are using a 3rd party template then create a page_1.html in the root of your template folder and paste this in it.
<style type="text/css"> body {background-color:#CCC;} </style>
<bx_include_auto:_sub_header.html /> __page_main_code__ <bx_include_auto:_sub_footer.html /> https://dolphin-techs.com - Skype: Dolphin Techs | ||
I'm not using 3rd party templates, and changing /templates/base/page_1.html had no effect. I need to find the file which shows code for homepage, line 500, to make any changes, even if I want to start over and do it the right way with proper template and css coding, because I will need to delete in #Body / ID in line 500-506! But this Homepage Code is hiding and I cannot find it anywhere, this is where I need help for now. Its over 1500 lines of code that is hiding from me. I also cannot find the file where #body css is which would also solve my problem by allowing me to change it So basically there are two routes I could use, find the homepage html file and line 500 code -OR- find the file which contains the css ID #body code. Thanks for jumping in and trying to help me with this issue. (I Attached another screen shot for review) | ||
you need to clear your cache folders after editing .html files and .css files. you can do this from dolphin admin tools cache functions or clear cache and cache_public folders by hand. https://dolphin-techs.com - Skype: Dolphin Techs | ||
Thanks D-J
/templates/base/page_1.html put me in touch with the Body HTML (info I've been searching for hours!!!!!)
I can now see the code in the Cpanel and in my website creation program Expression 4. I'm experienced in web design, html, css, etc, but not when it involves data bases, templates, etc., still much to learn .
Now I can begin the journey that G-G recommended and get a complete understanding of how templates work and interact within dolphin.
A question, does the index.php in the root cause template/base/page_1.html to start and thus the code in page_1 actually acts as the homepage? Or is my thinking wrong on that. I'm used to looking at index.htm pages which contain all the homepage code.
My fix prior to your steering to page_1 was to copy all the code I saw in Firefox and paste it into the index.php file, and it worked. I now have full control of my homepage (index.php), both html & CSS, but only through Cpanel/Web Expressions 4. But as I did that cut & paste routine I was thinking that the administration panel is not going to see that page (index.php) as a page in Page Blocks, which it didn't, and I would not be able to manipulate the page in the Administration interface, which I could not as a result of it not showing itself in the drop down menu.
So I was left to manipulating the homepage by writing the code/css either in Cpanel or Web-Expression 4 which I know is not good, or correct. Especially when I hire a webmaster to take over for me and expect them to ONLY use the admin. interface panel to make changes. Any ideas to get me back on track. I thinking the response is gonna be fresh install. I have made multiple changes to CSS, like changing thumbnail pic from 16x16px to 32x32px for example. I guessing I'll lose all those changes if I do a fresh install as a result of not making my own CSS file? Thanks, Bob K. | ||
yes, index.php calls the page_1.html file with a string of code.
$_page['name_index'] = 1; around line 43
A couple of lines down defines the css for the index page.
$oSysTemplate->addCss(array('index.css'));
In my example i gave you i used in line css so it overrides anything in index.css
If you made crazy changes to the index.php in the root folder just upload a new copy of it... no need to re install dolphin just to fix that. https://dolphin-techs.com - Skype: Dolphin Techs | ||
So instead of adding css directly to the page_1.html template, manipulate the index.css file for making any layout changes. Keep the style in an external style sheet where you can easily make any changes. Plus, you can easily have different templates this way and simply switch the template in the backend; switching the template will load in the index.css file that is located in that template. Geeks, making the world a better place | ||
Thanks much to you both for the last 2 replies!! Gonna spend time with what you have shared with me and get familiar with all of it. Then if questions remain I'll be up to speed with regards to all you have taught me. Thanks again for hanging in there with me and my lack of understanding of the mess I created for myself!! Hope you're having a great long weekend holiday. Bob K. | ||
I cannot get index.php to point to templates/base/page_1.html
Do I have a bad index.php file..... If so its the only one I have. (downloaded today from boonex)
Here is my index.php file attached for review.
<?php /*************************************************************************** define('BX_INDEX_PAGE', 1); if ( !file_exists( "inc/header.inc.php" ) ) echo "It seems to be script is <b>not</b> installed.<br />\n"; require_once( 'inc/header.inc.php' ); require_once( BX_DIRECTORY_PATH_INC . 'db.inc.php' ); bx_import("BxTemplIndexPageView"); //-- registration by invitation only --//; check_logged(); $_page['name_index'] = 1; $oSysTemplate->setPageTitle($site['title']); $oIPV = new BxTemplIndexPageView(); $_ni = $_page['name_index']; PageCode(); ?>
| ||
No replies to above. So I have decided to try to get my site back to its original install state.
Homepage Name was set to '0' instead of index. Have no idea how that happened! But I now see homepage in admin and can also work with it.
1 Sorry, site is temporary unavailable. Please try again later.
I have studied what has been suggested and now understand templates and such, but I now just want to get things back to the way they were when first installed. |