Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/26/2015 in all areas

  1. Hi Guys, done a small kindergarten project that works with care on kids only in the wood and outdoor. http://waldkindergarten-altfraunhofen.de/ It's my second project with PW and learning so much on every project i'm getting better and better with API, modules, using more special tools.... like on this one first time: AIOM->greatTool MarkupWeather->worksGreat PageProtector + PageRenameOptions for the building time and AllTimeLovers: AdminCustomPages ChangeImageSelect MarkupSimpleNavigation PageListBetterLabels TemplateDecorator VersionControl MarkupSitemapXML ModulesManager CropImage Changelog ListerPro The project is a small budget so i'm relying on a individual changed themeforrest template - no own design this time. With this one i've made my first experience with URL Segments and i love it like everything else in PW! Worked out a little "archive" script with 80 line of Code and some URL Segments for the /archiv/ as SEG1 and cat or year as SEG2 should work great. Using the PagerMarkup with Somas Code for SEO friendly links - Thanks for this one. At least thank you all and especially Ryan for making such little happy things possible!
    7 points
  2. Hi guys. This is my first project with PW, my personal site and portfolio. Check it out: http://www.heldercervantes.com This is an almost clean PW installation, with only the file type repeater module for all my repeating needs Had an awesome time with PW and will definitely explore it further on future projects.
    5 points
  3. Two days after announcing these two, we finished a third one. http://pingpong.pt/ Pingpong is the communication company of Ana and Pedro. Ana is my sister This is a simple one page site, responsive of course. The corporate image was also done by us and the images are old photos in the public domain.
    4 points
  4. Get is for returning a single page. You are looking to return a page array of more than one page, so try this: $entries = $pages->find("id=1049|1050");
    2 points
  5. Hi guys, Thanks for reporting the problems. You're right, the problem is that if language support is not enabled, the langauges API variable is not available. I wasn't aware of that and of course only tested when language support was enabled. I'll push a fix this afternoon! Cheers
    2 points
  6. Just forgot - i'll always wanna share the interesting parts to this forum so may others can learn something or i can improve something... i use in my template the delegate approach with a _init.php and a _main.php for the whole HTML Part....but i've read from Horst about a great and simple solution to split up easy HTML parts for special contents and templates...with this simple lines of code: _init.php $myLayout = "default"; //default layout _main.php <?php include_once("./layouts/_{$myLayout}.php");?> So i could use twocol layout if needed mabe if i've subpages: // If the page has children, then render navigation to them under the body. // and get the sidebar $level = count($page->parents); if ($page->template != "start") { if($page->hasChildren || $page->siblings && $level == 2) { $myLayout = "twocol"; $sidebar = "<p>".$page->meta_description."</p>"; } } or get some more logic together with URL Segments on the mentioned archive page: <?php // aktiv-root.php template file // overview - all activities from the kids //I've /aktuelles/archiv/2014/ or /aktuelles/archiv/kochen/ //segment1 = archiv ->show the archiv //segment2 = jahr ->show the posts from choosen year //segment2 = kochen ->show the posts from choosen cat //get all segments for choosing the output/layout! $seg1 = $sanitizer->pageName($input->urlSegment1); $seg2 = $sanitizer->pageName($input->urlSegment2); $seg3 = $sanitizer->pageName($input->urlSegment3); //get the rootpage of the posts $aktivroot = $pages->get(1063); //Load normal akitv_root Layout with isotope view of the last 12 entries! if (!$seg1) { $myLayout = "aktiv_root"; $headinfo .= "<h5><a href='{$aktivroot->url}archiv/#start' alt='Archiv'>Alle Einträge im Archiv</a></h5>"; } //check if we are in /archiv/ first! if ($seg1 && $seg1 != 'archiv') { // unknown URL segment, send a 404 throw new Wire404Exception(); } //check for the third urlsegment not needed if ($seg3) { // unknown URL segment, send a 404 throw new Wire404Exception(); } //get startet to separate the posts in years and categories if($seg1 == 'archiv') { //Load categorie akitv_archiv Layout show all or divided by category or year!! $pageNum = $input->get->page ? $input->get->page - 1 : 0; $limit = 5; $start = $pageNum * $limit; $posts = $pages->find("template=aktiv,start=$start,limit=$limit,sort=aktiv_date"); $myLayout = "aktiv_archiv"; $headinfo .= "<h2>Alle Einträge im Archiv</h2>"; if ($seg2){ if(preg_match('/^(\d{4})$/', $seg2, $matches)) { //Load year View if $seg2 wrong 404 // A URL segment matched in the format of year-month, i.e. /news/2010-12 $year = $matches[1]; $startYear = strtotime("$year-01-01"); $endYear = strtotime("$year-12-01"); $now = time(); //Load dates aktiv_archiv Layput show all posts for a selected year $posts = $aktivroot->children("aktiv_date>=$startYear, aktiv_date<$endYear"); $headinfo = ""; $headinfo .= "<h2>Alles aus dem Jahr ". $seg2 ."</h2>"; if ($posts == ""){ // not valid category, send a 404 throw new Wire404Exception(); } } else { //Load cat View if $seg2 wrong 404 //get all categories $cat = $pages->get(1077)->children("include=all"); //search for the given urlsegment3 as the category $catsearch = $pages->get("/site/aktivitaeten-typen/{$seg2}/"); $found = $cat->filter("id={$catsearch->id}"); if ($found == ""){ // not valid category, send a 404 throw new Wire404Exception(); } // valid category, list items in it // Load categorie akitv_archiv Layout with listing of all entries of one category $posts = $pages->find("template=aktiv,limit=2,aktivcat={$found},sort=aktiv_date"); $headinfo = ""; if (count($posts)) { $headinfo .= "<h2>Alles zum Thema ". $catsearch->title ."</h2>"; } else { $headinfo .= "<h2>Leider keine Artikel zum Thema ". $catsearch->title ." vorhanden!</h2>"; } } //end cat or year view = seg2 } //end /archiv/ = seg1 } //end output (may someone find some mistakes i'm not a PHP proffesional - and always open for refactoring.... ) Best regards mr-fan
    2 points
  7. A lot of people think they can code all day long, but do they realise they're debugging most of the time. Welcome to the club...
    2 points
  8. Update: version 0.0.7 Merged changes from last version in dev to master MenuBuilder now fully speaks your language, thanks to this post by @bbeer. Added multilingual capabilities and options to both the process and markup modules. In relation to above, added option 'default_title' to MarkupMenuBuilder. This option allows you to control whether to display MB saved menu item titles/labels in your navigation versus the actual/current titles of the pages listed in the navigation. The default => 0 means display the saved values (e.g. useful when you've altered the labels/titles). However, in some cases, e.g. in multilingual environments, you may want your navigation labels to change depending on the chosen/user language. In such a case, users will be presented with labels that match their language (assuming of course your pages have titles for different languages). To use the option specify 'default_title' => 1. Works for both menus and breadcrumbs Any issues, please let me know, thanks. IMPORTANT I forgot to add that currently, for multilingual sites, you can only pass an array | id | page to render() and renderBreadcrumbs() but NOT a not a menu page name | title (will throw an error for superusers and display nothing for all others). This is because there is no way MarkupMenuBuilder can know whether the string you are passing to it is the name of the menu page in English, Dutch or Arabic, etc. It cannot fall back on the current user language as well since the front-end of your site can be surfed in several languages. Neither can it fall back on the default language since a menu could have been created in a different language from the default. Hence, the only foolproof way to get and render menus in such environments is by array of menu items or menu id or menu page. Unless somebody shows me a workaround, its going to stay this way. I hope this is not too much of an inconvenience to ML devs
    1 point
  9. Yep, the values of the array are still wire derived objects, so it should work.
    1 point
  10. I don't like the interface of Piwik. It feels kinda clunky compared to GA. But with our german privacy protection laws it's just more convenient to use Piwik instead.
    1 point
  11. Adrian thanks a lot, works like a charm.
    1 point
  12. Hi bbeer, here you have https://github.com/somatonic/MarkupSimpleNavigation#build-a-menu-using-a-pagearray-instead-of-a-single-root-page
    1 point
  13. That only partially true. ProcessTemplate::executeRename handles the whole rename process and is therefore called to generate the confirm form and to process it afterwards which should be what you want to hook. Pages::saveReady would not work as templates are not pages.
    1 point
  14. Check the settings of your csv file. Make sure it is UTF-8. The module has no problem importing special characters if your csv file is saved with the correct settings. Someone has asked the question already on this topic here
    1 point
  15. Ok, all makes sense now Your needs are different from the person I put that together for - they wanted the root parent changes, not to actually drill down to the specific page. You can get directly to the specific page with this: public function changeParent(HookEvent $event) { $pid = (int) $this->input->get->id; $event->replace = true; $event->return = str_replace($pid, $rootPageID, $event->return); } BUT unfortunately this doesn't load the images available on the page because the check to see if there are images available or not happens here: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Process/ProcessPageEditImageSelect/ProcessPageEditImageSelect.module#L129 which is before the execute method we are hooking into. So I think you'd actually have to hook directly into ProcessPageEditImageSelect::getImages which is not currently hookable. But maybe you should add the ___ to it and play around and see if you can get it work. Sorry I don't have time right now, but I think it should be doable. If you get it to work, Ryan should be amenable to making it hookable in the core.
    1 point
  16. I don't think this will fix all of your problems (or maybe even any!), but I found I had to set: $config->sessionFingerprint = false; Otherwise I was being asked to login again every few minutes. Might be worth trying.
    1 point
×
×
  • Create New...