Dynamic content in a web page - javascript

So I am making a quote website and i want to link each Author to a page where I can set his/her quotes so should I make a single html page for each one of them or there is an easy way to do that, ty

Yes, there is an "easy" way to do that.
It depends of what do you use to create this website.
Did you use any kind of CMS like WordPress? Or you are still using only HTML, CSS and Javascript?
In the second case, you will have do some back-end app to bring this dynamically.

Related

How to create multiple Html subpages without writing redundant code?

everyone currently I am working on a project which a Financial web application. But as I'm moving forward code redundancy is increasing & particularly for HTML code.
I have multiple Html pages on my website such as Dashboard, EditProfile, AccountStatistics, etc. For Eg.
DashBorad - enter image description here
EditProfile - enter image description here
AccountStats - enter image description here
Now judging from the above pics you guys can see every time we navigate from one page to another only the main section content is changing but the body structure & design of the website remains the same.
Problem: If i want to create a new page I have to include code for header, sub-header, sideBar, footer which is repetitive. I just want the main-section code to change. For eg - Made one file like Body.html which contains code for header, sidebar, etc & every time I want to create a new page then only code for the main-section has to written which be can later merge with the body.
How can we achieve this?
(Tech used - Html, Css & JavaScript)
Note: I can also attach code if anyone wants more clear understanding!
Thank You!
Cheers to coding :)
You can use Frontend Frameworks like React/Vue.
Depending on if it's a static site, you can use stuff like Jekyl/Hugo.
If you want to go the SSR way, then you have Angular Universal/ ASP.NET Core/ PHP way.
Depending on your use case, you can't really go wrong either way. If you're new, pick either one and get started Learning.
Have fun!
This is an excellent use-case for a library like ReactJS (and other similar alternatives). Using React you can define 'components' for your header, sidebar and other common parts of your webpages that can be reused in different places. You can also update each of these components separately.

SEO for dynamic web pages

I've created a website where some pages are dynamically created using JavaScript and PHP.
for exmaple: http://parkplanner.areitravel.co.il/park.php?id=6.
the content of pages is changed based on the parameter "id".
I know that a few years ago, there was no way for crawlers to scan this type of pages.
But now maybe there is a way or best practice to create dynamic pages so search engines will scan them and better SEO compatibility?
Thanks!
use php to add content relevant to the page into you title bar, also the image name and alt tags, you can also dynamically add in your keywords and description.
I develop in ColdFusion but all our SEO is controlled Dynamically according to the page, simply create the components dynamically. The search engines go to every possible link so they will also go through your dynamic pages

Having same <div> on all my sites

I want to create a site like any other. I want the "thing" at the top (home downloads and stuff) to be on all my pages. Do I need to copy and paste the same code over and over again?
put the common part in your header/some specific file and use ,since you will be using header/some specific file on all pages so the desired content will also be loaded.
Learn Psd to html conversion For batter understanding the divs and styles modification and customization.. your divs and tags can be easily maintained with your stylesheet by giving id and classes you can also give one dive multiple classes and ids,
you are talking about master page i think
that is one in style and in that page you're showing other page, likely we can say one template page and many functionality see this and
see this
As far as I'm concerned pretty much all the intelligent options for solving this problem are mentioned in this question
Use a server-side template (e.g.php), use a client-side template (e.g. handlebars), use javascript, or you could use a static site generator like Jekyll.

How can I display a non-styled HTML page inside another page?

I'm gathering HTML from a HTML-editor and save in my database. I want to display this data to the user, but I don't know how to do this without the HTML-text being affected by the styling of my page.
Are there any cool libraries around which can help me with this, or is there a very simple way using only HTML tags and/or javascript?
The easiest way to do this is probably simply stuffing your HTML into an iframe.
Have a look at this question if you want to set it as HTML: Set content of iframe .
But I typically simply accept that the contents of the iframe are loaded using a separate request.

Google "Sitelinks" for a website with almost only dynamic content?

I have a classifieds website, and the index.html is just going to be a simle form, which uses javascript alot to populate drop lists etc...
I have a menu also, put into a div container, but is this enough?
I mean, I have no content in index.html (almost), but a search form, which submits to a search results page, where all the content is.
So I am worried google might not find suitable sitelinks for my site?
Anybody know if I need to add something to the links in the index.html, which google might use for sitelinks? title tags etc...?
Thanks
Instead of changing your site around you can just create a good sitemap.xml file. That is of course if you're using GET for transferring data to your processing page. I would create a dynamic sitemap.xml page that is based on the form data that your processing page can read.
http://sitemaps.org/
http://www.smart-it-consulting.com/article.htm?node=133&page=37

Categories