I have a typo3 website with no user genrated or dynamic content.
So it is unnecessary to use php and the database.
Is it possible (with php) to clone the hole website and store every page as an html page?
I have only a normal webspace, so i cant install tools like "eAccelerator".
My idea:
- grab every link from the sitemap
- file_get_contents -> store as html
But i think this is not a clean solution? Or?
Thanks in advance!
james
you can use a simple software called HTTRACK., here is the link:
httrack.com
Why you need to use php to copy it? Did you consider using a command line tool like wget? wget allows you to create an "offline" copy of a website which you can of course host somewhere else. Sounds to me exactly like the thing you want to do.
In case you are really stucked to php, you will need an HttpRequest, call the site, parse all links and resources, download the resources, follow the links and do the same again. This is the most simple solution, without any checking for conflicting resources or other stuff which could go wrong.
Sitesucker http://sitesucker.us is an excellent tool you can run from any mac. It works very well, I use it all the time.
But don't forget that by creating a static copy of your site, you will lose your templating functionality. So if you really want to make your website static, I strongly recommend to - at least - put the identical parts of each page into php-includes. Mostly head, page header, footer, navigation. So you're ready for future changes.
If it's just because your TYPO3 is too slow, look at the nc_staticfilecache extension which can speed it up very well.
Using TYPO3 where you need just a simple HTML is a huge overflow, invest in DreamWeaver and code all things 'manually'.
Related
I previously had someone build a website for me. It was 90% finished but then ill health got in the way.
I have all the files and I am now asking people to "put the website back together for me". The general consensus is that it's very messy and not clear what was done and some of the protocols are now out of date etc. And it would just be better to start from scratch. I have heard this from multiple people.
So now when I am asking a new guy to build it from scratch, he is asking me for the HTML files. I couldn't see any, so I contacted the previous developer and he said:
There are no HTML files, it all runs through the index.php file and
extracts pages, data etc. from the database.
I told this to the new developer, but he is saying:
But website is not possible without HTML. Ask him provide index HTML.
Pure HTML without php code.
I'm confused, because I saw the website up and running, so it seems it is possible without HTML?
I'm trying to figure out where the misunderstanding is happening.
Thanks.
What your previous developer is saying is that your site was dynamic and all requests were flowing through your index.php file, which in turn does some backend logic to produce HTML data for the browser to interpret. If you ask your previous developer to zip up the root of your old site, your new developer should be able to take it from there.
Can a website exist without HTML?
Without a .html file? Yes. Using only .php, .css and .js is possible.
Without using Hyper Text Mark-up Language? No. There ar no other mark-up language for browsers, afaik. So we're stuck with this.
Old dev used PHP for efficiency. Contents are in your database and fetched using php to show up in browser.
New dev probably only knows HTML and has no clue about php. Or, probably doesn't want to bother reading through the php codes to reverse engineer how your site works.
Suggestion: Get a different dev. A smarter one. You probably have to pay more, but it's more expensive to hire a less smarter dev.
I want my PHP single-page application to be friendly both to search engines and no-js browsers, so following this Addy Osmani's article, I think I should write a php version of my index.html page that can respond to url parameters.
To the best of my knowledge, my index.php should be something like a tweaked version of the resulting dist/index.html after building with Grunt, to which I would add my php code. However, I find this to be not a very DRY approach, since it would involve manually editing my index.php (or whatever other filename I choose for it) every time I make changes to index.html.
I am sure there must be some other way, maybe obvious, to handle this in a Grunt/Yeoman workflow but I just can't figure out now and I would appreciate any tips.
I usually design the website as if it was a multi-page website,
and later on I use ajax-loading to convert it to be a single-page.
The ajaxify JQuery plugin is a good way to do it fast:
http://www.swook.net/p/jquery-ajaxify-plugin.html
Advantages: SEO won't be harmed, Search engines will follow the links.
I am doing some freelance work for a client and I need to re-code an old menu. The entire site is static which will make this process extremely slow and redundant, does anyone have a good technique for updating multiple pages automatically?
The old developer used "Allwebmenus" which is a automatic menu creation tool. It is implemented by using JavaScript which writes HTML to the DOM. I'm going to replace this with a clean html menu and some simple jQuery.
Right now I think the best way is to create a separate .html file with the menu code, and use PHP includes on all the pages but this still requires me to update every page on the site. Can anyone give me better idea? Or do you think this is the best option?
Thanks for the help!
create menu.php and include("menu.php") into each file where the old menu's are written.
It will make your life easier going forward too.
As far as fixing all the static pages, you will have to go in and do that yourself.
include("menu.html");
You can use includes, but it might also make since to put them onto a CMS like Drupal. Handles a lot of that for you.
Using the PHP includes is a good method. If the "Allwebmenus" has Javascript code on each page, you'll have to edit each file anyways, so adding the includes is no big deal.
I have a website that I've developed, which includes hand-written php, html, css, and js. I also created the MySQL database.
I've recently brought someone on who is going to make the website look better, but his experience is limitted to working with Wordpress. I'm wondering if it makes sense for him to the the front-end "skin" work with Wordpress and for me to edit the files as needed so they submit data to my php files and connect to my database. If the php generated by Wordpress is reasonable, this seems doable in theory.
The other way would be to take the html genrated by his php and use that as my starting point for hooking into my php processing files and database.
He sent me a dump of the files created after he created a simple webpage and there seemed to be a lot of extra stuff in there.
Can anyone with experience in this comment? I'm hoping there's an easy way to do this.
Thanks.
The default procedure for me that always worked well:
You provide outlines/simple sketchups/your old layout, so the "designer" knows vaguely how you want it to be
You define what the site should do ("there should be a button to...", "there should be a list of..., when you click on it..."). So he knows what happens and what site follows another. That's important! He must understand the site.
The better you do the above, the better the results you get from the designer will be
The designer generates layouts in pure HTML with CSS: Example sites with example data, where everything you said before is integrated.
You cut up the HTML-code and integrate it yourself in your php-code
This procedure has also the benefit, that an external designer does not get in contact with your application's internal php-code (and cannot "steal" it). And you can dry up your internal code when you integrate the HTML you get.
I have a client who wants me to do CSS coding only, but doesn't want to give me the php files.
Right now, I just have access to the live website (with no CSS).
It is entirely made with tables and I want to use divs instead
I'm not sure if it is possible to do the coding
I thought about copying and pasting the generated HTML code from each page
Will this cause possible problems with the end result?
Yes, this will cause huge problems: you'll do an awesome job, client will have trouble integrating it with their site, client will abandon your awesome work.
IMO, you should let the client know that you'll do the best you can with what they have given you, but you would be able to save them a lot of work and do a better job if you could have access to the source code.
If you know that you can't make the client happy with what they have given you, though, it would be doing everyone a disservice for you to try.
If you absolutely can't convince them to give you access to the source, then this client sounds stupid:
He has a layout which is table based.
He wants you to magically make it look better with CSS, without having access to the source.
"#Phoenix I don't see any classes or IDs." - there are no classes or ids to hook into.
You might be able to do it if you used some CSS3 selectors to, for example, select the 3rd td inside a td inside the 2nd table to apply styles to ;)
But, that won't help if you have to support older browsers, which makes this impossible at the moment without doing something differently.
I don't have full knowledge of your situation, but here's what I would probably do (if I couldn't convince them to give me access to the source):
Open the live site.
Copy the HTML source code.
Paste it into a new local file.
Add this into the <head> section: <base href="http://the-clients-site.com/" />.
This will let all the assets on the page load from the client's actual site.
Now, you have something to work with.
You have to keep track of ALL changes you make to the file.
The first change should be adding your own blank style tag.
Then, you can add id and class to whichever elements you feel need it.
You should try to avoid moving around elements, unless it's absolutely required. Those changes are a whole lot harder to explain to someone. I know from experience.
You should be able to style the page properly now.
Then, you deliver the completed page, and the documented list of changes you had to make to the HTML (add id, here add class there).
The client should then be able to integrate the changes into his site.
Well, at a bare minimum they'll need to modify ther PHP to reference your CSS. More importantly, you need to be able to hook your CS up to elements - Do tables/rows/etc. have Ids or classes attached?
If they are clever and have some good separation between code and presentation (using a templating engine or similar) then you can probably just edit the template / css.
If they won't let you edit the PHP and you come up with a new awesome layout, they will have a nightmare job trying to integrate it and probably won't bother.
I don't see the problem. You can style tables just as easily as divs. You don't have to know how the wall is built to know how to paint it, which is pretty much all you've been hired to do. Only problem I could see would be if they haven't added any classes or ids to the elements yet. After all, what the browser/client sees is the only thing that needs styling, and since you can see everything that the browser sees, you can see everything that needs styling.
If they have added classes/ids, then just take a copy of a page and style it in a testing area, and then once it looks nice, you take a copy of another page and make sure it looks nice with it too, add to the CSS if there are any new unstyled elements that didn't exist on the first page, once it looks nice, then move on to another page, and another repeating the process until you are satisfied that it appears that every page within reason would look nice with it.
If they haven't added classes/ids, tell them they need to in some capacity before you can work on it, perhaps provide some guidance on the issue.
I'm actually doing this right now for SO.
I'm working on a userscript that provides an alternate "clean" stylesheet for the StackExchange network. I have no access to the SO engine. I am using the Chrome Inspector to look at how the elements are set up. I recommend the same. (Although it is a little different, since I'm modifying the original CSS file.)
You can easily identify what you want to style with the Inspector and then work from there. I would suggest that you ask your client for a list of classes and IDs though. (I got that in the form of an existing stylesheet, you can go about it in a different way, if that suits you and your client.)