How do large websites manage so many webpages? [closed] - html

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 2 years ago.
Improve this question
How do large websites create so many webpages? Do they make a new .html file everytime they want a new page on their website? I read something about how links on these large websites arn't really pages but created in a database. If so how can I make a website with a database for webpages. Im trying to make a website that lets users download stuff but that would be a lot of .html files so whats the best way?

Templating.
Depending on the type of page you want to serve: home, section, article, etc... the server knows how to respond to different page requests.
If the header code and footer code repeats over multiple pages you include this partials in those different templates
Since your question is focused on websites havig N pages say for example a website with many products, the design for a product looks the same, so all you need is to instruct the server how to handle a specific route:
example.com
head
welcome
footer
example.com/products
head
allProducts (pagination etc)
footer
example.com/products/101
head
product<id>
footer
here the server detects that a request for a route has some ID after /products/, your backend logic should use the article (product template), go grab that product ID from the database (image, images, title, description, content, price etc) and populate such single template with that data - and send it to the client.
That way no matter how many products (pages) you have, you need only one HTML template.
SPA (Single Page App) follows the same principle, just updating the content with AJAX (no page refresh)

That depends on so much stuff ...
Sure you could have a separate html file for every page. Especially if you want to not be javascript dependent. Routing then happens trough the folder structure and you access every page separately by making a GET request on the specified address.
That's old-school. I think that kinda changed with PHP & Wordpress where a page skeleton is fed with data coming from the db and then that is displayed to the user.
Nowadays your backend feeds data to your frontend, usually through json format.
So the page you are visiting is the front end of a web app. The backend waits for a request which it then handles by serving the right data, if authentification is OK. All that is done usually with PHP or any other backend language and using a DB, SQL or NoSQL.
The front end is only one tiny html page with nice javascript which just replaces any element in the page like you want depending on what the dev' decided to.
That's Angular or Vue.js

Edit:
See Roko C. Buljan's answer
above. It answers it
more eloquently.
In the future, I will focus on answering the actual question being
asked.
I'm new here.
Great question. The requirements for the website you're trying to make moves past what static .html pages can provide.
Although from what I understand you are trying to build might be complicated to build from the ground up, as David mentioned frameworks would be the way to go. for example a nodejs/vuejs app (website) built with a 'stack' of programming tools present one 'view' (page) and change the contents of the page based on what actions the user takes.
Here are tutorials on:
nodejs - the server.
vuejs - the view and brains of your app.
MongoDB - your database you referred to for stack style apps.
These 'stack' types of apps (websites) cut down on all the document transfers of .html pages for the user to wait for and really increases speed and usability.

Related

Do I need an HTML file for every single page on my website?

Say I have a product website, like Amazon (this is not the case, but it will help me explain my point), and I have a URL for every single product (such as with Amazon)...
Do I need to copy-paste and modify an HTML file for every single individual product page, or is there a way to use a "model" on which I can base all my other pages without recopying the whole code and modifying a few things in each?
I've just started learning HTML and web development, so bare with me if I'm asking a stupid question.
It just seems odd to me that a million-page website should host a million+ individual, nearly identical, HTML files.
Thank you very much in advance.
P.S. I'm using Amazon's brand name as an example here, and am not affiliated with anything related to it. Thank you for understanding.
No, you do not need an HTML file for every single page on your website. While you could do that, it is becomes very infeasible to manage the bigger your site becomes. On most websites you would have the following components:
A front end - consists of HTML code and usually some sort of template engine with placeholders for your data
A backend - consists of your data store (usually a database).
There will also usually be some form of API and/or middleware between your front end and backend.
If you go to https://example.com/myproductid in your browser, your computer will send that request to the web server. The web server will then retrieve your data, load it into the correct template, and serve the page to you.
In traditional HTML and PHP only websites, you would have to reload the entire page each time you went to a new product. However, you can instead use a technique called Ajax to only update certain parts of a web page rather than reloading the entire page. That way you can just update the text, images, and links that are specific to the product, and the rest of the page would stay the same. (Note: Ajax originally used XML, modern implementations usually use JSON).
Ultimately, you will want to learn some JavaScript and then start looking into various web frameworks or libraries such as ReactJS.
Not you Can have only one page for all product, but you have to make it Dynamic.
Yes you need an HTML document for your each webpage, like for Home page, contact us page you need different HTML documents

How to add search functionality to a static website?

I'm developing an encyclopedia-type site, of sorts. Essentially the site contains pages for words, definitions, concepts, and blog posts, and I intend to add a new page/post every week or so. I currently have about 40 HTML pages for each post. Previously I had been publishing a repository of the site to Github Pages, but recently I made the decision to host my website through Netlify. So far, I've enjoyed Netlify's features and it has improved my development process pretty well.
However, my website remains static. To be clear, I haven't created the site's files with a static site generator such as Next.js or Jekyll. I wanted the project to be a practice for hard-coding. The only files in the directory currently are HTML, CSS, and JS files (along with git attributes and things like icons and fonts) I've looked through Netlify's web applications and functions sections, however, nothing that I've found really hits the mark, whether it's because I'm a new user to Netlify, or because I don't necessarily have much experience in site indexing and/or back-end applications.
My question is, how can I implement a search bar and a title search functionality to the homepage of my static site? This would be for the process of viewers to easily find any specific post of mine once visiting. I would want the search bar to ONLY search the title of each html file (at least for now) in a designated folder I have for posts. Additional questions would be which, if any, web apps should I use to accomplish this, and should I consider changing the process of which I develop and host the site to accommodate for these?
Look at Lunr.js / ElasticLunr.js. Both allow you to create an index as a file and provide Javascript access that can be embedded in your page.
I'm currently working through that process now.
I think as you are not using database you can't have search functionality within the application. but you can google search within your website.
Check this out.
https://cse.google.com/cse/

Best way to display massive PDF on webpage [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
My company is looking to create a page for an accreditation document which is several hundred pages long. There are about five sections, each with roughly 40-70 pages.
What do you think is the best way to handle navigation and display for this? Currently the only thing I've got in my mind is a simple nav window on the left that directs to iframes of each section's PDF and lets Adobe's table of contents manage navigation from there.
OR I could make each section in the nav a drop-down and each subsection a separate PDF (to reduce load times), but that feels clunky.
Large PDFs are nice as there is less page jumping, but they have awful load times. Small PDFs are nice for the fast load times, but awful with jumping around.
Any ideas would be appreciated. I'm left scratching my head on this one.
We've server-side pdf-to-png converters for that.
The webpage is loading page by page as png-image via AJAX while scrolling.
Works like a charm.
On the PDF side, make sure that your document is optimized for fast web view. This would transfer the first page plus all the overhead, and then only transfer the pages which are requested.
Conditions for that is that the server supports byteserving (something any kind of new webserver should be able to do), and that the PDF viewer component used to display the PDF understands about byteserving (the Acrobat/Reader component does, for example).
For the navigation, you could use bookmarks, which you make displaying in the document options of the document. With a good set of bookmarks, navigation through the document becomes rather easy.
It is big PDF. Navigation is fine but you want that user should not download the pdf and each time they have to read from site. Second case is when many users are not interested complete the PDF file, They may download/read particular section.
As per my view you should break PDF in smaller section and sections should managed by navigation links.

Sitecore, why is so difficult? [closed]

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 9 years ago.
Improve this question
I am new to sitecore and my company has been using external company to manage their sitecore, which I totally understand, since it involved so much work on the development.
As a designer myself, I found extermely difficult to create a custom page unless I use what's already available. I could use simple page to insert my html codes but again, it's just way too long. In regular case, when you build a html site, you could simply create pages in dreamweaver and view it on your local computer.
I have tried to make a custom page with the presentation control, but each time I called a sub-rendering. the page is just a BLANK.
*so my 1st question will be, What's the procedure to create a custom page? *
I know sitecore suppose to be powerful and there is many api, I really would like to find out why I found it's so difficult......
my background is, designer base with knowledge of html, css, and php. I am not a developer that's for sure. :)
Thanks for taking time read my blah blah..:)
1st question will be, What's the procedure to create a custom page?
To answer your first question, there are some high levels steps you would generally take.
Create a page template that includes any fields or metadata you need to render the page
Create any layouts, sublayouts, or renderings necessary to render the custom page - this is where having access to a developer normally becomes necessary
Assign the renderings and datasources to the instance of your new template (or better yet, assign the renderings to __Standard Values item)
Publish everything out
You should reference the Self-Study to Building a Very Simple Site from Sitecore
2nd question will be, why do we need to call the developer each time when we want to have some feature inputs?
To answer your second question: To get very far with customizing Sitecore you will need to be a developer or have access to one. This can be mitigated to some extent depending on how flexible the solution is they developed. But let's be real - Sitecore is an Enterprise CMS, it's not Wordpress where you can install a theme and a few plugins.
As someone just learning, there are a number of options
Training from Sitecore - this is probably your best bet
Download and play with Launch Sitecore for sample code and examples to build a real website
Check out the Sitecore Marketplace for modules that can get things done for you
Subscribe to and read John West's blog for inside information of basically every aspect of Sitecore
3rd question is, why I can access the CSS?
This question doesn't make sense frankly, so I will assume it was meant to ask "How?" or "Where?" Without any more information about the site in question, you can normally map the URL to the location on disk. For example:
http://www.mysite.com/css/styles.css
This URL might map to c:\inetpub\wwwroot\mysite\website\css\styles.css
I do highly recommend that any code changes, including CSS, be done through your source control system and only be deployed following your standard release management.
Honestly, I don't believe you are qualified to modify and maintain the Sitecore site given your current training and experience level. The first step I recommend is getting that Sitecore developer training and any training available from your vendor on the specific implementation. Good luck!

Programming Languages required to develop a website like Imgur? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
I'm new to web development. So far, I have a good idea of HTML and CSS.
1) I would like to know what are programming languages are required to develop a website like Imgur and what's the role of each language that will be used.
2) Assuming that a user has just uploaded an Image to Imgur, What would be the required steps to generate a unique HMTL file for that particular Image.
You would need:
HTML
CSS
A server-side framework (e.g., PHP, Ruby on Rails, etc.)
Most likely Javascript (but you might be able to get by without it)
A database backend, such as PostgreSQL or MongoDB
You wouldn't need individual HTML sites. When someone goes to http://www.yoursite.com/image/1, the backend (usually .htaccess in Apache) will process it and turn it into /image.php?id=1, which PHP (or another framework) then uses to create an image-specific HTML page.
Good luck!
-totallyuneekname
1) You're probably best looking into either PHP or ASP for a server side language. Also learn SQL, as you'll need to store information about the images somewhere, and a database will probably be best.
2)
Get unique ID of image from URL
Get the address of corresponding image from database, along with title, description etc.
Fill data into relevant parts of your template, i.e image address inside image tag, title in h1 and title tags etc.
You wouldn't need to create new HTML files every time you want someone to view an image. You can just have 1 php file which loads something from a database which gets what you are looking for.
For this you'll probably need: HTML, CSS, MySQLi\pdo, javascript.
It might also be beneficial not just for you to learn a framework, but to work on one too, as it can help you in big projects.
One I regularly work with is codeigniter and it has a lot of good documentation to read through.