Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

10 Good

1 Follower

About ro-bo

  • Rank
    Jr. Member

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,653 profile views
  1. Thanks, that's it!☺️ Now of course I've found that too ... https://processwire.com/talk/topic/22516-when-using-js-fetch-it-seems-config-ajax-is-ignored/
  2. Hi there. I have an annoying problem with a page where I load content dynamically with AJAX. (ProcessWire 3.0.148) I'm using MarkupRegions with the following code fragments: PHP template-files // +++ _main.php +++ if( !$useMain || $config->ajax ) return; ... // +++ page with the dynamic AJAX content +++ ... if ($config->ajax) { wireIncludeFile('./_includes/wine.inc.php', $arrOut); return $this->halt(); }//endif ... JS file // +++ main.js (function(){ var dynamicModals = document.querySelectorAll('[data-toggle="ajaxModal"]'); if (!dynamicModals.length) return; for (var i = 0, len = DynamicModals.length; i < len; i++) { dynamicModals[i].addEventListener('click', function(e) { e.preventDefault(); var url = this.getAttribute('href'); var ajaxModal = document.getElementById('ajaxModal'); if( ajaxModal ) { var modalDiv = AjaxModal; } else { // +++ modal var modalDiv = document.createElement('div'); modalDiv.id = 'ajaxModal'; modalDiv.setAttribute('data-uk-modal', ''); modalDiv.classList.add('uk-modal-center', 'uk-flex-top', 'uk-modal'); document.body.appendChild(modalDiv); }//end if var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { var modal = document.getElementById(modalDiv.id); var data = this.responseText; var html = '<div class="uk-modal-dialog uk-modal-body uk-margin-auto-vertical">'; html += '<button class="uk-modal-close-full uk-close-large" type="button" data-uk-close></button>'; html += data; html += '</div>'; modal.innerHTML = html; UIkit.modal(modal).show(); } }; xhttp.open('GET', url + '?q=notUsed', true); xhttp.send(); }); }//endforeach })(); The problem is that sometimes the $config->ajax does not work or is ignored and the entire _main.php template file is loaded with AJAX-request. No error is displayed in the browser console. The content is also shown in the modal box, only sometimes with the data of _main.php. I've tried so much, but nothing helps! Does anyone have a similar problem??? Robert
  3. Hi. I have a problem with the "link field" and PW 3.0.96 . When I try to select a page (page tree) the "Choose" button disappears. Unfortunately it is no longer possible to make a selection. Does anyone have the same problem or a quick solution for it? I think the error is not the module, but the file "ProcessPageList.js" Thanks, Robert
  4. Hi Robin. As expected, the sorting works perfectly now! Thanks, Robert
  5. Hi Robin, thanks for your reply. I think it‘s exactly what I‘m looking for. I will try it in the next few days... Thanks, Robert
  6. Hi, Is there an easy way to change the sorting of the template-selection when adding pages (Page Add Process)? It would be nice if sorting in the select-field is by template-title instead of template-name... E.g: 01 - Templatetitle 1 02 - Templatetitle 2 ... Thanks
  7. Hi, in my new project there are some pages which are only included in an overview page by $page->render($options) and can not be shown as an independent page, I'll call them "sections". I'm using the limit-selector string and the pagination... Now I would like to refer to special sections which are split by a pagination--> e.g. RSS-link should look like this: domain.tld/sub/page3 Actually I solved it this way: rss.php template foreach ($items as $item) { $item_parent = $item->parent; if ($item->template == 'my-section-template') { $limit = 3; $children = $item_parent->children('sort=sort'); $item_pos = $children->getItemKey($item) + 1; $pagination_nr = ceil($item_pos / $limit); $item->httpURL_mod_wg = $item->parent->httpURL . 'page' . $pagination_nr; }//end if } module modification (the bad way, I know): protected function renderItem(Page $page) { .... if(!$page->httpURL_mod_wg) $page->httpURL_mod_wg = $page->httpUrl; // inserted by WG $out = "\t<item>\n" . "\t\t<title>$title</title>\n" . "\t\t<description><![CDATA[$description]]></description>\n" . $pubDate . $author . "\t\t<link>{$page->httpURL_mod_wg}</link>\n" . // $page->httpUrl modified to $page->httpURL_mod_wg "\n\t<guid>{$page->httpURL_mod_wg}</guid>\n" . // $page->httpUrl modified to $page->httpURL_mod_wg "\t</item>\n"; return $out; } It would be nice if there was a way to modify the <link> and <guide> urls for each Feed Item! Or maybe someone has a simple solution for this? Thanks Robert
  8. Hi tpr, The actual JQuery version has 94,8 KB. I think that shouldn't be a problem today (pictures are usually much larger). Only an inefficient way of using JQuery could be a problem in some cases... Robert
  9. Hi Bernhard, read and try his: http://osvaldas.info/drop-down-navigation-responsive-and-touch-friendly In the lower section of this page you can download this code doubletaptogo. I use this code in almost every project where a flyout navigation occurs. Robert
  10. Hi everyone. I'm working on a site where only a few pages are multilingual. The default language is German. Some pages should be available in English. Only these pages have a language switcher, depending on whether the english language is activ in the settings for this page. Nearly everything works fine but if I switch from an page where English language is active to another page where only german language (default) is activated (by page settings) the URL and $user->language is still english although the page should only be available in German. I think that leads to double content in Search Engines and other problems in Page view (e.g. some fields in Template have English Content and others are only german). What's the best approach for this issue? I currently have it resolved like this: if (!$page->viewable($user->language)) { $user->language = $languages->get('default'); $session->redirect($page->url, false); } How would you do that? Just by the way: Would the HTTP 302 redirect be OK in this context or is it better to send a HTTP 301 redirect? Thanks in advance! Robert
  11. Wonderful! Thanks Ryan, thank you LostKobrakai!
  12. Hello LostKobrakai! Great, now it works fine. No DB-entries and no value! But then it is a bug in the "FieldtypeOptions" class, isn't it?
  13. Please help me on my way . Can anyone replicate it?
  14. Hi LostKobrakai. Thanks for your answer. Here is a step-by-step guide: 1. Download Processwire 2.6.1 Master from http://processwire.com/download/ 2. Upload PW with site-blank profile to Server 3. Install PW 4. Login to PW-Backen 5. Modules -> Core -> Select Options -> Install 6. Setup -> Fields -> Add New 7. Basics Tab -> Name: test -> Type: Options -> Label: testfield 8. Details Tab -> Select (Single Value) -> Selectable Options: test1 (new Line) test2 (new Line) test3 9. Actions Tab -> Add Field to Template "Home" 10. Save (Add Field after title) 11. Pages Tab -> Home -> edit 12. Choose test1 -> Save 13. Choose "blank" (no Value/Option) -> Save 14. Now I check the Database and there are 2 Entries for the same page_id 15. open home.php with an editor -> write "echo $page->test;" under "include("./basic-page.php");" -> Save and upload it to the server 16. Open the Home Page (Frontend) with browser -> the echo command outputs "1|3" means 1 for the first Entry and 3 for the last entry. If I add an Option (see step 8) e.g. test4 the echo command outputs "1|4" aso. I have not done anything else! Meantime I tested it on two different Servers (My Local Server and EDIS-Provider where some PW-Pages run successfully) and the phenomenon continues to exist. I think (and Ryan confirmed it in the poste further above) that it's unusual -> the echo command should output no value (blank) instead of "1|2" or "1|3" ... Best Regards Robert
  15. Hello again! Now I made a new/blank installation without "multi language" or any other modules except the "Select Options Field". I didn't make any new fields or templates beside an Option-Field called "testfield". Unfortunately with this new installation I can reproduce this issue too... In the attachment you can find some screenshots from database, PW-backend and frontend-output with <?php echo $page->testfield; ?>. I have already mentioned that this issue appears, when I firstly choose one option and save the page -> then I set it back to blank and save it again. Does anyone have any idea?
  • Create New...