-
Posts
10,902 -
Joined
-
Last visited
-
Days Won
349
Everything posted by adrian
-
API to the rescue foreach(array("basic-page","home") as $tn) { //list your required templates out in the array $t = $templates->get($tn); $t->editRoles = array(1043); // where number is the ID of the role you want to assign $t->save(); }
-
Thanks kongondo - I had forgotten about that. Just to confirm - I tried your scenario @everfreecreative and it works perfectly with the role ID, eg: template=user, roles=1015
-
I have done something similar, but rather than email the client the uploaded resources, the email just contains a link to the automatically created PW page with the uploaded resources. Be sure to make the page unavailable to guest users. When they view this page they see a list of available resources, each with their own download link, as well as a zip download button which zips all the files on-the-fly into one downloadable zip. This way, the files are always available on the server, you are not emailing huge files, and you are not relying on a 3rd party service. Hope that helps a little!
-
I can confirm the same problem. It works fine if the roles part of the selector is not included - all users are displayed and selection of one and saving the page works fine. Doesn't help you I know, but maybe helps to narrow down the problem As a workaround for now, use this in the custom PHP code option instead: return $pages->get("name=users")->children("roles=broker"); PS Do you feel like submitting an Issue on Github about this?
-
Just an FYI if you're new to SVG in PW - take a look at ImageRasterizer. It comes in very handy if you want to provide fallback PNGs for older browsers, or you just want to rasterize really complex SVGs (that take too long to render) before displaying them on the site.
-
Thanks for the file. The problem is that your SVG doesn't have width and height attributes in the SVG tag. PW uses these to determine the size of the image. Not sure how best to deal with missing attributes, but I'll have a think and chat with Ryan. In the meantime, if you add: width="1200px" height="500px" to the SVG tag in the file, you'll find that it uploads just fine. BTW, I am assuming you are familiar with SVG and know that they are easily editable with a text editor - and if not, now you know EDIT: Github issue submitted: https://github.com/ryancramerdesign/ProcessWire/issues/802
-
That version should be fine. Would you mind attaching the image so I can test. Or PM it to me if you'd prefer.
-
SVGs definitely work and actually don't need to be resized by GD for the thumbnail. What version of PW are you running? There was a issue with SVGs for a while, but it is fixed now. Just for interest, here is the Github issue that describes when things broke and were subsequently fixed and improved: https://github.com/ryancramerdesign/ProcessWire/issues/597
-
Or, depending on your needs, you could try out Page Protector This way your editors can control the access, via the page's Settings tab.
-
Hey horst - looks awesome, but I am running php 5.3.28 on my dev server (just to pick up on things like this) and get a parse error due to: InputfieldRangeSlider::getModuleInfo()['version'] on line 345 Something like this takes care of it: if($modules->isInstalled('InputfieldRangeSlider')) $rangeSliderInfo = InputfieldRangeSlider::getModuleInfo(); $hasSlider = $modules->isInstalled('InputfieldRangeSlider') && version_compare($rangeSliderInfo['version'], '1.0.4', '>='); One minor typo while I think of it: here you can set sitewide options, - this overrides the options from site/config.php This is under the main config and also the advances section. As well as the missing "s", probably also don't need the comma and the hyphen.
-
Hi everyone, Finally made some time to get the new module live. It is called Page Protector and you can find out more about it here: https://processwire.com/talk/topic/8387-page-protector/ Thanks to everyone who voted in the poll - based on the results, there will be two separate modules maintained: ProtectedMode and PageProtector. PageProtector can do everything that ProtectedMode can, so if you have a need for the features of PageProtector on a site, then there is no need to use ProtectedMode during development.
-
This module allows you and your site editors to protect a page (and optionally its children, grandchildren etc) from guest access directly from the page's Settings tab. You can also limit access to certain roles. http://modules.processwire.com/modules/page-protector/ https://github.com/adrianbj/PageProtector It makes it very easy for editors to set up various password protected areas on their site, or to simply protect a new page or section while they are still working on it. Ability for your site editors to control the user access to pages directly from Settings tab of each page Include whether to protect all children of this page or not Optionally allow access to only specified roles Option to protect all hidden pages (and optionally their children) Ability to change the message on the login page to make it specific to this page Option to have login form and prohibited message injected into a custom template Access to the "Protect this Page" settings panel is controlled by the "page-edit-protected" permission Table in the module config settings that lists the details all of the protected pages Shortcut to protect entire site with one click In addition to the admin interface, you can also set protection settings via the API: // all optional, except "page_protected", which must be set to true/false // if setting it to false, the other options are not relevant $options = array( "page_protected" => true, "children_protected" => true, "allowed_roles" => array("role1", "role2"), "message_override" => "My custom login message", "prohibited_message" => "My custom prohibited access message" ); $page->protect($options); As alway, I would love any feedback / suggestions for improvements. Hope you find it useful! Page Protection Settings (settings tab for each page) Module Config Settings
-
Not sure exactly what your needs are, but maybe take a look at Migrator - it might be able to do what you need in terms of adding newly developed features.
-
I wonder if owzim's new YAML fieldtype would be useful for this scenario also? Your approach might be simpler for non-tech users to understand and format though!
-
Is this the same as: https://github.com/ryancramerdesign/ProcessWire/issues/751 Sounds like it was fixed, but maybe only in the default theme and not Reno?
-
Hi Juergen - you can enter a Label for the template and that will be used instead of the template name.
-
Because it is within a php echo statement already, this will work: <img src="{$config->urls->site}assets/images/IcoMoon/Icons/SVG/globe.svg" class="logo"> To expand on owzim's comments, I try to avoid escaping double quotes. Use a mix of single/double quotes to make it cleaner. So you could have: echo '<img src="'.$config->urls->site.'assets/images/IcoMoon/Icons/SVG/globe.svg" class="logo">'; or: echo "<img src='{$config->urls->site}assets/images/IcoMoon/Icons/SVG/globe.svg' class='logo'>";
-
How to implement a multi-step installation process?
adrian replied to owzim's topic in Module/Plugin Development
It's not quite what you are looking for, but I think kongondo's blog module doesn't set up any fields/templates until certain module settings have been configured by the user. That might be the best available option I think. -
I have been delving into the world of node and MEAN lately and haven't found anything to compare to PW for content management. The only things I have really come across are: CMS https://pencilblue.org/ http://keystonejs.com/ User management http://everyauth.com/ http://passportjs.org/ http://jedireza.github.io/drywall/ Not much help I know. Have you thought about using PW as a web service to provide content to your MEAN app? or perhaps a module that duplicates content to a mongo db when a page is saved in the PW admin? I'll probably be thinking about this more over the next few months, so I'll try to remember to post any ideas here.
-
Adding image or file field to a module configuration
adrian replied to Hari KT's topic in General Support
You may also find that you need to call getDatabaseSchema($field) to make sure the DB table is updated to include the extra required fields for image and file fields. One additional thing I noticed is that even though this is supposed to take care of adding the tags field, it doesn't seem to work, so I also do the following if I need the tags field added: $sql = "ALTER TABLE `field_imaged` ADD `tags` TEXT NOT NULL"; $query = $this->wire('database')->prepare($sql); $query->execute(); -
Adding image or file field to a module configuration
adrian replied to Hari KT's topic in General Support
Not sure it is the only problem, but try FieldtypeImage, rather InputfieldImage. EDIT: What soma said -
I just updated to 2.5.8 and see the same issue. I have been away a couple of weeks - maybe I missed something about these changes, or maybe it is a bug. Hopefully this will bump this post and get some more input.
-
It might be possible to cache the tiles, but from a little reading, it sounds like that would be against the TOS: https://groups.google.com/forum/#!topic/google-maps-js-api-v3/sALpJq12HjQ It might be easier if you were using the google static maps API: https://developers.google.com/maps/documentation/staticmaps/ although this still might not be allowed (I haven't checked).