• Content count

  • Joined

  • Last visited

Community Reputation

8 Neutral

About SebastianP

  • Rank
    Jr. Member
  • Birthday May 1

Profile Information

  • Gender
  • Location
    Dresden, Germany

Recent Profile Visitors

395 profile views
  1. Thank you very much for the idea - a simple "wire("user")->language = wire("languages")->get("name=default");" on the top of the admin template does the job (in this case all admin users use the default language, so a separate field is not necessary) Regards Sebastian
  2. Hi there, I've build a website with a language switch. If the user is logged in in the same browser, the website displays also an "edit"-button, whitch opens the page in the backend - thats why I cannot 2 different browsers for viewing/editing. So far, so good:-) But if I change the language in the frontend ($user->language = ...), the language in the backend is also changed - that's not so good, because not all pages are translated and have titles in the other language. Is there a way to force the backend language to the logged in users default language? Or can I set the language of the frontend without change the users language? Thank you in advance, regards Sebastian
  3. Thank you both! I have found now another solution for my problem with the use of urlSegments. Regards Sebastian
  4. Hi, for a news blog I select the articles by template and sort by post_date: "template=article, sort=-post_date". Also I have a page reference field, wich holds a manually selection of some of this articles. Is there a way to customize the selector string so the manually selected articles come as the first entries? Because of some issues with the pagination I don't want merge two page arrays. Thank you, regards Sebastian
  5. Thanks for your answer! Meanwhile I've imported the files manually ("new Page()... ") - the hint to the "actionInsert()"-method helps me with the rest:-) Are you not able to import them using Media Manager upload feature? No - I want to rebuilt the existing wordpress posts (text, text with image, galleries and so on) with repeater items; so I must tag the files during the import with their ID from the wp_posts table.
  6. Hi, I've bought Media Manager before a few days and have a question: how can I add files to the media library via the api and how can I add media manager assets to a media manager field via the api? I'm importing a large Wordpress page and have to add a lot of files... Thank you, regards Sebastian
  7. Thank You horst, it works! Until now I'm not so familiar with namespaces - the man grows with its tasks...
  8. Hi, I have such a structure in my template folder (ProcessWire 3.0.58): main.php // the template file views/ views/snippets/ In the main.php I include a php-file from the "views"-folder. In this included file are sometimes also files from the "snippets"-folder included. So far, so good:-) But sometimes, after changing und saving a file in the "snippets"-folder, the following error occurs: Fatal error: Call to undefined function wire() in /site/assets/cache/FileCompiler/views/snippets/the_included_file.snippet.php on line 3 But there ist no wrong code. Also changing the file (for example comment out the complete code) does'nt effect something, the error is still the same. Only the manually empty of the "caches"-table in the database fixes the problem and the code runs correctly again. Can someone help me with this? Thank You, regards Sebastian
  9. Ok, sorry - I've defined a button by the RuntimeMarkup module which opens the page by "". The page I open by this way has an own template and template file; there is the script located. Regards Sebastian PS: Now I use "pwModalWindow(...)" instead of ""; the only needed change in the script above is "top.opener" to "window.parent".
  10. In the page opened as a popup window (which shows the available properties as checkboxes). There are a save button and a close button; the close button executes the script above.
  11. Solved! The properties which can be added by the InputfieldPage have a hierachical structure (page with subpages with subpages and so on) - that's why I can't use checkboxes directly. But at last it was very easy to solve the problem:-) First step: In the PageListSelectMultiple element you can find a hidden list item with the class "itemTemplate". This element can be cloned, prepared with the new data (id, label) and apended to its parent element. Second step: In the PageListSelectMultiple element you can find an input element with the id "Inputfield_YOUR_FIELD_NAME"; its value hold the ID's of the selected pages as a comma separated string. This value must also be updated. That's all:-) Here are my script to do the steps above: // get the selected properties for my page via ajax $.post("my_ajax_file", {"page_id": "my_page_id"}, function(success){ if(success){ var json = JSON.parse(success); // create json from string var id_string = ""; // holds the id's for field value var ol = top.opener.document.getElementById("Inputfield_MY_FIELD_NAME_items"); // get the list with the selected page items $(ol).find("li").not("li.itemTemplate").remove(); // remove all items except the template item for(var i in json){ // loop through json elements var prop = json[i]; var li = $(ol).find("li.itemTemplate").first().clone(true); // get the template item and clone it li.removeClass("itemTemplate"); li.find("span.itemValue").text(prop['prop_id']); // set new id li.find("span.itemLabel").text(prop['prop_title']); // set new label $(ol).append(li); // append to parent element id_string+= prop['prop_id'] + ","; // add id to comma separated string } id_string = id_string.substr(0, id_string.length - 1); // remove last "," var input = top.opener.document.getElementById("Inputfield_MY_FIELD_NAME"); // get the field with the id string value $(input).val(id_string); // set the new/updated id's } });
  12. Thank you for the suggestion! The page in the popup is a normal page (the checkboxes are created via the API). I've had alllready in mind to reload the entire page, but if there are unsaved changes... The website is edited by several people - I always have to fear the worst;-). That's why I wan't to refresh only the one field.
  13. Hi, I'm wondering if it's possible to refresh an InputfieldPage element by javascript. Background: I use an InputfieldPage element (PageListSelectMultiple) to add properties to a page. Some pages have 20+ properties, so it's a long way and many clicks to add them. That's why I've created a page with an own template, which shows all properties at once as checkboxes. This page is opened as a popup and saves the selection of the properties for the current page. But when I close the popup, the InputfieldPage element of course not shows changes of the properties. Is there a way to refresh the InputfieldPage element from the popup by javascript, by example: top.opener.document.getElementById("MyInputfieldPageElement").refreshFunction... Thank you, sincerely Sebastian
  14. Thank You - that helps me.
  15. Hi, I'm wondering if it's possible to add a custom button or link to a backend template. Example: The orders of my online shop are saved as pages with the template "shop". Now it would be nice to have a button (or a link) in this template, which opens a page, which creates the invoice as PDF file. Is there a way to add such a button or link? Thank You, regards SebastianP