Search the Community

Showing results for tags 'admin'.

More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Found 158 results

  1. Hi Everyone I have a problem here. I have built a site with Processwire on localhost and then transferred to my customer's server. a) it's a windows server (unfortunately) and b) there is a domain-mapping for this site, the domain points to a folder of another domain. Sorry, I can't explain it any better, I don't really understand the different types of servers (why do they have to be different anyway...). My problem is, that I see the main website but not the admin page. Do I have to add anything to my .htaccess file? I also tried to include web.config file. Not .htaccess nor web.config file have an impact when changing its content. I really have no clue what to do!! Links:, Thanks for any pointing in the right direction!
  2. Hello, Does anyone know whether the is a place detailing the structure your admin theme should take when creating one? e.g. I see UiKit, Reno and Default admin themes all have default.php, init.php, controller.php files, is this a stylisitic choice or a prerequisite for any admin theme module? Thanks!
  3. Hello, This is my first post here, I've been using processwire for a while now and having a great time with it! Quick question regarding the Pages field: I am using a multiple-select pages field on the User template, so that a dealer can be associated with each user of certain roles. This works flawlessly without any conditions being set, but if I set 'Show this field only if' to roles=dealer|dealer-admin the field shows and hides as desired, but revert to null when saved. Is there anything I'm missing here? Thanks, Tom
  4. Hello! I have a very special Processwire Setup. Short: We use Processwire for our "Blog", which is embedded in an SAP Hybris Webshop. PW provedes the Contnet via HTML and Hybris render this HTML into the Webshop (Between Default Header, Navigation and Footer) The URLs which are created in PW are the URLs for the local HTML e.g.: If some Editor creates an article, he want to see the preview in the real webshop embedded. This URL would be: http://www.webshop.coom/en/blog/news/some-article Where and how can I create a Module which overwrites the URL with the correct one in the Admin-Area?
  5. Hello, I'm getting a JS error in the admin backend when editing pages with template basic-page as non superuser: TypeError: a.ProcessPageList is not a function in InputfieldPageListSelect.min.js Investigating the JS, I found that the ProcessPageList function is not available on the page when I am logged in as a non superuser. The function is defined in /wire/modules/Process/ProcessPageList/ProcessPageList.min.js which is not loaded when logged in as non superuser. When logged in as a superuser, the file gets loaded. I have no fancy permission settings for that template for the role admin that the non superuser belongs to: This started happening on a site that is in development but online for some time now. I can't say which actions might have caused this. But it is a consistent error only for this one template. The site is running on 3.0.42 EDIT: The inputfield triggering the error is an image field (in fact there are 2 of them in that template) Any pointers to potential causes for this problem would be much appreciated. EDIT: The problem is not related to any file changes. When I run the same install with a DB backup, the error disappears. So it must be something that has changed in the DB. Trying to diff the DB dumps and see if I can find anything suspicious
  6. When a PageTable field in a specific template is being edited I need to know the Page that contains the PageTable so I can fill in hidden fields in the PageTable. I can capture the page being edited via: // $this->addHookBefore('ProcessPageEdit::execute', ... public function pageEditExecuteBefore(HookEvent $e) { $p = $e->object->getPage(); if ($p->template !== 'rtw-product') return; // $p is the page being edited } I can intercept PageTable entry being saved: // $this->addHookBefore('Pages::save' public function savePageBefore (HookEvent $e) { $p = $this->wire('page')->id; $page = $e->arguments('page'); $obj = $e->object; $name = $page->name; // page name of PageTable page $template = $page->template->name; // template of PageTable page $parent = $page->parent->name; // parent directory for PageTable items What I am trying to find is the page in which the PageTable field is located. I've also tried having pageEditExecuteBefore() saving $p in $this->context and then accessing that in savePageBefore() but it's a different instance of the class because $this->context is null when it gets to savePageBefore(). I could save the page ID in session, but that seems error prone. Does anyone know how to achieve this?
  7. I have to languages - english and russian. I need russian language to be set as default for admin panel. How to do it? Thanks!
  8. Hello! How can I add custom Content to the Admin Theme Footer or Header? Is this possible with a hook? I want also to can upgrade easy and don't touch core files...
  9. Posting in the hope this helps someone out of a hole! Having built 20+ sites on PW in the last couple of years (and loving it...) I came across a really odd situation recently. The client's IT company and I 've been battling for a couple of weeks and today, finally, we have an answer! The site is built and temporarily housed on a shared hosting account we have for development. All tested well here so Access was granted to the client to start adding content. The next day I get a call from the client to say the admin side of the site is logging them out every 30-40 seconds and they have to log back in again each time to continue. I tested again from our office with their login but all worked as expected. Other browsers, PCs etc. were all tried by the client but the problem persisted. So, I get in my car and drive to the client's site. Sure enough, I see the issue on one of their iMacs. So I open up my MBP, connect to their network, log in as them and the problem is there. So, next, I came off of their network and onto my tethered iPhone on 4G. Bingo! The problem goes away. So it's their network that's the issue. Their IT company were called and, with us helping them wherever possible, they worked on it for 2 weeks to find the problem. I captured the port numbers in use by PW admin (60992, 60993, 61000, 61001, 61002, 61003 by the way) and the IT company opened those ports on the router but still, the problem remained :-( And then the breakthrough... They have two VDSL lines into the building that feed their router through a load balancer. It seems that their setup meant that responses to outbound traffic did not necessarily come back in via the same line. Processwire admin does not like this! So, the IT company put in a rule to direct all traffic from the IP of the shared hosting through the same route in and out of the building and BOOM! it all works as expected. Phew! All's well that end's well but it certainly put us through the wringer tracking it down. Actually, I think it's pretty cool that PW does this. A good extra security measure. Several other CMSs (no names...) worked just fine with this scenario but not PW. Anyway, happy client, happy me. Hopefully, this story helps someone else here too.
  10. Micro Contexts (aka field value contexts) Change any context-enabled setting in your page editor/template based on the value of a page reference field. Why use this? Say you have a template that is controlling some generic part of your website, like a section on the homepage, a widget, or an item in a media library. If you are using the various fields on this template in different ways depending on an option (page select) such as 'widget_type', 'media_type', etc, you can hot-switch the template context based on the field's value. Why not use template, like just change the template? Unfortunately, most of my clients would probably break down in tears if i tried to explain what a template is, or how to change it. This also allows you to have better more relevant labels, descriptions and notes based on any page ref field value on your template, as well as be able to show/hide fields based on that value, or even move fields around to make some more prominent or visible. How to use this 1.) Create a new template: 1a) Use the following name structure: mc-[field_name]-[field_value]-[any_memo_here] where [field_name] is the field that will control the micro context, and the [field_value] is the required value (page id) that the controller field must equal/have in order to trigger the virtual template context. The last part of the template name should be used for the page name, or some memo to make it easier to know from the templates list what field value will trigger the micro context, since the template name does require the ID value of the field, not the name. 1b) Make sure to specify the template you are contextualizing under "Duplicate fields used by another template" before clicking save! 1c) Edit your field settings for this template, for when your fieldname=value as specified in the template name (labels, descriptions, notes, visibility, field order etc.) 2.) Place this code in your ready.php file: wire()->addHookAfter('ProcessPageEdit::loadPage', null, function (HookEvent $e) { $page = $e->return; $mcPlates = $this->wire('templates')->find("name^=mc-"); if(!count($mcPlates)) return; foreach($mcPlates as $mcPlate) { $nameParts = explode('-', $mcPlate->name); // expected format: mc-[field_name]-[page-id]-[anything-you-want-here] $mc_field = $nameParts[1]; // the field controlling the micro context $mc_value = $nameParts[2]; // page id has to be the 3rd part of the template name $controllerField = $page->fields->get($mc_field); //if we find a matching controller field from the template name... if($controllerField) { $f_value = $page->get($controllerField->name); $proceed = false; if( ($f_value instanceof PageArray) || ($f_value instanceof Page) ) $proceed = true; // this only works with page reference fields. if(!$proceed) continue; // the page corresponding to the required value (page id) specified in the mc template name, to change micro context $mc_page = wire('pages')->get((int) $mc_value); // if the value specified in the mc template name matches the current value of the page reference field, change the // fieldgroup context $proceed = false; if( $f_value instanceof PageArray && $f_value->has($mc_page) ) $proceed = true; if( $f_value instanceof Page && $f_value == $mc_page ) $proceed = true; if($proceed) { $tName = $mcPlate->name; $mc_template = wire('templates')->find("name=$tName")->first(); if($mc_template) { $mc_fieldgroup = $mc_template->fieldgroup; $page->template->fieldgroup = $mc_fieldgroup; } } } } }); Caveats This probably needs more work to be fully usable, and may need more bullet proofing in terms of checking for valid template name, etc. You can only have this work with 1 page reference field per template. This has been tested and is being used on at least 2 live sites, but caution should be used, and the functionality should be tested before using on a live site. Screenshots: 1) a default widget with no field value context enabled fields 2.) A field value context enabled edit page for the 'Widget Type', the template controlling this is now 'mc-widget_type-1054-text', but the template of the page stays as 'widget'; only the fieldgroup context is changed when the page is loaded to get the contextual settings: 3.) the context for when the page reference field called 'widget_type' has the value of 1150, which is a video widget type (template name is 'mc-widget_type-1150-video'). Convenient Module edition coming soon!
  11. When I delete a page name, e.g, /cart/, using the admin interface it goes into trash and gets the name /trash/2573.1.11_cart/ . I see that, with the Pages::trashed hook that the previous page name (previousPage) can be accessed. Where can I more information about what happens when a page is put into trash and what the name means?
  12. Hey Guys! Im new to PW and am working on a website built on PW. Im trying to understand how sessions work in PW. Specifically what exactly is happening when session expires. The thing is that my client wants to be redirected to homepage whenever session expires, so basically he doesnt want to be redirected to admin login page when he's in the admin environment of PW(he doesnt want his clients to see the admin login page for whatever reason). Is it possible to hook to the session expiration and redirect to a specific url? And what is the correct way to do it in PW? I would appreciate the help! Cheers!
  13. I'd really like Processwire to have a robust page based permissions system rather than just template based out of the box. If the page tree is compared to a file system, it would be nice to be able to set owner (user), group (role) and public permissions on a page and have this propagate to sub-pages unless explicitly over-ridden. With a large site, it's quite possible to have multiple sections that use the same templates, but where editing needs to be assigned to different people, for different parts of a site. I've seen some proofs of concept that have never been updated or maintained, so I'm sure it can be done, but this is a bit of a show-stopper for me with an otherwise excellent CMS. I might be able to have a go at something myself, but since this is security related, and I haven't had a go at module development before, it would be really handy to have something robust that just works.
  14. I have a PW page that is about 2 - 3 Years old . After an upgrade to Version 2.6 all Pages and modules where gone in Admin backend. As i had no time to look after the page i left it like it was for quite a while. Now that i needed to get the Page online again i searched whith google anf fount that i should upgrade the page to PW 2.7.3 As the Upgrade to 2.6 was done in a hurry , its perfectly possible that i accidentallly upgraded from 2.0 to 2.6. Please have a look at the images to see the desaster in full color ....
  15. Weirdest thing just happened to me. I updated blank site from 3.0.42 to 3.0.61 then started adding fields. I have two instances of FieldsetOpen areas in the template, and a few CKEditor textareas (both inside those fieldsets and outside). I added an image field to the template and placed it near the top of the template fields. Once I did that I was unable to toggle either Fieldset, and the CKEditor stopped working. When I moved the image field to the bottom of the template fields, the CKEditor loaded, but the fieldsets still wouldn't toggle. When I deleted the image field, the editor and toggle return to normal. (Adding a new image field re-introduces the issues.) I've tried adjusting the settings on the image field but the result is the same - even with all default settings. I tried adding an image field to a different template - same result. What am I missing here?
  16. Hi All, I was playing around with the settings for various templates as I had created a new role and have inadvertantly locked myself out. I changed some of the settings on the Admin template, so I assume this is what has caused the lock out. I have direct access to the database but I have no idea what I would need to change in it to regain access. Probably also worth mentioning that all the existing pages are still accessible, but /processwire throws a 404.
  17. Do any experts have experience with the level of stability and/or support for turning on $config->advanced? I ask because of the warning at the bottom of the System tab "Please note that all of these system settings are intended for ProcessWire system development (not site development). Use them at your own risk." It provides two facilities that are invaluable to me (maybe because I don't know how to do them any other way). 1) Disable Settings Tab on a per template basis 2) Page Class Name - this makes it tweak a page while relying on the underlying Page class for the majority of functions. Are others using this setting in production? Have you used it over an extended time and seen that it is not changed often or at all?
  18. How can I check if the user is in the admin enviroment of processwire? At the moment I'm using some buggy url check but I figure that there must be something in processwire itself to check for that. I don't want to check if the user has administrator privileges, just if the user is visiting an admin url. Because the admin url can be changed from the admin panel I don't want to check on something hard coded as well. What is the best way to check for an admin page?
  19. Hi all, I'm creating a website for a magazine publisher. This will include a supplier section with press releases attached to company profiles. The idea is that companies can register and manage their profile and press releases (CRUD) via a dashboard. The dashboard is a Process module. Ben Byford's RedirectAdminPages module is being used to lock out the rest of the backend, with a few modifications. The following code should redirect every admin page to the dashboard page but still allowing logging out. However logging out just redirects to the dashboard page: // do not redirect if page matches: if($this->page->template != "admin" // any non-admin page || $this->page->is($this->redirectPage) // the dashboard page (prevent infinite loop) || $this->page->parent->is('/admin/login/') // various attempts to allow logging out || $this->wire("process") == 'ProcessLogin' || strpos($this->page->url, $this->wire('config')->urls->admin . 'login/logout') !== false ) { return; } // find roles set in module configuration and create array $roles = explode(',', $this->userRoles); // for each user in module config check to see if current user foreach ($roles as $key => $val) { // get a role from the roles array $roles[$key] = trim($roles[$key]); // if current user found with role then redirect if($this->user->hasRole($roles[$key])){ // redirect session to page stored in config $this->session->redirect($this->redirectPage); // code should never get here but this is a simple fallback break; } } } } I'm surprised that this URL matching doesn't work: || strpos($this->page->url, $this->wire('config')->urls->admin . 'login/logout') !== false Because this does work for allowing page edit: || strpos($this->page->url, $this->wire('config')->urls->admin . 'page/edit') !== false Any ideas? That issue aside, as a learning process I'm going to re-implement the dashboard as front-end pages. I guess that the advantage of using the ProcessWire back-end is most of the functionality is already there, you don't need to create forms and handle the processing, create / import css etc. So it'll be interesting to see how much of a difference this makes, and how much control each approach provides. I'd love to have some thoughts and feedback from those of you who've tried both methods? PS this will be my third website created with ProcessWire and it's already been a lot of fun, and as a CMS it 'just feels right', so a big thanks to Ryan and everyone who has contributed. Thanks
  20. I have a module here that I am using to create an image field like so: $mf[] = [[ 'tags' => $tag, 'name' => $pre.'logo', 'type' => wire('modules')->get('FieldtypeImage'), ],[ 'label' => 'Logo', 'columnWidth' => 50, 'inputfieldClass' => 'InputfieldImage', ]]; Yet upon its creation, initially, when I try creating a page of a template including it, it says that the field must first be configured. Once I go and save the field as-is, everything's honkey dory. It's just an annoyance, with every image field. I figured it would be the required inputfieldClass field field, but as you can see, that's included up in there, and it's still not good to go off the bat. Any clue as to why?
  21. Hello Community, I have read that I get no support on GitHub. For this reason I am here for the second time. The thing is that I enabled a fresh Processwire installation and under no page is found. The admin login is thus not possible. How can I fix the problem? Thanks in advance, Alexander
  22. Hi all, I have created a new admin page which just lists some form submission details, it works as expected so I'm pretty happy with it. The only thing I can't figure out is how to now add a new tab which links to this custom page. From what I have read it seems like most people do this by including it as part of a module, I would like to avoid creating this a page as a module as it is specific to this website and has no reusability. However I am yet to find any documentation stating whether this is even possible without going down the module route. Any help would be much appreciated.
  23. Hi folks, Quick one. Is it possible to add a favicon to the admin/CMS area? Without messing with anything core? Thanks, R
  24. Hey All. I need some help with a problem relating to users permissions to create pages and selectively remove a "new" button. I have a container page called "Sektionen" to keep Sektions of pages. These sections are created within different pages via a pagetable field. Now I want to change the way new sections can be created in a way that they can ONLY be created via the pagetable-field, not via the "new" button in the pages tree (see screenshot - this button should be removed). I think I can not change this in the templates settings and wanted to ask if anybody of you has an idea how to accomplish that? Thanks a lot!
  25. Hi! Upgraded my development environment from 2.x to 3.x and everything works fine there, so I continued with copying my development site (files) and database to my production environment and suddenly Pages and Modules are not showing up (see screenshot). After clicking around a bit, suddenly it worked and pages and modules appeared. But after logging out and in again, the issue had returned. I tested with different browsers and cleared my cache and cookies, but that didn't help. What could be causing this, what should I look for? Thanks in advance, Jasper