-
Posts
6,638 -
Joined
-
Last visited
-
Days Won
360
Everything posted by bernhard
-
@abdus i like the idea of using only one field and adding options via hooks, but i don't think it's the most userfriendly to throw an exception after pagesave in case someone uploads more than 1 image. i guess it should be possible to set the max-file setting and show the upload on the client side before upload?
-
sorry my solution only works if you have zip-codes like 1... 2... 3... 10... and 19... would be listed under 1... you could replace the for(...) with this $zipcodes = [11, 15, 80, 99]; foreach($zipcodes as $zip) { ... } always depends what your initial data looks like (if you know the zip-code-categories or if they are dynamic). 1 question, so many answers
-
hi and welcome deceleration quite easy: <?php // overview for($i=1; $i<??; $i++) { echo "<a href='./$i'>"; // create a link with that url segment echo "ZIP $i... [" . $pages->count("template=yourtemplate, zipcode^=$i") . "]"; echo "</a><br>"; } // details $zip = $sanitizer->int($input->urlSegment1); if($zip) { $items = $pages->find("template=yourtemplate, zipcode^=$zip"); foreach($items as $item) { echo "<a href='{$item->url}'>{$item->title}</a><br>"; } }
-
Never said that I would recommend reading my second link carefully and trying out markup regions (... And building your site with a template for your child pages instead of URL segments)
-
Preview/Discussion: RockDataTables
bernhard replied to bernhard's topic in Module/Plugin Development
datatable connected to the pagefield updating the pageautocomplete field seemed a little tricky in the beginning but the final approach was quite easy: // handle buttonclicks $('#addcompetences').click(function(e) { e.preventDefault(); var table = $table.DataTable(); // datatable instance var $field = $('#wrap_Inputfield_competences'); // asm select field var $template = $field.find('li.itemTemplate'); // selected page template var $ol = $template.closest('ol'); // get selected competences from table var selectedtable = $.map( table.rows({selected:true}).data(), function(val, i) { return [[ val.id.sort, val.title + ' (' + val.cluster.filter + ')' ]]; } ); // update ASM // clone template and populate values $.each(selectedtable, function(i,val) { // check double if($ol.find('.itemValue:contains("' + val[0] + '")').length) return; // add clone var $new = $template.clone().appendTo($template.parent()); $new.find('.itemValue').text(val[0]); $new.find('.itemLabel').text(val[1]); $new.removeClass('itemTemplate'); }); // add state changed class $field.addClass('InputfieldStateChanged'); // update original input InputfieldPageAutocomplete.rebuildInput($ol); return false; }); -
abdus code would work great, but still i don't understand what is bad about having a template file for each of your children. url segments in those cases have some drawbacks that you may not think of before and always need some extra work (for example creating a sitemap, multilanguage or the like...). hearing that this scenario makes problems for you i guess maybe your setup is not optimal. using https://processwire.com/docs/tutorials/how-to-structure-your-template-files/page4 this would be very easy. and using https://processwire.com/blog/posts/processwire-3.0.62-and-more-on-markup-regions/ it would be even easier.
-
i know that this would change but i thought you maybe request only some content via ajax or the like and populate areas in your parent page's template. i don't really get what you are trying to achieve and what the problem would be with a template for your child pages... but it's late here
-
then i didn't understand your question, because my solution would have nothing to do with seo
-
maybe you can use the page id as url segment? then you do not have the name conflict (or at least you would only have it if a page with the name of another page's id exists, what should be at least very unlikely or if you take care of this would be impossible). ps: or you take an url segment like #getcontent#123 and then you strip off the #getcontent# part and request the page's content by the id
-
hi adrian, me again just wanted to try captain hook and got a memory error with the default 128M php setting: setting it to 256M helped but I'm not sure why this happend or if tracy should also work with 128M of memory and this is a bug?
-
hi adrian, just updated tracy from the version before the console ready.php include and now i got an error Call to a member function addHookAfter() on null because i add my hooks like this: // set all languages active automatically $wire->addHookAfter('Pages::added', function($event) { $page = $event->arguments(0); foreach ($this->wire->languages as $lang) $page->set("status$lang", 1); $page->save(); }); as quickfix i added this on top of the file: $wire = $this->wire; i think it would be nice to have the wire variable available by default. what do you think?
-
Very nice indeed! i had no problems at all here on my 7Mbps internet and very old PC. I cannot even remember when i bought it ^^ One feedback: I liked the customer story but imho the end was a bit sudden. It only redirects to the services page and there is no real call to action or no hint where the customer could continue. What do you think of some help like "contact us or see our portfolio" on that page?
-
Since I read about the new fieldsets I'm thinking if it would make sense to have some kind of fieldset library. Maybe export jsons in github gists? Or maybe collect them just in a forum thread here... This could make it more easy and more efficient to share common fieldsets, like SEO, person details or the like. What do you guys think?
-
hi @rafaoski maybe https://laragon.org/ is interesting for you as a replacement for xampp. i use it on win10 for about a year and it's great
-
Wishlist: Group field for grouping fields
bernhard replied to steveooo's topic in Wishlist & Roadmap
finally: https://processwire.com/blog/posts/processwire-3.0.73-and-new-fieldset-types/ -
very nice and welcome update!!
-
hi Jacek, if I understand you correctly it seems like this module could help you:
-
[SOLVED] Extremely slow to open / save one template type in admin
bernhard replied to prestoav's topic in General Support
yes, tracy is awesome and would recommend you having a look though sometimes it slows things down a little. i also experienced that the debug mode can slow down things. in your case i would do the following: backup install tracy and see if you find any strange things (errors, many redirects etc) create a new template, check performance if performance is ok, add fields of your slow template one by one and check after adding each field. if it slows down at some point you could investigate further -
[SOLVED] Extremely slow to open / save one template type in admin
bernhard replied to prestoav's topic in General Support
i would have been surprised if that had made a difference thats why i asked this: -
Hi @nickngqs and welcome to the forum It totally depends on your client and his needs and you are the only one that can know that if you want some stats: https://blog.sucuri.net/2017/01/hacked-website-report-2016q3.html but that may help you or may not...
-
[SOLVED] Extremely slow to open / save one template type in admin
bernhard replied to prestoav's topic in General Support
no need for a tutorial - it's too simple just add a fieldsettab to your page, save it, then you'll get a warning and a second field called yourfield_END. place your fields in between those fields and they will be presented in a tab. there is a little issue with ajax tabs though: https://github.com/processwire/processwire-issues/issues/332 are you using tracy debugger? are you using any hooks? any modules? -
hi rushy, maybe i'm misunderstanding you but it sounds like you are trying to display the description of the FIELD and not the description of the IMAGE? you do not have a template override option for image descriptions... this is where you put the description of your images:
-
How to upload files without changing original filenames
bernhard replied to homma's topic in General Support
you could just take the code example from abdus, activate url segments for your site and do something like this: // list your files to download foreach($page->files as $i=>$file) { echo '<a href="' . $page->url . $i . '" target="_blank">Download File ' . ($i+1) . '</a>'; } and in your template file: if($num = $input->urlSegment1) { $file = $page->files->eq($num); // continue with abdus script } maybe not without bugs but should show one possible solution -
How to upload files without changing original filenames
bernhard replied to homma's topic in General Support
may i ask WHY? if we know the reason we may can suggest some other way of achieving almost the same need -
Help Setting Up Input for Tabular Data Output?
bernhard replied to John W.'s topic in General Support
btw: the (no so cheap) pro version of handsontable allows nested headers: https://docs.handsontable.com/pro/1.4.0/demo-nested-headers.html but i don't know if that would work with my module...