-
Posts
848 -
Joined
-
Last visited
-
Days Won
4
Everything posted by mr-fan
-
Add user filter to inputtype page field selector
mr-fan replied to gebeer's topic in General Support
Had some similar issue but it won't work and don't know why? $mr = wire('user')->user_mr; //a integer field on the user template $test = "4702"; //thats the value from the field user_mr return $pages->find("has_parent=$test"); //$test word $mr not?? user_mr is an simple integer field on the $user template... With the $test id it works and show all children of this parent...with $mr it shows blank? regards mr-fan- 6 replies
-
- user filter
- page
-
(and 2 more)
Tagged with:
-
yes tried that workflow, too - but exact like you wrote it only works on simliar sites with similar features...for separate features Migrator do a better job. It always depend on the sort of sites you build or on the specific project. For me as PW beginner i've learned a lot between my first project last year and now - so i only could use some parts of my former websites...
-
for this special kind ProcessMigrator is the right tool for you - check it out - it is great!! and build in import/export of fields and templates is also not bad for quick transfers of a setup (for eg. a slider pagetable/repeater or such stuff)...
-
Next one that could solved with HannaCode like [[a nr=012345/67891]] should create a working a tag (don't tested just thought loud). If i've time i could create a Hanna on this - but it should be not that hard.
-
the main time siteprofiles don't fit complete on every project....so this could be not the best thing to setup content faster... with PW a website is more like crafting a concept than install only a software. With ProcessMigrator you could choose a Page (with children) and get all relevant fields and template on import/export so you can reuse special content better than the whole siteprofile.
-
For shure not the best way - but i'm no pro who work on projects every day....so it works good for me and my skills. got a local installation with uptodate core + my standard modules + german language files at one place 1. install new blank pw installation 2. copy and paste the /site/modules/ and /site/templates/ folder 3. install all new modules + language 4. if needed import special content from my local repository with https://github.com/adrianbj/ProcessMigrator (like site-settings-page, fields/templates for a imagegallery and so on) 5. ready to work on the new page as you can see not really fancy not really streamlined but for a one man show with less projects it did the job.
-
Thanks did not clean it out....will add this to the pull request...
-
So problem solved the Module gets a PR on github changed the array for the condition strings...so we can use the API code as keys and load the condition better. And have build in a if for the condition itself - so if the API code change or a new one is added we get no error on the frontend just the condition has no output anymore...so it's a little bit saver for the API code <=> condition text stuff. Please have a look and make a new merge if you accepted/tested the changes? best regards mr-fan crosslink to the new german lang file (backend translated, too)
-
So problem solved the Module gets a PR on github and here i put the complete de_DE language file for the module...now Backend translated, too. regards mr-fansite--modules--markupweather--markupweather-module.zip
-
I've found that for some issues the replacement of the conditions text did not work...on some strings. like i wrote in the german translations threat...there are some problem to get the strings. $out .= "<div class='conditions'>" . __("Current Conditions:", __FILE__) . " <span>" . str_replace(array_keys($conditions), $conditions, $current['text']) . "</span></div>"; so it would be saver if we don't replace the text and use the conditions code for this one...if i found some time on "ostern" may i could run a test and a PR for this. So we get the condition Code - and check if this code is not there so no condition output....so we get no weird outputs. regards mr-fan
-
I have to admit that there is some sort of issue in MarkupWeather Module..... On the kindergarten site actuall it is sometimes "Mostly bewölkt" and today there are "Light Schnee and Schauer"... take a deeper look if i've time...on this. thanks to manfred for his work on the language files!! best regards mr-fan
-
Admin side page field - autoselect all the selectable pages
mr-fan replied to Vineet Sawant's topic in Getting Started
Edit: Get it wrong i thought you think about the user interaction....sorry for that You could even use a custom pagetree - should be possible to create a PageArray and run this with the original pagetree and AdminCustomTables example code from the imageoverview (CutomAdminPage Template): <?php // Imageoverview Custom Admin Page ?> <style type="text/css" media="screen"> /** * larget magnific popup */ .mfp-iframe-holder .mfp-content { max-width: 1200px!important; } </style> <script type="text/javascript"> $(document).ajaxComplete(function() { //add trigger class and modal setup $('.PageListActionEdit a').each(function(){ $(this).addClass("lb-edit").attr("href",$(this).attr('href')+"&modal=1"); }); $('.PageListActionNew a').each(function(){ $(this).addClass("lb-edit").attr("href",$(this).attr('href')+"&modal=1"); }); //setup lightbox $('.lb-edit').magnificPopup({ type: 'iframe', disableOn: 0 }); }); </script> <?php //get Magnific css and js $this->modules->get('JqueryMagnific'); //render PageListtree with setting the parent page $formImages = $this->modules->get('InputfieldForm'); // prep the form $wrapperImages = new InputfieldWrapper; // a wrapper $wrapperImages->attr('value', '<h2>Bilder</h2>'); $i = $this->modules->get('ProcessPageList'); // get the pagelist process $i->set('id', 1015); // setting the parent page $pageTreeImages = new InputfieldMarkup; // the placeholder $pageTreeImages->value = $i->execute(); // fill the InputfieldMarkup form field... $wrapperImages->add($pageTreeImages); // put inside the wrapper... $formImages->append($wrapperImages); // append the wrapper echo $formImages->render(); And as result i've a adminpage just with the imagetree and on click editing with modal view... or take a look at a example module from soma: https://processwire.com/talk/topic/1272-new-page-nav-in-admin/#entry11276 regards mr-fan -
Don't have much experience with really big imports it seems that the import module break on german Umlauts - all data i've imported is cutted of on every Field a öäü is in the text?? Field import "Name" => "Grötzinger" get to only "title" => "Gr" on the page? Or am i make a mistake with the handling of the data? regards mr-fan
-
I've found a very good one on debugging from adrian... <?php //color code /* Debug script for better output on vars and arrays in the browser js console * Thanks goes to https://processwire.com/talk/user/985-adrian/ * Usage: * debug('test'); * debug($variable); * debug($array); */ function debug ($data) { echo "<script>\r\n//<![CDATA[\r\nif(!console){var console={log:function(){}}}"; $output = explode("\n", print_r($data, true)); foreach ($output as $line) { if (trim($line)) { $line = addslashes($line); echo "console.log(\"{$line}\");"; } } echo "\r\n//]]>\r\n</script>"; } best regards mr-fan
-
What about singleField Template with Title as Item and two Parents one for pro and one for contra + a pagefield list with the add new function so on the template u need the list simple setup the two pagefields for pro and contra....should be good UI. pagetree: --someparent ---somepage (here we need the list -> add the two pagefields for pro and contra) --somewhere hidden page settings or whatever ----proparent -------here saved all the pros from all lists... -------another pro -------and so on ----contraparent -------you get the idea... best regards mr-fan
-
...just fast from the mobile.... What about a extra field / two fields. One check box for [ ] include js. - if checked show under the body the special field ( could be made with ace editor for syntaxhighlighting too) ....should work cleaner as code in the WYSIWYG? Regards mr-fan
-
Is it always the same JS snippet or just 2-3 variants?? In this case you could easy use Hanna Code for this like [[myjs]] in the wysiwyg.
-
Could this module used from the api with presets for the options/csvfields? Need such import on a user page for a file with the same data but different amount of lines...a kind of preset would be great. (Just fast question via phone)
-
Thanks folks for the 300 likes....
- 4 replies
-
- 2
-
- website
- kindergarten
-
(and 1 more)
Tagged with:
-
Working with Piwik for some years - in fact it's a bit less fancy and smooth but it works good so far and shows all needed.....and like LostKobrakai wrote it is in german better to rely on things you've the full control. Updates went smooth - like in PW 1.backup db 2. click update 3. ready... Some of my Clients get a separate login and are satisfied with the informations.
-
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
- 4 replies
-
- 4
-
- website
- kindergarten
-
(and 1 more)
Tagged with:
-
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!
- 4 replies
-
- 9
-
- website
- kindergarten
-
(and 1 more)
Tagged with:
-
Hi guys, thank you nikola for this module just one thing i found to solve is the check if $result was true and the file_get_contents(); work.... for me some short times the service API was not available so the whole render() give me an error and break the whole page....not so good if you use this one as widget or on every page and so on... Did a pull request on github and here i post the german lang file.... Thank you again for this great widget! best regards mr-fan markupWeatherDE.zip
-
A other interesting CKE addon is: http://ckeditor.com/addon/widgettemplatemenu intro + demo: http://albatrossdigital.com/node/41 could be used for bootstrap widgets, own snippets, maps, templates and so on....very interesting for editors with massive use of Wysiwyg Content...
-
Thanks to you both! get some sleep, too.....for shure if simply not checked the form element..... so enough for today... will post working code complete after some hours....