Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/11/2013 in all areas

  1. hi there! after playing a bit with pw, i decided to choose my own new website as a first project to test it. im realy happy with it and i will use it as my number 1 choice for my own clients in the future. the first time working with an cms i've got not the feeling that i need to "fight" against it. i was realy suprised how easy it is to use ajax with pw, which i did for my references page, i'm still looking for an easy to implement url/hashbang ajax-solution - this is something i will add in the future to the site. a little blog will follow:) http://chrisvaupel.de constructive critics are welcome PS: it's a small site, but i bought procache and formbuilder, becouse i was curious and wanted to give a little bit of money support - anyway, i just like to say that booth are working realy well
    3 points
  2. A short tutorial/help package aimed at new users (Note, a more step by step version of this tutorial is now available on the Wiki as a follow on to the Basic Website Tutorial - http://wiki.processwire.com/index.php/Simple_News_System ) - BE CAREFUL - don't mix the two. Either use the wiki or my files, not both at the same time. To be honest, you will learn more using the wiki version. This is an example script showing how to create a very basic news system with categories in PW. It includes templates and functions and full instructions of how to use it, which fields to create and so on. This is NOT a module or an instant solution, but it will help get you going faster if you have not done this sort of thing before. This example is for when you have a site carefully constructed round the page hierarchy, but want to add a basic news or blog that sits at least partly outside that tree. The system helps you to create a single news page that lists articles that are stored under a hidden parent. The articles are sorted by category - categories are created under another hidden parent and are selected with a page field. Full instructions are in the main newsfunctions.inc script and everything is commented. You can find it all here: https://github.com/jsanglier/Pw-News Joss PS: This is just one way to do a news system and should be taken as an example, not as the best way.
    2 points
  3. Hi, After reading this thread, I decided to make a module that helps generating PDF files of ProcessWire pages. GitHub: https://github.com/wanze/Pages2Pdf Modules Directory: http://modules.processwire.com/modules/pages2-pdf/ This module uses the mPDF library to generate the PDF files. It has fully UTF-8 and basic HTML/CSS support for rendering the PDF files. The output is customizable with ProcessWire templates. Example I've enabled generating PDF files for the skyscraper template of ryans Skyscrapers-profile with a template that outputs the data in a table along with the body text and the images: one-atlantic-center-pdf-4177.pdf Please take a look at the README on GitHub for instructions and further information/examples. Cheers
    1 point
  4. Hi. I've decided to use ProcessWire for the site I'm currently working on. I really like it so far! My client needs a fairly standard informational site and a "blog" (really more like a news feature). So far things have come together nicely. The designer I'm working with has provided me with a lot if graphics and I'm taking care of the coding side of things. Now, each page can have a "banner", basically a photo in the top, and some pages might share this banner. Right now I'm simply using an Image field, and picking a random image from that for the banner. It works. However, I'm thinking how to best make sure the same image resource gets used in the case that two (potentially unrelated) pages share the same banner... Right now I'm simply uploading the same banner image. Could it be possible to somehow have a shared list of images, and then have a field "pointing" to a selection of these? I'm sure it can be done, but I'm not sure what the best course of action will be. I'm quite experienced as a developer, but I'm new with PW, so I guess I'm mainly looking for some fairly specific pointers Hope it makes sense, I'm sure I will have more questions in time Thanks in advance - Lindquist
    1 point
  5. I'm pretty close to having native core support for multi-language page names. It's something I wanted to add originally in 2.1, but just didn't know exactly how without adding lots of overhead. After marinating on it for a long time, an easy way to accomplish it finally became apparent. A nice thing about it is that it does it with near zero overhead. It won't be as fancy as the LanguageLocalizedURL module, but it should be good for people that have relatively simple needs. It's the one feature that we were missing that would really let the multi-language fields sing, and it should lead the way for making more fieldtypes multi-language capable. It works by enabling you to specify an alternate name for each page, for each language. When a page is accessed at its alternate URL, then the language is automatically detected and set for the request. Combined with multi-language fields or multi-language alternate fields, it provides a full multi-language solution without need for multiple trees or having to use any code to set the language. It's not the right solution for all situations, but for some situations, it'll be quite nice. Lets say you've got the page /about-us/contact/. For the "about-us" page you've set the Spanish language name to be "quienes-somos", and for the "contact" page you've set the Spanish language name to be "contacto". When the URL /quienes-somos/contacto/ is accessed, it's technically referring to the same page as /about-us/contact/, except that the user's language is automatically set to Spanish, and thus any multi-language fields output in Spanish. Calls to $page->url on any other pages also output the Spanish URLs. You don't have to define alternate labels for all pages if you don't want to. So long as there is just one of them in the URL (like in the rootParent, for example) then it'll be able to detect the language automatically. In order to avoid problems with having multiple URLs displaying the same content, it doesn't let you access the page with a URL like /about-us/contacto/ (English and Spanish mashup), because both of those pages have their names translated. So if you accessed such a URL, it would 301 redirect to the Spanish version. Here's a screenshot that might help to explain how these things are defined. This will be committed to the core within the next few days, as part of the LanguageSupport group of modules, but I'm going to leave it as an uninstalled alpha then beta module, until ProcessWire 2.4.
    1 point
  6. Just pushed an new update today to replaced the "page-edit" permission from module config and replaced it with 'modules-manager', as editors with page edit permission were able to see this module in the admin. So please update to the latest version in case you don't want you're editors to see Modules Manager. Thanks @jkenters for the issue report.
    1 point
  7. OK, it's been a while since I looked at this, and much of it was inspired or guided by Ryan. I had to boil it down a little to make it generic enough to make sense, so this exact code hasn't been tested, but it should get you started. Here's a proof of concept that works. Template for your calendar page <?php function pagesToJSON(PageArray $events) { $json = array(); foreach($events as $event) { $json[] = pageToArray($event); } return json_encode($json); } function pageToArray(Page $event) { $data = array( 'id' => $event->id, 'title' => $event->title, 'start' => date("Y-m-d H:i:s",$event->start_date), 'end' => date("Y-m-d H:i:s",$event->end_date), 'url' => "./$event->id", // event ID is the url segment ); return $data; } if($input->urlSegment1) { // event ID provided as a URL segment to this page $event = $pages->get("id=$input->urlSegment1"); include("./includes/head.inc"); echo $event->title; echo $event->body; include("./includes/footer.inc"); } else if($config->ajax && $input->get->start && $input->get->end) { // fullCalendar making an ajax request of events $start = (int) $input->get->start; $end = (int) $input->get->end; $events = $pages->get("/calendar/")->children("sort=start_date"); $events = pagesToJSON($events); echo $events; } else { //display the calendar $config->scripts->add('/site/templates/assets/js/fullcalendar.min.js'); $config->styles->add('/site/templates/assets/css/fullcalendar.css'); $config->styles->add('/site/templates/assets/css/calendar.css'); $config->scripts->add('/site/templates/assets/js/cal.js'); include("./includes/head.inc");?> <div id="calendar"></div> <? include("./includes/footer.inc"); } // end else ?> head.inc <!DOCTYPE HTML> <html> <head> <title><?=$page->title?></title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <!-- CSS includes defined via $config->styles->add --> <?php foreach($config->styles as $url) echo "<link rel='stylesheet' type='text/css' href='$url' />";?> <!-- include jQuery --> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.min.js" type="text/javascript"></script> <script>!window.jQuery && document.write(unescape('%3Cscript src="/site/templates/assets/js/jquery-1.6.3.min.js"%3E%3C/script%3E'))</script> <!--js includes defined via $config->scripts->add --> <?php foreach($config->scripts as $url) echo "<script type='text/javascript' src='$url'></script>";?> </head> <body> footer.inc </body> </html>
    1 point
  8. Hi Soma - no worries - I know how you feel Basically what I am doing is creating a custom RSS feed and latest activity widget, but I only want to highlight details from certain sections of the site. I have some user edited pages, a user edited glossary, and a forum. These are the three parent pages. I ended up going with this which is a little ugly, but does the trick: $latest = $pages->find("sort=-modified, limit=30"); $items = new PageArray; foreach($latest as $lpage){ if(($lpage->rootParent=='1130' || $lpage->rootParent=='1192' || $lpage->rootParent=='1021') && ($lpage!='1130' && $lpage!='1192' && $lpage!='1021')){ $items->add($lpage); } } I actually might end up switching to a template selector as I think this will be cleaner and still achieve what I need.
    1 point
  9. In the latest commit to the ProcessWire dev branch, the LanguageSupportPageNames module now supports setting the homepage name for any of the languages. It should work exactly like how you guys requested. For example, if you set the Spanish homepage name to be "es", then from that point forward, all URLs for Spanish are preceded by an "/es/". Likewise, if you access any path preceded by an "/es/" then the user's language is set to Spanish. If you access the homepage "/" then the default language is set. If you access the Spanish homepage at "/es/" then you get the Spanish version of the homepage. Lets say that you set your "default" language homepage name to be "en". In this case, all default language pages become preceded with "/en/", except for the homepage itself… I wanted to avoid having two URLs that render the same exact thing. Use of this homepage "name" is completely optional. You could choose to not use it for your default language, and then use it for other languages, or you could choose to not use it for any, or you could choose to use it for all. Basically, I think it'll accommodate just about anything you could want to do in that respect. Let me know if you guys get a chance to test it and if you run into any snags or other ideas.
    1 point
  10. nice topic. http://musicforprogramming.net/ "A series of mixes intended for listening while programming to aid concentration and increase productivity (also compatible with other activities)." i actually hearing no music when working, or any music i'm listening to regulary - but i need to know the songs well. new stuff woud be distracting.
    1 point
  11. Greetings chris, Thanks for sharing! I really like the vibrant feeling of your portfolio site! I'm viewing it on the iPad and it looks great -- easy and clear navigation, with bold statements that stand out but remain tactful. Terrific balance. Couple of comments (viewed on iPad): This page -- http://chrisvaupel.de/referenzen/ -- feels a bit squashed. Perhaps it needs a slightly better division between the text and graphics? This page -- http://chrisvaupel.de/leistungen/ -- has big icons that react when "touched," but don't actually do anythng. Is ths intentional? Thanks again, Matthew
    1 point
  12. Just dropping in to say that I'll definitely try this module out soon, looks very promising. Thanks for making this! For the record, I've used mPDF in the past for creating PDF versions of pages. It's HTML and CSS support seemed superior compared to other libraries at the time, at least for my use cases. Might have to switch one site to use this module instead of mPDF just to see how they really compare. Taking a look at your code I'm seeing quite a bit similarities with these libraries; for an example seem to have identical method names. Interesting.
    1 point
  13. After too many hours busy with the same site, start to feel groggy and inspiration dries up, I need to see again how relative everything is and give my head a fresh reboot:
    1 point
  14. ZipArchive does seem to be pretty widely adopted now. It wasn't when that existing ZIP code was originally written. I've been meaning to change it over to ZipArchive, but just haven't gotten around to it. It's on my to-do list.
    1 point
  15. Thanks Teppo, I will add this for sure.
    1 point
  16. With multi-language page names, the beginning "en" or "de" segment (as examples) aren't technically necessary, as the language can be determined from the page names alone. But I understand it may still be desirable, so I'll be looking for ways to handle that. But as for $page->rootParent, you'd probably want $page->parents()->eq(2) instead. Also Page::rootParent is hookable. Though I don't really want people to have to think about these things. This could be done by adding checkbox or page reference fields to check which languages you want to be included in any given children() or find() results, etc., and then making use of it in your selectors. If that became desirable as a core feature, we'd probably implement it in some way similar, behind the scenes. I will probably have to set it up to override the user's language settings when the page names module is installed.
    1 point
  17. In case you didn't know or had forgotten, in PW you can edit /site/config.php and set $config->debug = true; to help track down errors. I've often found 'soft errors' (bad practice PHP etc (something you get if you are PHP 'lite' like I am)) that were previously hidden are displayed when this is set to true. But I also found I set it and forget that it's set then sometimes see a page load slightly slowly or with a visible 'flash' and wonder what's wrong, only later remembering I have debug left on. So now as a reminder I echo (if the setting is true) a reminder somewhere obvious such as adjacent to the homepage (or every pages's) H1. It's good to be reminded since going to a production site with it set to true is NOT recommended (API doc). This is the simple test and echo I now add: if(wire('config')->debug) echo "<span class='alert'>Flashy? Slow? Probably because of \$config->debug = true;</span>";
    1 point
  18. I've seen this happen before, just didn't have the time to see what's causing it then. Now that I did, it seems pretty obvious: JS related to title field only expects keyup, which isn't triggered when you choose a value from autofill list. Making following change would fix this, though I wouldn't necessarily suggest that you make this change locally -- it would make it slightly more difficult to update ProcessWire later. Posting it here just to point out what the problem is/was. --- a/wire/modules/Inputfield/InputfieldPageTitle/InputfieldPageTitle.js +++ b/wire/modules/Inputfield/InputfieldPageTitle/InputfieldPageTitle.js @@ -25,7 +25,7 @@ $(document).ready(function() { $nameField.val(val).trigger('blur'); } - $titleField.keyup(titleKeyup); + $titleField.bind('keyup change', titleKeyup); $nameField.focus(function() { // if they happen to change the name field on their own, then disable I've also just opened an issue for this at GitHub, let's see what Ryan says
    1 point
  19. Please send a cold keg of Unibroue La Fin Du Monde, and I'll have my tap ready. Just kidding, but that's one of my top 3 beers and has been for a long time. Canadians know how to make some damn fine beer, that's for sure. Luckily it's easy to get around here. A good thing, because Georgia has some kind of laws about shipping beer (to protect the poor beer/wine distributors).
    1 point
  20. There will be a way to get URLs for the page in any language. I haven't yet figured out where to put it, but it'll be there. Of course, you can always do this too: $saved = $user->language; foreach($languages as $language) { $user->language = $language; echo "<li>$page->url</li>"; } $user->language = $saved; Probably what I'll do set set it up so that you can pass a context to $page->url, like $page->url($language); Overlapping will be okay, and I imagine necessary in some cases where a word is the same in two languages. So long as one of the parent names is language-specific, it'll still resolve to the right language. If there is a collision between the page and all parents, then at that point you would have to make something unique about the page's URL so that the pages don't have the same exact path. Homepage has no path, so there's nothing to trigger a language selection there. In a setup using multi-language page names, I imagine the homepage would either be 1) a gateway asking you to select a language; or 2) be presented in the default language with links to other languages. Homepages for other languages would have to be at some other URL, like domain.com/de/ or wherever you wanted it.
    1 point
  21. yup, php is the language that drives the web - and processwire. I wished I started learning php 10 years ago. https://tutsplus.com/course/php-fundamentals/ http://www.w3schools.com/php/default.asp http://www.tizag.com/phpT/
    1 point
  22. Great site! The design really compliments the nautical/sailing photography quite nicely. It makes me want to go sailing. I wish I could… But we have no big lakes, rivers, or any large bodies of water in Atlanta… well except for in my basement when it rains.
    1 point
  23. That'd be a bit beyond me I'm afraid.
    1 point
  24. That only works from within the WYSIWYG though right? Doesn't work if you want to add an image with the standard images field.
    1 point
  25. Wouldn't Processwire benefit from having some sort of global file/image management module so that you could choose assets for any page from a single location, rather than being specific to a page? I'm working a site where the client has decided to use the same content image on more than one page. At the moment, it seems the only acceptable option would be to upload the same image more than once. Creating related pages just to be able to add the same image to more than one page seems overkill for this scenario. On another site, the client wants to add images to the WYSIWYG field but first they have to add them to the page using the Images field on the page. It would be good if you could add images to a file module directly from within the WYSIWYG, because that two-step disjointed process is confusing for some people. A lot of other CMS have global file managers/media libraries, so just wondering why that feature is missing from Processwire?
    1 point
  26. Interesting topic.. and mvsic.net looks totally cool, by the way! My current coding playlist is a combination of ZZ Top (songs from La Futura mostly), and Maximum The Hormone. Other than that, (a 25 minute dark ambient track by Norwegian black metal artist Burzum) is one of my all-time favorites. This one really helps when trying to get into a flow state.
    1 point
  27. I lizen to mi sound ofe keybpard wun koding.
    1 point
  28. It is supported if you allow it in your field's TinyMCE settings. Setup > Fields > body > input > Advanced TinyMCE settings. It's not recommended though, because being able to enter things like iframes or scripts directly in body copy are considered bad security. It's better to use a runtime module like the TextformatterVideoEmbed module. If you are finding that doesn't work in your case, then give more details -- what is the URL you are pasting in? The first thing we'd want to do is make sure it is in the expected format. Next we'd make sure it is in it's own paragraph (i.e. has 1 blank line above and below it, if placed among other copy).
    1 point
  29. Nico blogged about a school site he made with Processwire. I had to much time that day and tried Processwire without expecting too much. 2 weeks later and we started to convert all sites to PW. Now I just can't image how we could easily make great websites withouth Processwire.
    1 point
  30. if($page->body){ //not empty }else{ //empty } other options if($page->body) echo "body not empty"; if(!$page->body) echo "body empty"; for the second question: <?php if($page->gallery->count() > 0){?> <h6>Images</h6> <?php foreach($page->gallery as $slide) { echo "<a rel='prettyPhoto[pp_gal]' title='{$slide->gallery_caption}' href='{$slide->gallery_image->url}'> <img class='peKbGallery' data-delay='{$slide->gallery_delay}' src='{$slide->gallery_image->url}' alt='{$slide->gallery_caption} (Click to enlarge)' /> </a>"; } } ?>
    1 point
×
×
  • Create New...