Recently Browsing 0 members
No registered users viewing this page.
I have one central website, with membership registration and content etc., and then several related websites with their own URL/domains, each on Processwire, all on the same server.
I would like to access the database of the central website from the sister websites. How would I do that?
You can't bootstrap one PW installation into another. You can include template parts from one in the other by just using the server path, but whatever you try to get/post just comes/goes to the database of the site you are on.
Could you switch databases by including the config.php from another PW installation somewhere?
What is the correct, secure way to do this?
By Clément Lambelet
I'm really new to ProcessWire, maybe I missed the solution in the documentation.
I'm working on a site which involves a lot of image upload fields, and I'm always getting many timeout errors. I'm pretty sure it's because I generate too many variations on a single page load (around 20 images with 7 different sizes, for them to be responsive).
I can't use ImageSizerEngineIMagick to help (my host doesn't support it).
I was wondering if there was a way to hook to the process of client-side image resizing (https://processwire.com/blog/posts/processwire-3.0.63-adds-client-side-image-resizing/) to generate the different variations (as it seems really faster). If not, is there a way to generate the different variations on upload and not on page load ?
Any ideas and suggestions are welcome!
Unfortunately I came across another problem.
I have a "regular" ProcessWire setup and want to create a separate php script. That script should be executed by a cron job and is bootstrapped with my PW setup. Main goal is to send mails which are stored in a email field.
My problem: I want to access a specific field from a template where only specific users have access to. Right now, the cron job is executed as "guest", of course.
How can I bypass this restriction, so that I have access to that specific field (it's only one email field)?
Does it make sense to set current user via api?
Hope you can help me out there.
I am using ProcessWire as the back-end to manage contents on multiple sites (I call them "sub-domains"). I use ProcessWire as an editing system and database only. The ProcessWire templating system is not in use. I want to use ProcessWire's API and in particular the Include & Bootstrap method to output contents -- pretty much in the same way you do, if contents is stored in a MySQL database and output in PHP files that use PDO to load data.
The issue is that I cannot get ProcessWire to fully work on each of the "sub-domains".
> You can do anything with ProcessWire's API that you can do from a template,
> so all of this still applies, as does everything in the developer API.
How can I get access to variables such as $input when using Include & Bootstrap?
I tried these:
$wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input->urlSegment1; # Returns null $wire->pages->get("/foo/bar/"); echo "Segment1: " . $wire->input()->urlSegment1; # Internal Server Error $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input->urlSegment1; # Returns null $p = $wire->pages->get("/foo/bar/"); echo "Segment1: " . $p->input()->urlSegment1; # Returns null @ryan Can the API Variables documentation be updated with a section / an example that explain how to use "Include & Bootstrap" for each variable (since this is a really strong feature in ProcessWire)?
$page $pages - Example: $homepage = $wire->pages->get("/"); $input $sanitizer $session $fields $user $log $templates $config
Here's a mixin I put together for creating hamburger icons.
It utilizes the checkbox hack so you can use CSS only to show a mobile menu (or off-canvas menu, etc).
Unlike other mixins here you can specify a selector for the label tag if it's not directly below the checkbox, so the label (the icon) can be placed anywhere in the DOM.
There is also a "hamburger_tint" helper mixin included to easily colorize the icon/text on hover or in a checked state.
width: the width of the icon. default: 32px thickness: the thickness of the bars. default: 3px gap: the vertical space between the bars. Overall height is: thickness*3 + gap*2. default: 7px color: the color of the icons. default: #000 (black) radius: border-radius value to round edges. default: 0 anim: seconds of animation duration (transition-duration) or timing function + duration (eg. "ease-out 0.3s"). Use -1 to disable morphing to an "X". default:0.25s labelselector: in case the label is not right after the checkbox, use this setting to tell the mixin where to find it. Eg. "~ div.content header nav label". default: "+ label" padding: extra spacing around the icon. default: 0 text: show text next to the icon, by default on the right. Values: "left" or false to disable. Requires an extra "span" tag. default: "right" CodePen demo