Jump to content

formmailer

Members
  • Posts

    319
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by formmailer

  1. Hi, I need a selector to find pages that are using the template "poi" and that are having a page reference to a page with the title "Zoo". The page reference field is called poi_type. How would I do this? I tried this: $poi = $pages->find(template=poi, poi_type.title='Zoo'); But it doesnt work because there is no field poi_type.title. /Jasper
  2. Thanks for explaining about the page object. Unfortunately it isn't working yet: $page->ref_page->title; doesn't return a value.
  3. Hi, I must be missing something very basic here. I have the following code: $ref_page_id = $page->ref_page; $ref_page_title = $pages->get($ref_page_id)->title; But for some (probably a very good one) reason it doesn't work. In text: On the current page I have a Page reference fied called ref_page. When I echo $ref_page_id after the first line, it contains the page id of the reference page. So far so good. But the second line doesn't produce the correct result. $ref_page_title says Home. It works when I write the page id manually, like: $ref_page_title = $pages->get(1243)->title; What am I missing? /Jasper Edit: it does work when I add a second page to the page reference field.
  4. Hi Mike, Welcome to the forums. What are you trying to include and in what script are you trying to include it? Can you give a code example? /Jasper
  5. Hi! I'd like to make it a little bit easier to add custom stylesheets and scripts that are only required for specific templates. All my template call main.php, which contains 99% of the markup. In my main.php I added the following code: <? /*Load required scripts and style sheets*/ $config->scripts->prepend("https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"); $config->scripts->add($config->urls->templates . "scripts/all-js-min.js"); $config->styles->prepend($config->urls->templates . "styles/main-min.css"); $config->styles->add($config->urls->templates . "styles/jquery.fancybox-min.css"); ?> <? foreach($config->scripts->unique() as $file) echo "\n\t<script type='text/javascript' src='$file'></script>"; foreach($config->styles->unique() as $file) echo "\n\t<link type='text/css' href='$file' rel='stylesheet' />"; ?> Everything is working, but for some reason the ProcessRedirects.css of Apeisa's great ProcessRedirects module gets also loaded. This isn't a big issue, but I don't understand why this one is listed, while CSS files of other modules are not. Can someone explain this? /Jasper
  6. Thanks Ryan, this was the kind of answer I was hoping for. For some reason I started reading about FusionTables to store locations but that did seem way to complicated. Now off to the building part.... /Jasper
  7. This module could be useful on my website about Sweden. What I actually want is the following: A zoomable Sweden map (Google Maps) with attractions, sight-seeing tips, national parks etc. These markers should be clickable and lead to a page about this specific attraction/sight-seeing tip etc. Would this work with this module? The easy part is to add the map marker field type to the pages. But how difficult is it to show the markers on the map and make it clickable? Is there someone here that has done something similar? /Jasper
  8. That's true... haven't turned on debug mode. I'll test it for you. Update: Yes, I get the same warning when I turn on debug mode. /Jasper
  9. I am running MarkupLoadRSS on my site with PW2.2 (updated from Github about 2 weeks ago) without any problems.
  10. Enjoy your vacation, Ryan! You deserve it. 8) /Jasper
  11. Hi and welcome to the forums! Regarding your question, there are many ways to achieve things in PW, but you might like to check this topic: http://processwire.c...egate-approach/ //Jasper
  12. Already merged. Also updated README.
  13. Thanks Antti! I just merged the request. Good idea to check for the dates when saving. This eliminates the need of the 2 foreach loops. These were there to ensure that pages without a published until date would be published. But it's better to require a date. If the page needs to be there forever you someone can use a date in 2062 or something like that. I like the configurable part for the cron interval. Thanks for adding this. /Jasper
  14. Hi Tina, Your steps cover most of the process. A few notes: Make sure that the files/folders in the assets folder are writable Make sure to copy the the .htaccess file to the root of your website (some FTP programs hide this file by default) I prefer to delete the contents of the /site/assets/cache folder, but I am not sure if it's needed. You can do this before uploading the site, just to safe time. If you are going to use a new sql database, you can change the name and the user in the site/config.php file. For future use, for example if you want to copy the production database to your local mamp installation, make sure you add "drop tables" to your export, otherwise you will get errors about existing tables. That's all I can think of now. And if something should go wrong.... these forums are here to help you. 8) /Jasper
  15. Thanks Ryan, Yes, it's a site with quite some editorial content and it is supposed to grow quite a lot in the future. That's why I am so happy to have a CMS now. /Jasper
  16. I didn't read your reply carfully enough, sorry about that. Anyway, the Foundation framework website looks pretty good on a mobile phone.
  17. Seems to be a pretty good way to do it. I have a similiar plan for my site.
  18. Cool, looking forward to see these designs. Diogo and DaveP, your designs looked pretty good on a mobile!
  19. Hi all, A couple of months ago there was a discussion about having a mobile version of a PW website. I wondered if there is someone who actually made a mobile site. It would be interesting to see a site like this in the showcase forum. /Jasper
  20. Thanks Soma and Netcarver. I think everything is fine now. I used Soma's solution and added a 5 second timeout. public function getCurrency($cur) { // Create the stream context $context = stream_context_create(array( 'http' => array('timeout' => 5 // Timeout in seconds ) )); if($file = @file_get_contents("http://www.ecb.int/stats/eurofxref/eurofxref-daily.xml",0,$context)) { $xml = simplexml_load_string($file); } if (!$xml) { } else { $xml->registerXPathNamespace("ecb", "http://www.ecb.int/vocabulary/2002-08-01/eurofxref"); $array = $xml->xpath("//ecb:Cube[@currency='".$cur."']/@rate"); $rate = (string) $array[0]['rate']; $time_array = $xml->xpath("//ecb:Cube/@time"); $time = (string) $time_array[0]['time']; return array ($time, $rate); } } And in the template I use the following: <? $tag = "{CUR=SEK}"; $cache = $modules->get("MarkupCache"); if(!$output = $cache->get("output",86400)) { $array = $modules->MarkupCurrencies->getCurrency('SEK'); if (!$array){$output=" ";} else { $rate = round(100/$array[1],2); $time = strtotime($array[0]); $output = "100 Zweedse kroon (SEK) is ongeveer $rate Euro (EUR)<br /> <span class='small-text italic'>(laatst bijgewerkt op: ". date('d-m-Y',$time) .")</span>";} $cache->save($output); } $body = str_replace($tag, $output, $body); ?> I think this is will solve the problem. But just to be at the safe site, I added an additional if-statement, so that this code only runs on the few pages that actually need it. /Jasper
  21. I noticed a problem regarding this module: when the site containing the xml file is offline when it's time to update the cache, my whole site crashes (Error Call to a member function registerXPathNamespace() on a non-object (line 66 of D:\xampp\htdocs\zwedenweb\site\modules\MarkupCurrencies.module) . And of course this happened the same day I launched the site. :'( Somehow I need to build in some kind of error handling, but I don't know how. It would be okay if the template part isn't executed when the ecb.int site is unavailable. Any suggestions on how to do this? Thanks in advance! /Jasper
  22. Thanks for the kind words. Basicly the build-in template-cache. I used markupcache at two spots: The Zweden Nieuws page is fetched with RSS and therefore it needed to be cached in another way. The page about money and currency contains a function (created with the help of some forum users here) that retreives todays exchange rate from the ECB (European Central Bank) and that one is also cached by MarkupCache. I also added some settings to Apache (cache-control and gzip compression) which should improve speed. Finally I combined as much JS and CSS as I could and everything is minimized using Yuicompressor. /Jasper
  23. formmailer

    ZwedenWeb

    Hi everyone, I just finished converting my Dutch site about Sweden from nothing (="cms-less") to Processwire: http://www.zwedenweb.com During the process, which took quite some time, I also rewrote quite some content and added a few new features. And of course a little facelift regarding the design (but not to much, since I have quite some users that are somewhat older and usually they have serious problems with technical changes (or changes in general) Feel free to post your comments! /Jasper
×
×
  • Create New...