Leaderboard
Popular Content
Showing content with the highest reputation on 12/11/2015 in all areas
-
ALIF - Admin Links In Frontend EDIT: latest version update with PHP 8 fixes on 05. Nov 2023 (!) The version now is 1.1.9 (!) This module combines some of the admin links that we want to use on the frontpages sometimes. It is a comfortable and easy way to do so. After you have installed and configured the module, you can inject the links into the frontpage with code like this in a template file: echo $modules->isInstalled('AdminLinksInFrontend') ? $modules->get('AdminLinksInFrontend')->render() : ''; . Credits: The comfortable Javascript Color Picker in the Configpage comes from Jan Odvarko (http://jscolor.com). Many thanks for this! * Toolbar The toolbar can be positioned by css values for top/bottom and left/right. It can expand in vertical or horizontal direction. The buttons are links to the PW admin, for logout, or for editing the page in admin, or informational ones. All settings, including the colors, can be defined in the modules config page. This is available for all PW versions from PW 2.3 up to now. Depending on how you configure this part, it can be used for authors and editors too, maybe. * Import / Export Settings It has the possibility to export and import its settings via two textarea fields. When importing settings, you get a second screen where you can select which settings you want to import. * One-click User Account Switcher For PW versions 2.6.8+, there is one really nice function available, that I use when developing / testing sites with different user / roles. A fast User-Account-Switcher that lets you view the same page from different user accounts with only one click. To enter this mode, you need to login as a superuser one time, and the feature needs to be enabled in the module of course. After that, you can log out, login with different user roles, etc. At least the toolbar buttons for the User-Account-Switcher will stay visible for you. This is session based. There is also an extra button with a trash can and the text "Session", that helps you to leave this mode once you are finished. As you can see in the screenshot, after clicking "guest", I was logged out, but a regular login button, a warning for debug mode and my three defined buttons for user accounts are available. When clicking another user button I login with this account. Very handy. ATTENTION! The use of the One-click User Account Switcher is mainly intended for dev sites, not for public sites! You should be aware that there is a huge security risc when using this feature on public reachable sites! We completly leave ProcessWires comfort zone in regard of security, - and the only thing between your site and potentially hackattacks is this module. (Oh mom, - what have I done?) PW 2.6.8+ has a comfortable function for admin tasks, that let us log into different user accounts via API without using passwords. This module uses this function! All data that is needed during a User Account Switcher session is stored in the session data on the server. So, if someone steel your session cookie, there is potentially risc that he can login as a superuser, depending of the user account buttons you have in your admin links collection! To prevent SessionHijacking, the module can be bound to a single IP address, it uses a fingerprint depending of IP(s) and UserAgent string. And you need to define a max time to live in minutes between 2 and 60, a User Account Switcher session may run. A User Account Switcher session only can be initialized by a Superuser who also explicitly has set a permission called 'alif-user-account-switcher', what is defined by the module, when installing it. So, the prefered way to use this module is, to enable and use the User Account Switcher while the site is unpublic, and before it goes public, remove the permission from the superuser role. This way, you can use its menu function, but not the UAS anymore. On a sidenote, for those rare cases where multiple superusers simultaneous developing on a site and want to use the ALIF, but the UAS should be used only by one, you can leave the 'alif-user-account-switcher' permission removed from the superuser role, but need to assign the role 'alif-superuser' to the single user account. This way, only that single superuser has the permission for UAS, whereas all other superusers doesn't have it. . . * The Configpage * Online demo I have pasted it into this old site and enabled it to be present every time (when the site is in demo mode only!). So, it is an earlier state, but the switcher is functional there: http://pwlaf.biriba.de/dbinfo/ * Download From our modules directory or from github repo8 points
-
2 points
-
Represents the instagram feed of a user. Instructions: Register a new instagram Client: at instagram. It's really important to add the current url as redirect url. (For example "http://page.dev/processwire/module/edit?name=InstagramFeed/"). Complete module settings (Client ID and Secret), leaving the access input token field empty. This value will be generated. Click the "get Access Token" link to generate code and access token in module settings. Configure username to output feed from (default setting is "self": to get the most recent media published by the owner of the access token) ... and use it! > detailed instructions at github1 point
-
Is there any possibility getting Klarna Checkout to work with this? https://developers.klarna.com/en/no+php/kco-v2/checkout How much work is it to implement?1 point
-
Ok- I found the issue. When you preview a site in Plesk, you can choose a preview URL for the website which generates a kind of URL as follows website-space.com.XX-XXX-XXX-XX.preview-url.com XX etc is the server IP address. My problem was caused because the preview-url.com had some DNS issues and a .htaccess error too. Thanks for the ideas guys. Looking forward now to a strong coffee and several hours redesigning this thing!1 point
-
1 point
-
It's might be true that images are slowing down the site, but 2.5 s and more time to first byte is definitely not an image issue.1 point
-
The most obvious hook would be after ProcessPageEdit::loadPage, which does load the page, which will be edited or if you also want to manipulate the form itself ProcessPageEdit::buildForm. $wire->addHookAfter('ProcessPageEdit::loadPage', null, function(HookEvent $event){ $page = $event->return; // loadPage() does return the page }); // or $wire->addHookAfter('ProcessPageEdit::buildForm', null, function(HookEvent $event){ $process = $event->object; // get the ProcessPageEdit instance $page = $process->getPage(); // Method in the ProcessPageEdit module to get the edited page (not global) $form = $event->return; // buildForm() does return the form });1 point
-
The pageimages class is actually keyed by filename, so this is the expected behaviour. To remove the keys and get numbered indexes just use $page->logos->getArray()1 point
-
No. This is just a quick fix and Ryan's implementation will most likely be better than mine . You might want to better draw his attention to your request though via GitHub, and if you wish, point him to this quick fix.1 point
-
I'd suggest updating one version at a time just by replacing the wire folder and the index.php. Then go to the admin, do a module refresh and on to the next version. Also 2.4 should be able to run ProcessUpgrade if I remember correctly.1 point
-
Yes, I have always been very good at telling people where to go. Not ever done it via an admin address though....1 point
-
Yes, Dave is right and that sounds like a performance issue - not so much with ProcessWire perhaps but with the server not loading resources. I have had that once or twice on shared servers when there has been a heavy load on the server (not my site specifically). Interestingly, I had a particularly bad day a few weeks ago when someone else on the shared server was being attacked, but it was interesting to compare systems. My PW sites were as slow as hell, but were just about hanging in there. However, my one remaining WP site was on its knees crying for mercy!1 point
-
Actually, perhaps Processwire should come with optional pages for wp-admin and a couple of other WordPress standards that are nicely written and polite. "Should have chosen Processwire."1 point
-
1 point
-
Wow! Your real face is as pixelated as the avatar (judging by the photo). But it will only provide more trust to someone speaking 'bout our more-and-more-digital future . I would come if I had any futuristic means to transport my presence over 2500 km cheap enough.1 point
-
Yeah, got split up somewhere in the middle. It's more about multi-folder - multi-domain - single wire folder.1 point
-
You should use markupCache module instead and cache only parts of your output. So your code might be something like that: <?php $cache = $modules->get("MarkupCache"); switch($session->typeOfVisitor) { case "lucky": if(!$data = $cache->get("lucky")) { $data = "You are lucky"; // Here you would actually get the real output... $data->save($data); } echo $data; break; case "unlucky": if(!$data = $cache->get("unlucky")) { $data = "You are unlucky"; // Here you would actually get the real output... $data->save($data); } echo $data; break; }1 point