Possible to create new Joomla pages by running a custom PHP script?

Discussion in 'Joomla' started by adsensenewb, Nov 23, 2010.

  1. #1
    Ok, the type of site here is a ecommerce website previous built on cold fusion, which is switching gears to be much more high volume. Each item will only be sold once (antiques, art pieces, used items, etc).

    There will be a high volume of items, relative to the amount of man-hours that are (ideally) available for updating the site (adding new pages + taking expired ones down.)

    ***

    Ideally there would be a way to simply enter the details into an HTML form, i.e.


    Filename:
    Image Location:
    Caption:
    Description:
    Price:
    etc
    etc

    ***

    Press submit, and the new page would be there, with the contents of the "Price" form being inserted into the appropriate spot in the template.

    ***

    Would there be a way to have a .../createnew.php page or something, that you can pass variables to via a form, enter your user/pass, and have it update the datebase, etc, the same way as if you created a new page manually?



    Thanks in advance for any help, and please dont hesitate to ask questions to clarify.
     
    adsensenewb, Nov 23, 2010 IP
  2. lee_day_designandrcoding

    lee_day_designandrcoding Member

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #2
    Yes you could inject the data straight into the DB using a mysql query in php.

    in the form's action file, which i'll assume is php, you take the data passed by the form, and store it in some string variables, you can then create another string and type out your html layout code inside of it, but at the relevant points place your variable data which got passed with the form.

    Then you just have to query mysql create a new entry in the correct table, bare in mind tho joomla keeps a backup table set of data so you might want to add the same page data in there too.

    If this doesn't make much sense i could supply some code probably to demonstrate for you.
     
    adsensenewb likes this.
  3. adsensenewb

    adsensenewb Peon

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    The basic concept makes sense. I understand some of the basic concepts, abstractly, although am basically a beginner when it comes to the technical understanding and implementation -- although I pick it up fairly quick... just have never gotten around to needing to really get down and learn AMP.


    What you described seems pretty simple -- would it be this simple to make a new page using the functions/pages built into Joomla? I.e. the pages created this way show up in the Joomla backend?
     
    adsensenewb, Nov 29, 2010 IP
  4. lee_day_designandrcoding

    lee_day_designandrcoding Member

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #4
    Adding custom pages to the backend of joomla shouldn't be to complex, i know if u make your own plugin/componant it's fairly straight forward to add a configuration page for that plugin, have a look on the joomla forums, i'm sure there's tons of people who have asked the same question.
     
  5. adsensenewb

    adsensenewb Peon

    Messages:
    129
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sorry, I meant -- when you make a new page in the normal way using the joomla backend, it will show up in the section/category managers, etc.

    Do you know if it would be simple, when creating a new page, using your own form page + action page, to have it be "as though" you created it "normally", i.e. assign it a category/section, etc.
     
    adsensenewb, Nov 29, 2010 IP
  6. lee_day_designandrcoding

    lee_day_designandrcoding Member

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    38
    #6
    You would have to make a plugin to mod the article page i think, joomla uses templates obviously to style itself but it also uses them for the back end too, so shouldn't be to hard to find template and modify it. I'd have to do some research to find out for sure but yeah, have a look on the joomla forums, someone will be able to give you a more accurate answer than me.

    There's also lots of documentation on joomla which is handy.