Importing an Excel table
Importing an Excel table
Hi all,
I wondered, is there an easy way to place or import an Excel table in to a CMSMS page?
That's it - really simple!
Otherwise my client will have to enter his data in to an HTML table by hand - doable, but tedious!
Thanks.
I wondered, is there an easy way to place or import an Excel table in to a CMSMS page?
That's it - really simple!
Otherwise my client will have to enter his data in to an HTML table by hand - doable, but tedious!
Thanks.
Re: Importing an Excel table
Please look at this Smarty plugin.
Sorry, docs are only in german - so feel free to ask if there is a problem.
Sorry, docs are only in german - so feel free to ask if there is a problem.
Re: Importing an Excel table
Nice one, thanks.
I'll have a play and see if I can make sense of it - I can read a little (well very little) German so I might be able to sort it otherwise I'll take you up on the offer of questioning you!
All the best.
Greg.
I'll have a play and see if I can make sense of it - I can read a little (well very little) German so I might be able to sort it otherwise I'll take you up on the offer of questioning you!
All the best.
Greg.
Re: Importing an Excel table
Another way (not as good as Cyberman's)) if you have not yet thought of it : OpenOffice Calc and Gnumeric can export Excel spreadsheets to HTML (not MShtml).
PM
PM
Re: Importing an Excel table
Worth a go too if necessary.
I'm guessing, if I used this route, I paste the code either of those programs make in to the code view in page editing screen of CMSMS? That simple?
Thanks for the input - I need all the options possible so I can give the client the best alternatives to make his life easy!
Greg.
I'm guessing, if I used this route, I paste the code either of those programs make in to the code view in page editing screen of CMSMS? That simple?
Thanks for the input - I need all the options possible so I can give the client the best alternatives to make his life easy!
Greg.
Re: Importing an Excel table
I don't know. Just try :
-pasting "full wysiwyg" (from a browser window to wysiwyg editor)
-pasting code (from view source to code input)
-inserting as global content bloc ?
And may be tidy-ing before can help.
Please report your successes, I'm sure other wil be interested.
PM
-pasting "full wysiwyg" (from a browser window to wysiwyg editor)
-pasting code (from view source to code input)
-inserting as global content bloc ?
And may be tidy-ing before can help.
Please report your successes, I'm sure other wil be interested.
PM
Re: Importing an Excel table
Probably would have done that anyway - I'm a great one for experimenting first rather than asking for help!
Cheers - I'll certainly let folk know how it goes.
Greg
Cheers - I'll certainly let folk know how it goes.
Greg
Re: Importing an Excel table

In the end I set an HTML table up in Dreamweaver, pasted that in to this page http://thelaymaster.com/cms/index.php?page=results and then left the client to play. He copies the code to every new results page he needs and just types in, on a daily basis, the results.
He's happy. Which is really all that matters.
I did try a lot of different routes to get an Excel table straight in with minimal fuss but nothing worked quite well enough - ultimately the route I went down, thought sort of clunky, gives a better end result.
Thanks for asking though!
Since doing this site, and a few others, in CMSMS I've had to make one in Joomla. I can safely say CMSMS is easier and, as an added bonus, the experience I've had using it helped massively in working out how the hell to do anything in Joomla!
Best wishes to all.
Re: Importing an Excel table
I was able to import the csv and create a table based on the plugin Piratos provided above.
What I cannot figure out is how to use a 'table sort' now that I have the table created.
I would like to be able to sort the table - on the fly - when a column header is clicked on.
Javascripts are available that accomplish this but they don't work with CMSMadesimple.
Here is one example
Or if someone could make a plugin from this php code
Anyone have an idea how I might accomplish this? Any help would be greatly appreciated.
What I cannot figure out is how to use a 'table sort' now that I have the table created.
I would like to be able to sort the table - on the fly - when a column header is clicked on.
Javascripts are available that accomplish this but they don't work with CMSMadesimple.
Here is one example
Or if someone could make a plugin from this php code
Anyone have an idea how I might accomplish this? Any help would be greatly appreciated.
Greg
Re: Importing an Excel table
Cyberman I have read that but the tables are not created from a query of the database. I am creating the tables from a csv file with the csv function created by Piratos.
Greg
Importing an Excel table
I got this working:
Attached function that will import a csv file into a html table
You can use the table sort javascript (attached) from
Stuart Langridge, LINK
The information on use of the tag itself is in the help as well as the link to Stuart's page and the basics of how to set-up the sort javascipt, styles, etc.
Author is anonymous as I cannot remember where I obtained the basic code.
(remove .txt from attachments - place function.csv.php in plugins folder - place sorttable.js wherever you are placing other javascript)
[gelöscht durch Administrator]
Attached function that will import a csv file into a html table
You can use the table sort javascript (attached) from
Stuart Langridge, LINK
The information on use of the tag itself is in the help as well as the link to Stuart's page and the basics of how to set-up the sort javascipt, styles, etc.
Author is anonymous as I cannot remember where I obtained the basic code.
(remove .txt from attachments - place function.csv.php in plugins folder - place sorttable.js wherever you are placing other javascript)
[gelöscht durch Administrator]
Last edited by Greg on Sun May 13, 2007 6:47 pm, edited 1 time in total.
Greg
Re: Importing an Excel table
This works great! Thanks!
I just have one more question/request. Is there any way to get one column from the csv file to be recognized by smarty as an email, so that smarty would hex encode it?
I tried changing the csv file to have {mailto address="email@email.com" encode="hex"} for all the emails, but this isn't interpreted as smarty code using this csv to table tag. It just strips out the double quotes and prints the brackets to the screen even if they are all backslashed. Is there some way to force smarty to interpret, or is this functionality lost if the page data isn't kept in the database?
Basically, is there any way to add a step to this so that emails in a csv file can be caught and hex encoded by smarty? If there is, that would be splendiferous!
Many thanks,
am
edit... maybe there could be a column name reserved, so that if there is a column in the csv file called or containing "Email" that entire column position has
Although I guess this would not work with the javascript used to sort by column, unless there is some way to force smarty to recompile the source. I don't know. This is beyond my current abilities.
I just have one more question/request. Is there any way to get one column from the csv file to be recognized by smarty as an email, so that smarty would hex encode it?
I tried changing the csv file to have {mailto address="email@email.com" encode="hex"} for all the emails, but this isn't interpreted as smarty code using this csv to table tag. It just strips out the double quotes and prints the brackets to the screen even if they are all backslashed. Is there some way to force smarty to interpret, or is this functionality lost if the page data isn't kept in the database?
Basically, is there any way to add a step to this so that emails in a csv file can be caught and hex encoded by smarty? If there is, that would be splendiferous!
Many thanks,
am
edit... maybe there could be a column name reserved, so that if there is a column in the csv file called or containing "Email" that entire column position has
Code: Select all
{mailto address="contentsfromcsvcolumn" encode="hex"}
Last edited by moorezilla on Tue May 15, 2007 12:46 pm, edited 1 time in total.
Re: Importing an Excel table
Here is an updated function.csv.php
I added email spam protection based on Thomas Gubisch's function.email.php code.
HTML output is now:
Thanks Thomas
I added email spam protection based on Thomas Gubisch's function.email.php code.
HTML output is now:
Code: Select all
<td><__script__ language="javascript" type="text/javascript"><!--
document.write('<a href="mailto:John.Doe'+'@'+'server.com">John.Doe'+'@'+'server.com</a>');
--></__script></td>
- Attachments
-
[The extension txt has been deactivated and can no longer be displayed.]
Greg