MODx Community Forums
The MODx Blog
Donations
Feedburner Feeds
Documentation
Bugs & Requests
The Wiki
download MODx
plugins, modules, snippets
online demo
Nov 20, 2008, 07:06 PM
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
Search via SMF
or Google:
modx forums
all of modxcms.com
web
MODxCMS.com
Forums
Help
Login
Register
News
:Read
Frequently Asked Questions (FAQ)
MODx Community Forums
»
Development & Coding
»
In Development
(Moderators:
zi
,
PaulGregory
)
»
CODE: How to Make MODx Pages from an HTML List
Pages: [
1
]
Go Down
« Previous topic
Next topic »
Print
Author
Topic: CODE: How to Make MODx Pages from an HTML List (Read 2063 times)
0 Members and 1 Guest are viewing this topic.
devtrench
Jr. Member
Posts: 49
CODE: How to Make MODx Pages from an HTML List
«
on:
Nov 14, 2007, 02:37 PM »
I wrote this code last night that will take an unordered list of page titles and insert pages into the database. I used this code to add 650+ pages to a site from a list my client gave me in Microsoft Word. I get these all the time so I thought it would be cool to go straight from a list to MODx pages. Until this time I used the SuperPage Module, but this is faster. This is the development forum so I'll just let you read the down and dirty code (attached), but feel free to ask questions. This would be really easy to turn into a module, so I might do that at some point.
To use, run this script from your local or remote web server and point your favorite web browser at it. Enter your list into the text area and click submit (your list probably needs to be xhtml valid in order for it to work right). There are a few vars in the script that you can adjust, so take a peek there.
I'm interested to know what others think of this, and if anyone else has some cool helper scripts like this...
James
page-inserter.zip
(1.69 KB - downloaded 127 times.)
«
Last Edit: Nov 16, 2007, 12:11 PM by devtrench
»
Logged
DEVTRENCH: web development blog
::
EHLY DESIGN
dev_cw
Testers
Posts: 2,693
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #1 on:
Nov 14, 2007, 03:04 PM »
This sounds cool, can be a real time saver. I will use it for setting up the structure for my next project. Thanks.
Sorry, I don't have any cool tools to share yet.
Logged
Shane Sponagle
|
Snippet Call Anatomy
|
Document Specific Variables
Something is happening here, but you don't know what it is.
Do you, Mr. Jones? - [bob dylan]
devtrench
Jr. Member
Posts: 49
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #2 on:
Nov 14, 2007, 03:19 PM »
Quote from: dev_cw on Nov 14, 2007, 03:04 PM
This sounds cool, can be a real time saver. I will use it for setting up the structure for my next project. Thanks.
Sorry, I don't have any cool tools to share yet.
Great, I hope it works for you.
Logged
DEVTRENCH: web development blog
::
EHLY DESIGN
chinesedream
Sr. Member
Posts: 283
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #3 on:
Nov 15, 2007, 02:33 AM »
Can you save a zip file? I can't open the 'gz'.
Thanks!
Logged
sottwell
Documentation Team
Posts: 8,170
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #4 on:
Nov 15, 2007, 03:22 AM »
http://www.7-zip.org/
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
chinesedream
Sr. Member
Posts: 283
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #5 on:
Nov 15, 2007, 03:34 AM »
Quote from: sottwell on Nov 15, 2007, 03:22 AM
http://www.7-zip.org/
Thanks, but I think it's for PC only. I am on Mac, have the default BOMArchiveHelper and Stuffit Expander Intel Mac version (this one kept crashing though). Actually Stuffit Expander can open 'gz', but I have encountered quite many gz files from Modx are other CMS, JS library sites are corrupted . I think the problem is not to do with my Expander but the file that was created or during the upload to server(s) got corrupted.
Logged
sottwell
Documentation Team
Posts: 8,170
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #6 on:
Nov 15, 2007, 04:31 AM »
Ah. I have an older (well, almost 2 years old) G4 iBook, and the latest update to Stuffit (12, I believe) works just fine. Earlier it was crashing rather frequently on archives from MODx. So I used this
http://leifh.up.md/apps/ez7z.html
Logged
sottwell.com has moved to a lovely Solaris 10 server!
Log in
username guest, password guestuser.
Templates are now becoming available at
http://sottwell.com/templates.html
devtrench
Jr. Member
Posts: 49
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #7 on:
Nov 15, 2007, 12:07 PM »
Quote from: chinesedream on Nov 15, 2007, 02:33 AM
Can you save a zip file? I can't open the 'gz'.
Thanks!
Zip file added in case you are still having issues. If you're on OS X, can't you just use the command line though?
Anyway, it's been added to the original post.
James
Logged
DEVTRENCH: web development blog
::
EHLY DESIGN
chinesedream
Sr. Member
Posts: 283
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #8 on:
Nov 15, 2007, 02:57 PM »
Quote from: devtrench on Nov 15, 2007, 12:07 PM
Zip file added in case you are still having issues. If you're on OS X, can't you just use the command line though?
Anyway, it's been added to the original post.
James
Many thanks! James.
I don't know how to use command line to to un-gz. Terminials isnt' a place I dare to wander :
Alwalys afraid to screw up my files (that I am quite capable of messing things up)
Logged
chinesedream
Sr. Member
Posts: 283
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #9 on:
Nov 15, 2007, 03:16 PM »
Quote from: sottwell on Nov 15, 2007, 04:31 AM
http://leifh.up.md/apps/ez7z.html
Thanks for the link. I will try it now.
I installed the Expander about 10 months ago. Maybe it has a new version I didn't know, will check it out too.
Logged
ChuckTrukk
Committed to MODx
Posts: 632
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #10 on:
Nov 16, 2007, 09:57 AM »
i use Unarchiver on osx. its small, free, and quick. And i havent found a filetype it doesnt open.
Logged
Chuck the Trukk
ProWebscape.com :: Nashville-WebDesign.com
- - - - - - - -
What are TV's? Here's some info below.
http://modxcms.com/forums/index.php/topic,21081.msg159009.html#msg1590091
http://modxcms.com/forums/index.php/topic,14957.msg97008.html#msg97008
sirlancelot
Coding Team
Posts: 572
Eats PHP for breakfast.
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #11 on:
Nov 16, 2007, 11:23 AM »
Something might be wrong with the gzipped file, I can't unzip it either.... "Unexpected end of file"
Logged
Matthew Pietz
::
ImThere Profile
::
Ubuntu User
devtrench
Jr. Member
Posts: 49
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #12 on:
Nov 16, 2007, 12:13 PM »
Quote from: sirlancelot on Nov 16, 2007, 11:23 AM
Something might be wrong with the gzipped file, I can't unzip it either.... "Unexpected end of file"
I could decompress the gzip file with 7zip, but not from the command line. So it does look like it was corrupt or 7zip just broke it. Anyway, I removed that one and left the zip file. I hope everyone can open the zip file
Logged
DEVTRENCH: web development blog
::
EHLY DESIGN
sirlancelot
Coding Team
Posts: 572
Eats PHP for breakfast.
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #13 on:
Nov 16, 2007, 05:05 PM »
Quote from: devtrench on Nov 16, 2007, 12:13 PM
I could decompress the gzip file with 7zip, but not from the command line. So it does look like it was corrupt or 7zip just broke it. Anyway, I removed that one and left the zip file. I hope everyone can open the zip file
$ gzip -9 page-inserter.php
No need for 7zip
Terminal > GUI
Logged
Matthew Pietz
::
ImThere Profile
::
Ubuntu User
ccheney
Jr. Member
Posts: 38
Re: CODE: How to Make MODx Pages from an HTML List
«
Reply #14 on:
Nov 20, 2007, 10:22 PM »
awww man where were you a month ago when I did this manually! I did indeed have a unordered list created for a presentation. I really could of used this. This will still come in very handy as projects come in that would require so many pages being added. Thanks a lot! Kudos!
Logged
MODx Development
Pages: [
1
]
Go Up
Print
« Previous topic
Next topic »
Jump to:
Please select a destination:
-----------------------------
Announcements
-----------------------------
=> Important News
=> Security Notices
-----------------------------
Commercial Support
-----------------------------
=> [CS] About Commercial Support
-----------------------------
Development & Coding
-----------------------------
=> Commercial Inquiries & Bounties
=> Core Code
===> MODx Next
===> xPDO
=> Module, Plugin & Snippet Creation and Modification
=> In Development
=> Templates
=> Internationalization
===> Bulgarian
===> Chinese
===> Czech
===> Dutch
===> French
===> German
===> Irish
===> Italian
===> Japanese
===> Polish
===> Portuguese
===> Russian
===> Slovak
===> Spanish
===> Swedish
===> Persian - فارسي
-----------------------------
Support
-----------------------------
=> Release Support
===> 0.9.6.2
===> 0.9.6.1
===> 0.9.6
===> 0.9.5 and earlier
=> General Support
===> MODx 101
===> E-Commerce, E-Marketing, Analytics & SEO
===> Hosting Experiences
===> IIS / Windows Hosting Issues
=> Documentation, Tips & Tricks
===> Documentation Suggestions & Corrections
-----------------------------
Add-ons, Extensions & Elements
-----------------------------
=> Module, Plugin & Snippet Usage
=> General Repository Items Support
=> Navigation & Tagging/Taxonomy
===> Wayfinder & DropMenu
=> Creating & Repurposing Content
===> Ditto
===> Jot
===> QuickEdit
=> Users, Authentication & Personalization
===> WebloginPE
===> WebLogin, WebSignup and WebChangePwd
=> Rich Text Editors & File Browser
===> TinyMCE
===> FCKeditor
===> MCPuck File Browser
=> Forms, Form Processing & Anti-Spam
===> eForm
=> Search
===> AjaxSearch
=> E-business
=> Polls, Calendars, Address Book and Community
=> Third-party integrations
=> Images, Videos & Podcasts
===> MaxiGallery
=> Manager, Parser & the Core
===> Backup & Versioning
===> Doc Finder
===> ManagerManager
===> PHx
=> Templates
-----------------------------
General Discussions
-----------------------------
=> General MODx Discussions
=> Web Design and Development
=> Wishlist
=> You and Your Sites
=> modxcms.com Discussions and Suggestions
=> Off-topic
-----------------------------
Czech Community
-----------------------------
=> Oznámení
===> Důležitá oznámení/novinky
===> Bezpečnost
=> Podpora
===> FAQ (často kladené otázky)
===> Instalace
===> Moduly, pluginy, "snippets & code" (šablony zdrojových kódů)
===> Design & Šablony
=> Dokumentace, tutoriály (návody) a překlady
===> Dokumentace
===> Tutoriály (návody)
===> Překlady (lokalizace)
=> Komunita
===> Oznámení
===> Představte se, prosím
===> Ukázky práce
===> Různé aneb cokoli co se jinam nehodí
-----------------------------
Bulgarian Community
-----------------------------
=> Поддръжка
===> Често задавани въпроси
===> Инсталация
===> Модули, Плъгини, Снипети и код
===> Дизайн и Шаблони
=> Документация, Ръководства и Превод
===> Документация
===> Ръководства
===> Превод
=> Общество
===> Съобщения
===> Представете се
===> Представете сайта си
===> Дискусии извън MODx
-----------------------------
Dutch Community
-----------------------------
=> Ondersteuning
===> Veel gestelde vragen
===> Modules, Plugins, Snippets & Code
===> Design & Templates
=> Documentatie, Tutorials en Vertalingen
===> Documentatie
===> Tutorials
===> Vertalingen
=> Community
===> Aankondigingen
===> Stel jezelf voor
===> Site Showcase
===> De stamkroeg
-----------------------------
Finnish Community
-----------------------------
=> Tuki
===> UKK
===> Asennus
===> Moduulit, liitännäiset, koodinpätkät
===> Ulkoasu/Sivustopohjat
=> Dokumentaatio, oppaat ja käännökset
===> Dokumentaatio
===> Käännökset
===> Oppaat
=> Yhteisö
===> Tiedotteet
===> Esittele itsesi
===> MODx sivustosi
===> Kahvihuone
-----------------------------
Filipino Community
-----------------------------
=> Suporta
===> Kadalasang tanong
===> Instalasyon
===> Moduler, Maidadagdag, Karagdagang mga Code
===> Desenyo at Templates
=> Dokumentasyon, Mga Turo, Mga Salin
===> Dokumentasyon
===> Mga Turo
===> Mga Salin
=> Kumunidad
===> Anunsyo
===> Ipakilala ang sarili
===> Ang Galing ng pinoy
===> Tsismisan atbp
-----------------------------
French Community
-----------------------------
=> Support
===> FAQ
===> Installation
===> Module, plugin, snippets
===> Design/Templates
=> Documentation, Tutoriels et Traductions
===> Documentation
===> Traduction
===> Tutoriels
=> Communauté
===> Annonces
===> Présentez vous
===> Vos sites
===> Le Bistrot Français
-----------------------------
German Community
-----------------------------
=> Support (de)
===> FAQ (de)
===> Installation (de)
===> Module, Plugins, Snippets & Code (de)
===> Design & Templates (de)
=> Dokumentation, Tutorials und Übersetzung
===> Dokumentation
===> Tutorials (de)
===> Übersetzung
=> Community (de)
===> Ankündigungen
===> Stellt Euch vor
===> Beispielseiten
===> Off Topic / Verschiedenes
-----------------------------
Irish Community
-----------------------------
=> Tacaíocht
===> CC Ceisteanna Coitianta
===> Breiseáin (cláir bhreise), Snippets & Comhaid
===> Suiteáil
===> Dearadh & Teimpléid
=> Doiciméid, Teagascóireacht agus Aistriúchán
===> Doiciméadú
===> Teagascóireacht
===> Aistriúchán
=> Pobal
===> Fógraí
===> Cuir Tú Féin in Aithne
===> Gailearaí an Láithreáin
===> Caifé / An Tábhairne / Ábhar Cainte Eile / Ilghnéitheach
-----------------------------
Italian Community
-----------------------------
=> Supporto
===> FAQ
===> Installazione
===> Moduli, Plugin, Snippet e altro codice
===> Web Design e Template
=> Documentazione, Tutorial e Traduzione
===> Documentazione
===> Tutorial
===> Traduzione
=> Comunità
===> Annunci
===> Presentazioni
===> Siti in vetrina
===> Chiacchiere in libertà
-----------------------------
Japanese Community
-----------------------------
=> サポート
===> 良くある質問
===> インストール
===> モジュール・プラグイン・スニペット・本体
===> デザインやテンプレート
=> マニュアル・テュートリアル・翻訳
===> マニュアル
===> 事例集、テュートリアル
===> 日本語化
=> コミュニティ
===> お知らせ
===> MODxサイト展示場
===> 自己紹介
===> 雑談
===> 国産リソース
-----------------------------
Persian Community
-----------------------------
=> پشتيباني
===> راهنما
===> نصب
===> ماژول , پلاگین ها , کد ها و جزییات
===> طراحی و قالب ها
=> مستند سازی , آموزش ها و ترجمه ها
===> مستند سازی
===> آموزش ها
===> ترجمه ها
=> انجمن ها
===> اخبار
===> معرفی کردن خود
===> نمایش دادن سایت ها
===> بحث های عمومی و سایر موضوعات
-----------------------------
Polish Community
-----------------------------
=> Wsparcie
===> FAQ
===> Instalacja
===> Moduły, pluginy, snipety i kod
===> Wygląd i szablony
=> Dokumentacja, tutoriale i tłumaczenie
===> Dokumentacja
===> Tutoriale
===> Tłumaczenie
=> Społeczność
===> Ogłoszenia
===> Przedstaw się
===> Twój serwis WWW
===> Hyde Park
-----------------------------
Portuguese Community
-----------------------------
=> Suporte
===> FAQ - Dúvidas Frequentes
===> Instalação
===> Módulos, Plugins, Snippets e Código
===> Design e Templates
=> Documentação, Guias e Traduções
===> Documentação
===> Guias
===> Traduções
=> Comunidade
===> Anúncios
===> Apresente-se!
===> Bar da esquina (fora de tópico)
===> Portfólio de Sites
-----------------------------
Russian Community
-----------------------------
=> Поддержка
===> ЧАВО (FAQ)
===> Установка
===> Модули, плагины, сниппеты и код
===> Дизайны и шаблоны
=> Документация, Уроки, Перевод
===> Документация
===> Уроки
===> Перевод
=> Сообщество
===> Объявления
===> Представьтесь публике
===> Галерея сайтов
===> Диван
-----------------------------
Scandinavian Community
-----------------------------
=> Support
===> Frågor och svar
===> Installation
===> Moduler, plugins, snippets och kod
===> Design & sidmallar
=> Dokumentation, guider och översättningar
===> Dokumentation
===> Guider
===> Översättningar
=> Webbgemenskap
===> Meddelanden
===> Presentera dig själv
===> Visa upp dina webbsidor
===> Ordet fritt
-----------------------------
Spanish Community
-----------------------------
=> Soporte
===> FAQ
===> Instalación
===> Modulos, Plugins, Snippets & Código
===> Diseño y plantillas
=> Documentación, Tutoriales y Traducciones
===> Documentatción
===> Tutoriales
===> Traducciones
=> Comunidad
===> Anuncios
===> Presentaciones personales
===> Muestra de sitios
===> El Café
-----------------------------
TÜRKÇE (Turkish)
-----------------------------
=> Destek
===> SSS
===> Kurulum
===> Modüller, Pluginler, Snippetlar & Kodlar
===> Dizayn & Temalar
=> Belgeleme, Eğitmenler ve Çeviri
===> Belgeleme
===> Eğitmenler
===> Çeviri
=> Topluluk
===> Duyurular
===> Kendinizi Tanıtın
===> Site Vitrini
===> Konu Dışı