Jump to content

adrianmak

Members
  • Posts

    533
  • Joined

  • Last visited

Everything posted by adrianmak

  1. Currently, user can select other pages with images attached, to insert on current page. This feature is good without duplicating uploading same image for different pages. However, you will come into a situation, for a large site, say a news publishing website, images are all around on different pages/content, it is likely to be, images will be re-use. With current PW, you will find that it is able to find the desired existing images from such of large site, you will come out, back to front-end and look for page by page to get an appropriate image for a new page. Or if posting a news in an urgent, users mostly just upload a new duplicated image. The above is a scenario I described. To solved this, there are two options 1. centralized all uploaded images 2. provided another UI for selecting images from other pages. A UI of display all images from all posts (probably configurable), without to select which pages (current ui)
  2. Some tips are published in the blog section too. Like this one http://processwire.com/blog/posts/making-efficient-use-of-fields-in-processwire/
  3. Documention section http://processwire.com/docs/ , of course is a must. But PW on going changes and new features are announced on it's blog section http://processwire.com/blog/ . For example, new module configuration definition are introduced in 2.5.5, which simplify the declaration of module configuration. A new , Options fieldtype are introduced in 2.5.17, which i didn;t know it before. Anyway, the blog section is a valuable documentation too.
  4. To upgrade from previous version 2.5.3, just overwrite existing files with the new files ?
  5. options fieldtype available for 2.5.17+ it is dev version, stable for production siite ?
  6. pagefield is too much for simple case. I could not find something like option field
  7. I could see "Checkbox" in field type only. This is what I said in OP, it is a single checkbox
  8. I found that, the way to create checkbox option in pw is different than Drupal I was used. In Drupal, checkbox options are defined in field settings. In PW, a checkbox field type in an option of checkbox. In order to create a field with three checkbox, admin should create three fields which are field type of checkbox. Then, how to group them into a field ? For example, to create payment method with three checkbox option, paypal, COD, paydollar
  9. From the screenshot, there are three different page content, Text block with headline, text columns and image gallery could be added. How to do something like that with this module?
  10. This is a mockup screen A template with a field, in which to add child of reference to current page, a modal box will popup to add a child page.
  11. The code of he "Advanced example with hooks - creating a bootstrap 2.3.2 multilevel navbar" is put in a template file ?
  12. A jquery countdown lib is used. Add a date field of your desired template which want to display a countdown widget. I added following code on a event template <?php // convert a php unix timestamp to a javascript datetime format $js_datetime = $page->end_date * 1000; $today = date("U"); $end_date = date('d M Y', $page->end_date); $out = ''; $out = "{$page->body}<br/>"; $out .= "Event ending date: {$end_date}<br/>"; if ($today > $page->end_date) $out .= "<h3>Event is ended.</h3>"; else { $js = ''; $js .= "<script src='{$config->urls->templates}assets/js/jquery.plugin.js'></script>\r\n"; $js .= "<script src='{$config->urls->templates}assets/js/jquery.countdown.js'></script>\r\n"; $js .= "<script>$(function(){endDay = new Date({$js_datetime});$('#Countdown-widget').countdown({until: endDay});});</script>"; $out .= "<div id='Countdown-widget' class='clearfix'></div>"; } $page->body = $out; include('./main.php'); In the main.php output file, echo the $js variable, something like <?php if ($js) echo $js; ?> Some screenshots Usage: With this minimal bare bone code, you could extend and add your functionality. For example, build a groupon like time limited group order page, an online event registration form
  13. No. As I will declare several content regions in config.php $config->region[] = 'xxxxxx'; Then, in a template field setup, there are few textarea field, each of them will associated to a list field of content regions available (data source from the above $config variable). With this setup, user could have some certain of feasibility to put different textarea on different region
  14. options hard-coded in the field settings, could I grab options from other data source for example, a variable in template $content-region[] = "content-top"; $content-region[] = "content-middle"; $content-region[] = "content-bottom";
  15. In a simple situation , I just want a gender field , which in a dropdown list box hard-coded in Male and Female options
  16. i have developed a pw's website locally under vm box - ubuntu 14.04 x64 I created a digitalocean ubuntu 14.04 droplet for demo to client php version and apache version are same as my local dev enviroment. After I moved my files to digitalocean, I got this error ? Compile Error: require(): Failed opening required '/var/www/html/site/templates/_init.php' (include_path='.:/usr/share/php:/usr/share/pear') (line 168 of /var/www/html/wire/core/TemplateFile.php) who have experience on digitalocean vps cloud ? ps i could logon to pw's backend admin and able to edit any of pages
  17. I entered img[alt, !src, width, height] in Extra Allowed Content option in ckeditor inputfield settings When I specified a width for img tag, and save the page, the width attribute was removed
  18. how to implement a multi-language website? with address in different language
  19. The gmap module is great. One suggestion, how to enable map zooming with using mouse wheel ?
  20. I have a language switcher function put in a function.php, and which is include in $config->prependTemplateFile function langbar() { $out = "<div class='langbar'>"; $currentLanguage = $user->language; foreach($languages as $language) { if(!$page->viewable($language)) continue; $user->language = $language; if($language->id == $currentLanguage->id) $active = "class='active'"; else $active = ""; $out .= "<a href='$page->url'>$language->title</a>"; } $user->language = $currentLanguage; $out .= "</div>"; return $out; } Then, in the output main.php <?php echo langbar(); ?> Nothing Outpputed except the opening and closing div I tried to echo $user->language; in the main.php and it has the value of current user language. Does it mean that, I could not have to use a function (to make the template file code more clean) to display a language switcher in template
  21. I'm sorry. I mess up with the $page api variable. I supposed to use $page for selecting a single page
  22. I have the following page structure Home +----page1 (id=1) +----page2 (id=2) +----page2.1(id=3) +----page2.2(id=4) +----page2.3(id=5) +----page3(id=6) +----page3(id=7) I used following code to get a page url $pageurl[$page->get("id=1")->id] = $page->get("id=1")->url; I could get those url from id 1, 2, 6 and 7. However, I could not get any values from sub-pages of id=2, i.e. 3, 4,5 Isn't there need to supply other paramters to get a sub-page if another page?
  23. I tried to use isset for checking, but it's not working. No more php error for image field without an image, however it returned no value even though there is an image in the field
×
×
  • Create New...