Jump to content

cb2004

Members
  • Posts

    578
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by cb2004

  1. Ok, so its because I wish to show an error before the include call in main. Researching ways to do that now.
  2. Cheers for your reply Yes I have just discovered its not possible with PHP, I kind of knew it was but was curious. My current setup is: basic-page +includes views/page +includes main How would I pass something from views/page to main?
  3. I am having some trouble passing variables using a new template technique I am trying. _main.php contains my main template with the line <?php echo $content; ?> I then have a template, lets say basic-page.php which contains: <?php $content = wireRenderFile("views/page"); include("./_main.php"); Within views/page.php I have a variable $JS. Why is that not appearing in my _main.php file? If I put the variable in basic-page.php it appears ok.
  4. <?php foreach ($page->nextAll() as $solution) { echo '<a href="{$solution->url}">{$solution->title}</a>'; } ?> Completely untested but whirl that.
  5. After using both I would comment that Wordpress (core) combined with Advanced Custom Fields (module) is just like Processwire (core), but Processwire is by far the better system. Come and join us over at Processwire, you wont be sorry. With a super friendly and helpful community, on top of a feature rich content management framework, you can build what you like. There is no need for a calendar module in my eyes, you can create a calendar and hook it up with Processwire pages with ease. Ecommerce there are some modules floating about, but this completely depends on what you need. If a full ecommerce system is required it is best left to that type of system, simple systems can be done with Padloper. *I have only been using Processwire for around a month full time on one site, and I wish I found it years ago.
  6. Will look into this when I get a moment. Sure was acting like a bug to me when I tried a load of different ways so I will report back when i can.
  7. Thanks kixe, I will give it a try at some point and feedback.
  8. Ok, I am having to store the results in PW as a text input for now as all the methods I can think of in the short time of using PW have not worked. Hopefully Ryan will expand on the documentation a little more in the future or pop in here at some point. Still cracking on with PW and loving it.
  9. My field is called form_type and as said has the options 1=Yes, 2=No. Tried so many routes now but no joy.
  10. Well I am adding a page like this: $page = new Page(); $page->addStatus(Page::statusHidden); $page->name = time(); $page->parent = $pages->get("1015"); $page->template = 'contact'; $page->title = $form[contact_name]; $page->form_date = time(); $page->form_text_1 = $form[business_name]; $page->form_textarea_1 = $form[address]; $page->form_text_2 = $form[tel]; $page->form_email = $form[email]; $page->form_url = $form[website]; $page->save(); Now I would also like to set the radio option selected from my form into PW, but I am not sure what format it is to set the options. https://processwire.com/api/modules/select-options-fieldtype/
  11. I have created a field using the relatively new field type 'Options'. I created my options which are Yes and No. These were then assigned: 1=Yes 2=No It doesn't appear to be well documented yet, but how would I update this field type using the api? I have tried numerous routes with no joy yet. I am going to keep trying and post here if I crack it.
  12. Nice module and works well. Would be nice if I could set email headers, so I could set the From: on my email to always be an email address on my domain, and then a Reply-To: would be the person filling in the form. That way I can setup DKIM and SPF on my domain. I am thinking this may be a restriction of WireMail itself though?
  13. This is already available within the RTE, I think the same functionality should be brought through to the Image field (note: I am not asking for a media manager )
  14. Had some time to look at the module and it looks like links were not in the original plan. Would require some editing of the module to allow links, especially as entities are converted. Will look at this when i have some time.
  15. No links for me either in Tweets. I will post the issue to Git.
  16. Sounds like the perfect solution to me, and after implementing it I flew through all the stuff I wanted to do. Cheers diogo, really appreciate the help.
  17. Cheers Diogo, I will give it a try. Straight in the foreach? Would that interrogate the database every time it finds an entry in the XML and would that be ok?
  18. 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.
  19. 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.
  20. 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.
  21. 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?
  22. Its ok, I found it in the templates section, nice.
  23. Could I create content_1 where the label could be Content Left on one template and Content Top on another?
  24. 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.
  25. 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.
×
×
  • Create New...