Jump to content

cb2004

Members
  • Posts

    590
  • Joined

  • Last visited

  • Days Won

    4

Everything posted by cb2004

  1. OK, only needed a short amount of time to get to where I am so I am really seeing the speed of Processwire development. The code below is adding pages just fine, my next step would be to check when this is run again if the page is already in the database, then do an update, if it isn't then add. As you will see the XML file contains a Refnumber which I add to Processwire so we can match stuff up. public function ___executeImport() { Wire::setFuel('processHeadline', 'Complete'); $out = '<h2>Properties import</h2>'; $xml = wire('config')->paths->templates.DIRECTORY_SEPARATOR.'uploads'.DIRECTORY_SEPARATOR.'properties.xml'; if(file_exists($xml)) { $this->message("The XML file has been found"); $xml = simplexml_load_file($xml); foreach($xml->Properties->Property as $property) { $page = new Page(); $page->template = 'basic-page'; $page->parent = $this->pages->get(1017); $page->name = $property->Number . $property->Street . $property->Address3; $page->title = $property->Number. ' ' .$property->Street. ', ' .$property->Address3; $page->property_ref = intval($property->Refnumber); $page->save(); } } else { $this->error("The XML file cannot be found"); } } I am guessing I need to make a start by getting the pages: $properties = wire('pages')->get(1017)->children()->find("template=basic-page"); And then checking the property_ref field. Any guidance of the best way of doing this would be great.
  2. Well I have got it checking for the XML file in a sub folder of my templates folder, if it finds it you can execute the module and basically all it is going to do is read the XML file and play with the API to add pages. Just wondering how to check for changes between the XML file and what is in the database. Hopefully after I have stopped typing this I will check and the XML file will have a modified date.
  3. Yes, my thinking was to make them pages, purely from an SEO point of view so that we can edit the titles and descriptions. The rest of the data may not even need to be changed, but that can be locked down when setting up the fields (I have seen these options before I think). Now regarding running this thing, I have looked at the ProcessHello module and I can run a function from that after it sets up a page. Is that the best way? Seems too easy so far.
  4. Just got into Processwire and I am loving it so far, I am ready to start doing some more funky stuff now I have a basic understanding of it. At present I have a site where the client uploads XML files and image files to a directory they have FTP control over. Within their current CMS there is a link in admin to a PHP file which processes the XML files and puts data into a custom table outside of the CMS tables (therefore certain things cannot be controlled properly/well) so are not visible in admin. I have dived into the API and pretty sure this should be possible, and maybe even pretty easy, but where should I start? Creating a parent with a template, and then a template for the children with all the correct fields that I need?
  5. Its ok, I found it in the templates section, nice.
  6. Could I create content_1 where the label could be Content Left on one template and Content Top on another?
  7. You never know what a client expects, and its a change from what I am used to is all. I personally don't think they should appear in an imagefield as well. You can add/delete/edit images directly in the field which then breaks functionality in the RTE.
  8. Yeah that's the way its going to have to be done currently. It just adds another layer that you would have to explain to the editor, make sure you upload images used in the RTE to x and upload images you don't want to add to the RTE content area to y.
  9. Well I think a new visibility setting will keep things organised, which is what I like. Field 'RTE Images' with 'Display in Select Image plugin only' would hold any images for the RTE, field 'Page Images' with 'Always open' could handle the images outside of the RTE area.
  10. I think this is where I am getting confused. I played with the visibility settings thinking, add an image field then the page has an image field, just hide it so it doesn't appear on the backend. Unfortunately when you click upload image in the RTE, because this is set to not display, it doesn't display here. I am thinking a new visibility setting could be introduced to image fields along the lines of 'Display in Select Image plugin only'.
  11. So, I am looking into Processwire for a new site and I am using the dev branch. I really like it so far and can see great possibilities. What I am finding confusing is that to add images to the RTE you have to have an image field on the page. When an image is added to the RTE this image is added to the image field, if images are in the image field then these are available in the RTE. Now, surely this leaves for confusion in the displaying of images in the frontend. The image would be displayed in the content (RTE) and the designated area of the image field. I am also finding it confusing that there is no media manager so to speak. If I wanted to add an image that is already in the system I would have to find the page first where it was added? This could get quite clicky. Liking what I see so far, just wondering how people would attack these issues? I appreciate the image stuff in the RTE has only been added recently so there may be plans for improvement in the dev branch.
×
×
  • Create New...