Page 1 of 1
Include html pages
Posted: Wed Nov 19, 2008 1:53 pm
by Neow
Hello,
Little problem : i have to include about 100 html pages (already existing) in the site i'm working on. I want to make a list of titles with links to the page on each title.
I tried to upload these files and use a {insert} or a {include} tags but I can't find how to show the page when clicking. And path to images are not working anyway...
I tried with php, with but $filename is never send.
Any ideas ?
Re: Include html pages
Posted: Wed Nov 19, 2008 2:32 pm
by jmcgin51
if you're linking directly to an HTML file on the webserver, your link needs to be directly to that file (i.e. ). A link like you provided will try to find a CMSMS content page called "test", which consists of content stored in the CMSMS database, inserted into a template framework also stored in the CMSMS database, and styled via one or more stylesheets that are also stored in the CMSMS database.
You could also copy/paste your HTML source code into a new CMSMS content page, and then call it via Repeat for all 100 pages.
Re: Include html pages
Posted: Wed Nov 19, 2008 2:45 pm
by Neow
In fact, I have three sections with more that 100 pages, one with 70 pages and one with 40 pages... That's why i'm searching for a funnier solution...
I know for the template, that was my idea et the beginning. I want theses pages to be include in my template.
I supposed that the "test" page with nothing else that a little php script to tell it if page=pageone, show pageone, etc... would work.
Re: Include html pages
Posted: Wed Nov 19, 2008 7:07 pm
by Pierre M.
Hello,
there is one or two threads about mass import of existing static HTML pages. The idea is a sort of loop which parses each file to get header infos (title...) and body and SQL INSERT the result in the CMSms database. Have you found those threads ? If not, search forum.cmsmadesimple.org with Google.
Pierre M.
Re: Include html pages
Posted: Wed Nov 19, 2008 9:14 pm
by nhaack
If you think about including these pages right into your CMS, I would do as Pierre M. suggested or link the files directly...
I had a code snippet laying around that loads a file according to a parameter. Simplified it's this where you call the page (from your index or whereever from):
Code: Select all
<a href="index.php?page=somepage&filename=test.html">get test.html</a>
Then, in your target page (named "somepage") that is based on an empty template which contains nothing but this call for a user defined tag:
whereas "snippet is the actual UDT which contains nothing but:
Code: Select all
@readfile("./static/".$params['what']);
With the href value described above you call the page "somepage" with the parameter "filename" with the value "test.html". That page prints the content of the file "test.html" from the sub-directory "/static/"(right below cmsms root) into your empty "page".
...
Is what you tried, the above is what you need for this. However, I do not really see the point in linking to your files like that. The only thing that would probably make sense is to create external links in the page hierarchy and enter the absolute url of our "somepage" with the parameter for each of your old static files (so that at least have it in our menu)...
But it is a lot of work to compile a list like that... spend some additional time, get freinds to help you and get that content into the CMS... you gain so many advantages (e.g. search, comments, tell-a-frriend, rating....) by doing so that it's worth the effort in my eyes. if you are willing to try, The method Pierre M suggested sounds very promising.
Doing it as jmcgin51 suggested would allow to have the content searchable without touching anything but copy paste the source. And then step-by-step you mirgrate them to real content pages based on your templates.
Best
Nils
Re: Include html pages
Posted: Thu Nov 20, 2008 7:41 am
by Neow
I tried nhaack's solution, it works but I have no images...
Maybe including in database is a better solution, but if i include all my old html pages in CMSms database, it will appears in the content menu ? I don't want to search parent in 400 pages when i want to add new page for example...
EDIT : oh, i just found why i have no images, no problem !
Re: Include html pages
Posted: Thu Nov 20, 2008 6:08 pm
by Pierre M.
Neow wrote:
it will appears in the content menu ?
Not if you uncheck "show in menu" in the page description/options.
Pierre
Re: Include html pages
Posted: Fri Nov 21, 2008 7:33 am
by Neow
Not in the site, but in the menu of the admin panel. For exemple, when you want to select the parent.
Re: Include html pages
Posted: Sat Nov 22, 2008 5:41 pm
by Pierre M.
ah ! you mean : if the site has 50+ pages the GUI becomes difficult about parent page selection ? Sure, the admin GUI needs to be more ajaxy with expand/collapse.
But for your not GUI but scripted mass import you can set the parent with SQL.
Pierre M.