Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I am sure there must be an easy solution for this. I have started maintaining a website which is well-established. I need to add a new tab in the Navigation bar, which I did. However, I have to go through all the HTML pages in the website to reflect that edit.
Is there any other effective way, I can make the edit at one place and it gets reflected throughout. From what I have gathered, the site has multiple folders, and each respective index.html page as the HTML code for navigation bar. It is not importing or downloading it from some main source.
Any pointers would be appreciated. Thanks
If you are not using PHP or anything like that you could write it once and with HTML5 they have imports.
http://blog.teamtreehouse.com/introduction-html-imports
The easiest way when I deal with webpages like this is to convert all index.html to php (merely changing the file type). Copy out the navbar codes into a file, say "navbar.php". Then in every single index.php where the navbar should be, replace it with
<?php include 'navbar.php'; ?>
Add to "navbar.php" any additional folder paths that you may have.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
Maybe I'm not using the correct terminology because I can't seem to find an appropriate answer. I have built a header and a footer using html and css. This will not change from page to page and so I want to make it the template and simply change the content in between the header and the footer for each page of my website. I know I could simply copy and paste the code but if I wanted to change the header for some reason I would then have to change the header on each of my pages! Super inefficient. Coding is all about reuse. surely there's a way to do what I'm saying. Help me web developers!
You could do one of many things:
Use PHP files and require() the headers and footers in the main page, though you'll have to use a server on your localhost to test the pages.
You could maybe take a look into creating single page applications, using AJAX.
AJAX Introduction here.
You could go a step further and pick one of the very popular JavaScript MVC frameworks.
Read more about them here.
Finally, you could also do it the "old way" and use iframes, but that is honestly bad practice and will bring more harm than good.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
So I want to create a template that looks something like this:
http://i.stack.imgur.com/Qf38Y.png (Not enough rep to post photos, I'm new)
(I'm in high school and have just completed a HTML class)
I know how to make the template but I want to make it so that I can just write the title, image location and content in a form or text document and have it create a new html page with the information. I AM NOT ASKING YOU TO MAKE THE TEMPLATE FOR ME! I also need it to be able to update the pages if I change the template. Is this possible? If so please leave any tutorials below. I am NOT asking for you to write the code for me, I am just looking to see if this is possible and what languages it would require.
Thanks Much!
For that you will have to write an application, which will convert the data given by the user into an HTML webpage. This will require using JavaScript, HTML and CSS together. You can create an HTML page which will have <input> tags in it. Then using JavaScript libraries, such as FileSaver.js, you can create an HTML file and add data to it with JavaScript, probably using .appendChild() method. This was for a webapp, that will work in a browser, for desktop app you can use other programming languages or use Adobe AIR to package your webapp for desktop.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
So I'm working on producing my own version of a web/db project my friend was given in school. This is my first project in either area and I'm still learning. Part of the project description mentions all of the pages the client wants. I'm solving this by making an unordered list of links to the different pages with appropriate labels. Complex, I know.
Then I realized that every page will have this. My question is this: is there a way to class certain portions of code in html, so I can just have a "navigation list" in each page, instead of the full code of the list and everything associated with it, in every page?
I want the code to be clean and efficient. That's my motivation in this question.
Your question provides little detail, but it sounds like you want something like a php include. If you are running your site on your local, change the .html files to .php and do <?php include('includes/navigation.php') ?> where includes/navigation.php is a path to JUST your navigation code.
What you are talking about is templates. You cannot do it in plain html... You would need to use a server side language like php. You could also do it with a JavaScript templating language like handlebars or similar, but not in plain html.
If you don't want to use PHP or some other server side technology for a simple menu, you can try various Javascript plugins like MenuCool.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I would like to know how I can have a website that has links to deeper pages like so: www.example.com/ then I click on "Projects" (that becomes www.example.com/Projects) and then I click on a project (Which now becomes www.example.com/Projects/projectName/) How would I do that??? Please help, I really need these.
EDIT: Why are people down voting my question?
This is usually done with folders.
When you open www.example.com/Projects you are actually accessing www.example.com/Projects/index.html then let's say you want to access the project the folder Foobar so you type in www.example.com/Projects/Foobar/ and you are served www.example.com/projects/Foobar/index.html
However this can also be done with PHP URL rewriting and the use of a .htaccess fie.
Also when linking make sure that you start with a backslash (Absolute URLs) e.g.
href="/projects/test"
If the link was to "projects/test" and you were on that page then if you clicked on that link you would be taken to "projects/test/projects/test"
Well, usually to write a Web page you should learn html and then css. While learning html you will learn how to create a link.
In html a link is such as
my link
Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 11 years ago.
Improve this question
I'm new to this. I coded a front page (HTML, CSS) that says my site is under construction in TextWrangler. I have two seperate files index.html, style.css. I want to upload these to show up on Wordpress. How do I go about doing this? I'm a bit new to web development from scratch. I've done some work editing themes, just never had to upload anything, etc. I've decided to start a portfolio and would like to get this online with a proper CMS that fits my needs. How do I go about doing this? Please let me know.
Everything is here: http://codex.wordpress.org/Theme_Development
That describes what files you need, how header.php, style.css and index.php work, sidebars, theme standards, etc.
Create a new folder under wp-content\themes and place all your files in there. Rename your index.html to index.php and then start reading about how to implement the wordpress loop into your code. It's the key to success for your theme.
http://codex.wordpress.org/The_Loop