Jump to content

adrian

PW-Moderators
  • Posts

    10,902
  • Joined

  • Last visited

  • Days Won

    349

Everything posted by adrian

  1. Glad to help. Just one thing - from what you describe, it sounds like you are editing the core ProcessPageAdd module. You don't want to do this, because you'll have to make these changes again every time you upgrade PW. Instead you should create your own simple module using that code. Read here for a tutorial on creating your own module: http://wiki.processwire.com/index.php/Module_Creation
  2. Gotcha - I had seen that code of Pete's sometime ago, but had forgotten about it.
  3. Hey Marty - looks great. Only comment I have is that it would be great to have a cleaner looking version of the hotel logo. It looks like there is no antialiasing on the text. I know how hard it can be to get good quality logos from businesses sometimes though
  4. As with any custom import you will need to get your hands dirty. The array in that php export will certainly make the import possible. I would suggest setting up all the required fields and templates in PW initiallyy. Once you have that ready you'll need to write a script that loops through the $GLOBALS['immotool_objects']['01-21'] array, grabbing each piece of information and adding it to the appropriate fields in PW. I see that the array has a "de" field, so you'll want to make sure you have PW multi-language setup and configured before you start. This really is only a rough start, but hopefully it will help get things moving for you. Actually this probably isn't even a rough start - there is a lot to accomplish, and I don't really have the time right now to put together a working example. I am pretty sure none of this code will work as is, but hopefully it gives you an idea of an approach that might work for you. $p = new Page(); $p->parent = $pages->get("id of parent page"); $p->template = $templates->get("property_details"); //or whatever you want to call the template foreach($GLOBALS['immotool_objects']['01-21'] as $f => $v){ if(is_array($f){ foreach($f as $l => $v){ $p->{$l_deutsch} = $v; } } else{ $p->$f = $v; } } $p->save(); There will be a few special cases: images - you'll need to convert the name of the image from the array to a full url to the image so you can add it using the PW API. fields such as distance_to_city_centre that have additional components - ie not just the default 'value' and 'de' components. Some things you should read: http://processwire.com/api/multi-language-support/multi-language-fields/ http://processwire.com/api/fieldtypes/images/ As for regularly doing these imports, you'll need to check that the property doesn't already exist in the PW before importing - maybe a check on the title field in the array. Again, sorry this is so rough, but what you are wanting to do is definitely possible, but you'll need to take it one step at a time and ask questions here when you come across a stumbling block.
  5. Depending on your data structure, you might also consider this approach: http://processwire.com/talk/topic/5040-events-fieldtype-inputfield-how-to-make-a-table-fieldtypeinputfield/ This example module shows you how to build a custom PW fieldtype that allows you to have the power of PW API while still storing the data in a more traditional way - multiple fields per DB row. Again, the best option depends on lots of different things, but kongondo has outlined these very well already.
  6. Martijn, I completely agree - square is definitely what we should be aiming for. EDIT: Here are some experiments Ryan has been playing with: http://processwire.com/talk/topic/1920-processwire-logos-download/?p=26899
  7. Nice work Macrura, Are you building something that fulfills leoric's needs: http://processwire.com/talk/topic/5320-how-to-set-the-latest-id-as-a-new-page-name/ I am definitely keen to see the second part of your described functionality - ie creating name from various fields.
  8. The PW "logo" on the contest page makes me realize how badly PW needs an actual logo.
  9. Why not add an additional date field to the template and set that using the code Soma provided: $rss->itemDateField = 'my-special-date-field'; You could set this date of this field manually when creating the pages. Does that make sense?
  10. Hi Jonathanp and welcome to PW! I have only played with that module once so far, although I will be using it in an upcoming project fairly shortly. You should be able to build the URL yourself using the page id and image name, both from the json data? Something like this - of course you'll need to define the $page_id and $image_name variables from the json data. echo $config->urls->files . $page_id . $image_name; Hope that helps. If you haven't already seen it, take a look at the cheatsheet: http://cheatsheet.processwire.com/ That will explain the $config->urls->files. All uploads in PW are stored in this directory, with subdirectories named with the page ID.
  11. You certainly don't want to go modifying the module code. I don't actually understand why the pubdate is not being included in the feed in the first place since every PW page has a created timestamp and the module includes this as the default. Are you doing something custom with the output?
  12. This should be fairly easy to do with a simple module. These two posts should get you going: There are several different possible methods detailed in here: http://processwire.com/talk/topic/1908-automatically-generating-new-page-names/ This post is less relevant since it is for pages created with the API, but might be worth a read still: http://processwire.com/talk/topic/4571-id-based-slug-instead-of-title/
  13. Joss' Foundation 5 template: http://processwire.com/talk/topic/5293-zurb-foundation-5-profiles/
  14. If I understand what what you're looking for exactly, you will probably want to make use of GROUP_CONCAT. I think something like this should work: SELECT CONCAT_WS(' ', g.lastname, g.firstname) AS Customer, g.id_customer AS customerID, GROUP_CONCAT(CONCAT_WS(' ', ad.address1, ad.address2, 'City:', ad.postcode, ad.city, ad.other, 'Phone:', ad.phone, 'Mobile:', ad.phone_mobile)) AS Addresses, gl.name AS group_name, g.email FROM ps_customer g LEFT JOIN ps_address ad ON (g.id_customer = ad.id_customer) LEFT JOIN ps_group_lang gl ON (g.id_default_group = gl.id_group) AND gl.name LIKE 'piiri%' GROUP BY g.id_customer
  15. It sounds like the PubDate might be the issue: http://kb.mailchimp.com/article/ive-posted-new-information-to-my-rss-feed-but-no-campaigns-have-been-sent This might also be useful: http://blog.mailchimp.com/rss-to-email-tutorial/ It suggests that it can validate the feed without you needing to wait for it to send, which should help speed up your debug cycle considerably!
  16. Whenever I edit a module in the modules directory and submit the changes it instantly grabs the new version number and code from Github. Of course you could even change the version number when editing, but it shouldn't be necessary
  17. Related thread: http://processwire.com/talk/topic/4553-how-do-i-get-a-list-of-online-users/
  18. Also wondering if it would be worth cleaning up the html a bit before it gets into the feed. All those tables and spans look kinda messy
  19. The link you provided: http://www.birthfactdeathcalendar.net/bfd_processwire/rss/ doesn't seem to work, but this does: http://www.birthfactdeathcalendar.net/rss/ Probably a stupid suggestion, but are you submitting the correct one to MailChimp? I just ran a validator on your feed and it seems to be fine, so no major problems there: http://validator.w3.org/feed/check.cgi?url=www.birthfactdeathcalendar.net%2Frss%2F although maybe you could clean up the max-width issue and see if it helps. Regardless you should fix the relative urls to absolute, eg: <a href='/events/12-january-1893/'> to <a href='http://www.birthfact...2-january-1893/'> I know that FeedBurner is probably going to be another Google casualty soon, but try running your feed through it and giving MailChimp the FeedBurner link to make sure there is no issue with MailChimp accessing the feed or the format of the feed on your server. I know this has helped me in the past. Not a permanent solution, but a good debugging step.
  20. BFD Calendar - I usually just make use of the page path history and the page link abstractor modules, but if you want ID based page links, you might find this module useful: http://modules.processwire.com/modules/process-redirect-ids/ Ryan has also mentioned that he was working on something called Link Monitor - although he may not be persuing anymore. Something to read anyway if you haven't seen it: http://processwire.com/talk/topic/236-module-page-link-abstractor/?p=34398
  21. Maybe I am not fully following, but it sounds like you are assigning people to specialties. I would instead assign specialties and levels (two separate page fields) to each person. It would be trivial to generate the specialty pages with the appropriate levels this way. If this sounds like it would work for you, let me know if you need anymore details. Hope that helps.
  22. Sorry, I am talking about the config.php in your PW folder. There is a debug setting there that you can set to true.
  23. Not really sure, but does turning on debug in your config settings give you any php errors that might help?
  24. Have a read of the "Do I have to keep track of the page number?" section on this page: http://processwire.com/api/modules/markup-pager-nav/ If you decide to keep track of the page number yourself, you can change the starting position, but if you always set: start=0 then it will start at the first page each time it is called.
  25. Or you could try this module: http://modules.processwire.com/modules/process-page-field-select-creator/ You can easily paste in a CSV list using "Option 2. MULTIPLE FIELDS". Not sure if it does exactly what you need, but worth a look. Otherwise, Martijn's approach can be customized to whatever your needs are,
×
×
  • Create New...