Leaderboard
Popular Content
Showing content with the highest reputation on 03/23/2016 in all areas
-
Here's my Norwegian language pack for ProcessWire. I've been adding translations gradually since 2015. By November 2020 the translations are completed, and up to date with the latest dev version of ProcessWire. For details, go to the ProcessWire Modules page … https://modules.processwire.com/modules/norwegian/ … and/or GitHub – please "star" the repo ⭐️ https://github.com/snobjorn/processwire-norwegian-language-pack-nb-no Status: Completed / up to date. Third party and PRO module translations have moved to another repository (see the complete list at GitHub? https://github.com/snobjorn/processwire-modules-norwegian-language-pack-nb-no8 points
-
I think you can just recreate it. Add a new child to admin with the title "Login" and for Process, choose "ProcessLogin" and hen hide it in the setting. See if that works. Never done it myself4 points
-
How can the problem be pocket-grid? All it does is give you a width; nothing else. You can override its default 100% widths and give an element a 20% width, or 75% or 33.33333% or whatever....but you know this. So, width has nothing (much) to do with this. What you want to focus on is positioning and that's your custom CSS Do you have a graphic/drawing we can look at (btw, I am the last guy you should be taking CSS advice from - it's my weakest link! - but I stand by what I've said so far.. )3 points
-
Just like you're comparing it for the login: hash the "current password" and compare it with the database entry. But pw does have you covered: $user->pass->matches($inputPass);2 points
-
@AndZyk I don't think that's a good idea, at least not the first solution I would go for. There's a very good reason PW blocks execution of 'foreign' .php files in that folder. I don't know about the lcmini.php script but I would first consider the following: Convert it to a template file Use an include from within a template file2 points
-
@pwired, I didn't hear you apologising to pocket-grid . Glad you sorted it out .2 points
-
Aah, I see. If you need to use the template file of the child pages, have a look at this long thread. @jonathan's post may be of special interest in your case. You do not need to use the redirect module for such a simple redirect. For such you use $session->redirect('url') like I indicated . Have a read here about the session variable.2 points
-
just to reiterate @Kongondo - Stop fighting other peoples code and do a little CSS I've literally never used any grid system as when need one I just write a little css and BOOM.2 points
-
2 points
-
Ok, 2.7.2 is older then say November last year, as a normal update doesn't alter the data base, and thus doesn't clean your settings it is still there, you can ignore it or remove it from the JSON object for import purposes.2 points
-
In the admin area, in the page tree, under "Admin", is there still a child-page called "login"?2 points
-
Maybe helpful? http://stackoverflow.com/questions/12609110/responsive-css-background-images Maybe some other (non-pocket-grid) nested div within div#top?2 points
-
2 points
-
@bernhard actually this is a long ongoing project which is already online. I am constantly implementing new features. But the project is hard to showcase because most of the stuff happens inside a frontend member-area which requires login. I have been planning to showcase this for some time now and I might go with screenshots. But ATM I do not have the capacities to document it thoroughly. Though this might happen at some point, I can't tell when. Anyways, feel free to use the code for the Survey Builder in the plunk that I linked to. I will implement that as a PW module for the project and will share that module once it is up and running.2 points
-
...and you tell him, that you will do the backend with processwire, what comes out is this: http://kreativan.net/blog/news/website-relaunch/2 points
-
A feature request here in the forums prompted me to shape a piece of code I had been tinkering with into a usable module. Template Parents What it does: The list of possible templates for new pages in ProcessWire is purely based on other templates in parent/child relationships managed in the involved templates' family settings. This is most often okay, but sometimes you want to limit creation of pages with a certain templates to individual spots in the page tree, and there's no clear parent/child relationship to go with. The initially quick solution would be to duplicate parent templates for the different spots, but then any change on one of these templates has to be made to the others too, which gets tedious and error prone. Template Parents adds an entry in the Setup menu where you can assign allowed parent pages to templates. These rules are enforced after the regular family settings have been executed, so it builds upon instead of replacing PW's built-in mechanism. There's also an option in ProcessTemplateParents' to enable inheritance, then entries in the Template Parents assignment are inherited down the page tree and also grant template permissions to children, grandchildren and so on. The module can be downloaded from the GitHub repository. It has been tested with PW 2.7 and 3.0.1 point
-
You are absolutely right, kongondo. My question was meant as a test to figure out, if the lcmini.php script is blocked by the .htaccess file. But your solutions are more secure.1 point
-
Actually, I had to reinstall MAMP Pro as I realised it was causing other issues. Unfortunately, I saw your post after I figured it out Marcus. (Could have saved me hours of pain). But thanks for the post. Definitely will come in handy for other users stumbling here,.1 point
-
It's not about the rel, but the parenthesis: https://processwire.com/api/selectors/#or-groups I just chose rel for "relationship", which is what you're dealing with.1 point
-
Ok thanks to the link from Kongondo I followed: http://www.outsidethebracket.com/responsive-web-design-fluid-background-images/ and found the solution there: use padding-bottom and give it the following percentage: (height/width x 100) In my case I have it now like this: div#top{ background-image:url(banner4.png); background-repeat: no-repeat; width:100%; padding-bottom: 26.2793%; background-size: cover; background-position:center; } Background picture is showing up correctly and all responsive now1 point
-
Thanks, arjen. I'm referring to the processwire.com blog, not my own install.1 point
-
parent is not a field in the traditional sense, but a native field and might therefore function a bit different. You could try: rel=(parent=$page), rel=(secondary_category=$page), …1 point
-
@jploch, It sounds like you have the same needs as @Christophe. I have been meaning to take care of this but haven't managed to get to it just yet. I am currently traveling (mostly vacation), so can't guarantee when I will get to this, but it would be good to get this done shortly and tune this up for official release in the modules directory.1 point
-
What version of ProcessWire are you using? That setting should not be in the field settings, and has been/should has been fixed end last year (removed). You could safely ignore send_templates as it's not used in import context.1 point
-
Hi Peter, There's various techniques to solve this: Don't give the template of team-member-1 (the child pages) a template file. And decide what to do when that URL is accessed Don't give 'guest' view access (in template file of the child pages) and tell PW what to do when those child pages are accessed - e.g. redirect to some URL In the template file of child pages, use $session-redirect('/some-url/') to redirect users to the parent page Etc...(aka - please search - this has been covered a lot in the forums)1 point
-
Seems like for that specific hook admin.php is called to late in the bootstrap process. But other than the timing there's no disadvantage in using admin.php to hold admin related hooks.1 point
-
As I’m getting a bit more into the e-commerce idea I was talking about in one of the other threads, I have been thinking about the PW template system. In a shop system you’d need a kind of basic product template with certain necessary fields like default price or something like that. But you’d also need the possibility to have variations of a product template, where additional fields can be defined individually for a certain kind of product. I know that there is the possibility to clone fields from an existing template. But I don’t think, that is a good solution for this particular problem, as you were able to delete some of the basic product data fields. So my thought was, that it maybe would be a cool thing to be able to define a kind of relationship between templates. Like a class extending another one you could define an existing template as parent and the child template would inherit all fields and settings. New fields could be added, the inherited fields were kind of protected, the settings could be overridden by the ones defined for the child templates. I guess, this could be achieved by a module pretty easily. But I think it could also be a pretty nice enhancement as a core feature.1 point
-
As we wait for some code and/or graphic/drawing, I can say with almost 100% certainty that this should work with pocket-grid css. I use it everywhere . Remember that pocket-grid, actually, does, eh, nothing...or nothing much (seemingly). All it gives you out of the box are 100% width and float:left when you use the class .block. It sounds to me like you want to position some image absolutely. Shouldn't you be able to accomplish that with the normal parent element positioned relatively and the thing you want to stay in place positioned absolutely? Anyway, I don't need to tell you that pocket-grid does not get in the way of your CSS. It sounds to me like the issue is your CSS, not pocket-grid1 point
-
Hi gebeer, Sounds like a very interesting project! Would be great to have some insights in the showcase section when you're done1 point
-
MySQL (InnoDB) only very recently got the ability to allow index searches with bitwise operations. With the current (5.7.8) release, you can add a generated or virtual column to the pages table and index that. If the column operation in the query matches the column definition, the index is used. This should look something like the following (untested): ALTER TABLE pages ADD stpublished INT AS (status & 2048) STORED; CREATE INDEX idxstpublished ON pages (stpublished); After that, any queries with matching conditions like "pages.status & 2048 = 2048" or "pages.status & 2048 > 0" should hit the index. That's still a bit bleeding edge, but since Oracle officially promotes this feature (it's a must-have for the also advertised JSON column type to be of use), it should be reasonably stable by now. Of course, you have to have a generated column for every comparison you want to speed up, and having one adds another little performance penalty on insert operations.1 point
-
That's a fact that nobody can rely on, therefore it's not present in the processwire selector api. You could however do in with raw mysql or in memory with php.1 point
-
just had to do a simple 1-level menu on my new website and was once again surprised how easy things can be with the great API. i was doing navigations like in the examples above but today i took a slightly different approach that in my opinion is a little bit better to read and maybe easyer/cleaner to understand: function renderMenu($page) { // get the root page $hp = wire('pages')->get('/'); // set pages that should have "active" class // remove root page otherwise this would always be active // if current page == rootpage it will be appended and set active $active = $page->parents ->remove($hp) ->append($page); // set pages that should be shown in the menu // easy in this case because it is only 1-level $menuitems = $hp->children ->prepend($hp); // return the markup $out = ''; foreach($menuitems as $item) { $cls = ($active->has($item)) ? ' class="uk-active"' : ''; $out .= '<li' . $cls . '><a href="' . $item->url . '">' . $item->title . '</a></li>'; } return $out; } or with less comments and most on one line: function renderMenu($page) { $hp = wire('pages')->get('/'); $active = $page->parents->remove($hp)->append($page); $menuitems = $hp->children->prepend($hp); $out = ''; foreach($menuitems as $item) { $cls = ($active->has($item)) ? ' class="uk-active"' : ''; $out .= '<li' . $cls . '><a href="' . $item->url . '">' . $item->title . '</a></li>'; } return $out; } of course that is really a little difference to the examples above, but sometimes for me it got a little confusing to handle the "active" class with some IFs and ORs and ANDs and the approach with prepend() append() add() or remove() may be more elegant. another thread for reference if anybody is having trouble https://processwire.com/talk/topic/288-solved-navigation-current/1 point
-
If you haven't, you can read a bit in the docs here: https://processwire.com/api/modules/ Depending on what your module / class has extended, you may also use $this->pages->find() And if you use procedural functions, you can use function myFunction() { $pages = wire('pages'); $pages->find(); ...1 point
-
If you're using the api in classes or functions these variables are not available as such. You'd need to use $this->wire('pages') or wire('pages') depending on the current scope.1 point
-
After i learned a few things about php, i believe that i can port the plugin. But for that I need some help with the integration of functions. For the Plugin i need to save the IP (in shorted form) within the Comment. For this reason I have to expand to an IP field the comment database. All the filters are Optional: Check the comment IP with approved comments in the database Match the comment IP with external spam Database trust comments with gravatar classify BBCode as spam use regular expression create and use a local spam database At the moment i create the functions for doing the stuff in the list above. The next step is to integreat the Plugin to the processwire System and at least i will add support to limit comments to defined language. For all who interested at this plugin can follow on the Github project: https://github.com/kreativmonkey/antispam-guard1 point
-
No you use $pages->find("template=basic-page, status=unpublished"); Respectively $pages->find("template=basic-page, status=published"); But since $pages->find("template=basic-page"); returns only published pages anyway that are not hidden and above, a status=published makes no sense.1 point
-
You can hook ProcessPageEdit::buildForm to dynamically add custom fields (e.g. InputfieldMarkup) to page edit forms based. Is that what you're looking for?1 point
-
Srcset and picturefill or if it needs to be super simple just a 2x low-quality image.1 point
-
@tpr thanks for the insight and for your offer. I don't think I really need that code @kongondo thank you for your confirmation on textarea being a good chopice for JSON storage and for the other considearations 1 page per poll because here I only store the JSON that is produced by the survey builder and will be used to render the poll form. The submitted poll results will be sent to a different PW install and stored there. There I will store poll id and for each user submission the question/answer ids in a table pro field. Later I can pull this data, analyse it and present it in graphs using t3 library. Example: -parent page poll --child page question1 ---child page answer1 ---child page answer2 --child page question2 ---child page answer1 ---child page answer2 I'm more after 'Drink A tests better than drink B'. So I will store the submitted results like described above.1 point
-
1 point
-
@Ivan: A good idea. In fact, the one I initially had in mind, but I somehow got it into my head to save the settings directly with the template configuration which I couldn't. Of course, one thing doesn't necessitate the other and I can both hook into ProcessTemplate and use my own database table. So, version 0.0.6 is on GitHub and does allow that.1 point
-
Take a look here - quite a similar topic. Thought pwired has listed some newer (and quite usefull) additions to the module directory, which deserve their way into your toolbox.1 point
-
Processwire already has all core functionality to begin with. It's decoupled and api first, leaving it up to you what you want to build. To answer the question I could think of modules like hanna code, ImageMagick, TracyDebugger. http://modules.processwire.com/modules/process-hanna-code/ https://processwire.com/blog/posts/processwire-3.0.10-expands-image-resize-options/ http://modules.processwire.com/modules/tracy-debugger/1 point
-
I followed the steps of creating multiple template/parents for users I got an error on Step 4 while creating a new page with new template created in step 3. When I hitted save button, an error occur. Error: Call to a member function getInputfield() on a non-object (line 630 of /var/www/html/pw-test/wire/modules/Process/ProcessPageAdd/ProcessPageAdd.module) This error only occur when selecting the new created template. template (basic-page)from installation profile (basic profile) has no such an issue Edit: I'm sorry for my carelessness. I did something wrong on step 3 which producing the above error. Anyway, multiple template and parent setup for users is working now.1 point
-
Thanks for the answers adrian, Christophe and teppo! I also think "blocks to create unique page structures on the fly" is the right answer. However, in this case Concrete5 is NOT one step above ProcessWire in this area, because we are talking about two completely different concepts regarding frontend development, so they should not even be compared in this manner I think. Maybe that is why I didn't get close to decoding this sentence1 point
-
Ah, you're using MAMP (Pro?). Try the following: * Main window › MySQL, tick checkbox "Allow network access" (I got the German version of MAMP, don't know the proper translation), restart. * In ProcessWire's /site/config.php, replace localhost with 127.0.0.1 This is also an issue I found while working on wireshell with that particular MAMP set up.1 point
-
My Default language was not the first language in my language list. Meaning, under Setup->Languages the list started with the second language, then my default language followed. I changed that order, so my default language is the first language in the list, and now the tabs work correctly again1 point
-
Just thought I'd add the solution to this problem, for reference. Turns out there's a file called /site/assets/cache/LazyCron.lock (or something along those lines) preventing the cron functionality from working when there are PHP errors in my cron logic, which can happen during development of course. Fixing the errors and deleting the lock file restores functionality.1 point
-
There could be a situation where you want a Page with the following: it's published it's hidden it's template has a php file it SHOULD NOT be available to viewed on the frontend using it's URL Now you might be thinking "Well if you don't want it to be viewable on frontend, then just delete the template php file!"... however the purpose of wanting to have a template file could be for partial/section rendering. This is a pattern that I personally like to use. Here's a perfect example... let's say you have a page called "About Us" and it has 3 sections that make up the page. Based on how you want to structure that page, you decide that those 3 sections will be stored each as a child page of the "About Us" page, but when the "About Us" page is viewed, the page is built based on those 3 child pages (using a simple loop). So, we can give this as an example: /about/ (about.php)/about/philosophy/ (section-type-1.php) /about/mission-statement/ (section-type-2.php) /about/some-other-section/ (section-type-1.php) and in about.php, you might have something like this (using direct output)... <?php foreach($page->children as $section): echo $section->render(['prependFile'=>'']); endforeach; ?> and in section-type-X.php you would have just your partial markup: <section class="section-template-<?php echo $page->template; ?>"> <header> <?php echo $page->title; ?> </header> <?php echo $page->body; ?> <!-- etc... --> </section> So the above works fine, but those child pages can still be accessed if the direct URL is known. The way around this is one of the following: Option 1: In the partial file, detect if the page is being hit directly, as opposed to being rendered from another template like we are doing. If it it being hit directly, then redirect somewhere or throw a 404. You could do that by adding the following to the top of section-type-X.php. <?php // the pagestack is empty, which means the user hit this template file directly. if( empty($options['pageStack']) ): throw new PageNotFoundException(); // show 404 page endif; ?> Option 2: Don't assign an actual template file to the section templates. Instead, use a partial file approach So, you would rename section-type-X.php to _section-type-X.php (notice it starts with an underscore). Then in about.php, you would use wireRenderFile/wireIncludeFile. But now that I think about it, how would you best associate a section page with a template? -- Anyway, hopefully the scenario I outlined above helps someone. This occurrence, perhaps unbeknownst to @teppo may be happening on the weekly.pw site. For example, if you Google for just one Issue (let's say #32), you get the URLs not only to Issue 32, but the page sections that make up that issue: https://www.google.com/search?q=site%3Aweekly.pw%2Fissue%2F32%2F Results: https://weekly.pw/issue/32/ https://weekly.pw/issue/32/latest-processwire-core-updates/ https://weekly.pw/issue/32/new-module-service-ip-geolocation/ https://weekly.pw/issue/32/processwire-resources-of-the-week/ Is that a bug Teppo? You may get docked for duplicate content depending on how you are handling canonical URLs.1 point