简体   繁体   中英

Script to generate Joomla pages

I'm attempting to transfer a standard html webpage to the Joomla! CMS. I'll be using Scrapy, a Python web crawler to grab and parse the old webpage. Is there some way (preferably in Python) that I can write a script to convert 3000+ pages into Joomla's mySQL database? Keeping the old style/css is not a priority.

Bonus points for an answer that can do this while maintaining the old URLs.

I am looking for some way to do this. See my comment below for more information. A useful answer will look like "This isn't possible" or "This is possible, but you need to use X [where X is a language, tool or other helper]"

I guess my comment is an answer too.

Yes it's possible - Joomla articles are just records in the _content table. How you scrape your pages, what bits you keep, and what you INSERT INTO your content table is entirely up to you.

INSERT INTO jos_content 
(`title`, `alias`, `title_alias`, `intro_text`) VALUES
('Title', 'title', 'Title', 'Hello!' );

There will be other fields that need to be populated depending on your situation, such as category, but create an article manually using the back-end and see what the records look like.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM