-
Posts
396 -
Joined
-
Last visited
-
Days Won
15
Everything posted by heldercervantes
-
Set checkbox unchecked via API
heldercervantes replied to heldercervantes's topic in General Support
I'm positive it's going through this code. The password is being changed and also after this it sends an email to the user with the new password and that's working too. I'm thinking it may be some weirdness related to the page being a user. If I don't get there, I'll just use another kind of field. -
Hi guys, I'm kinda stuck here. How do you set an InputfieldCheckbox to unchecked via API? I've tried setting it to false, 0, '' and nothing seems to work. Shouldn't be relevant, but I'm using this to control whether a user's password was auto or manually generated. So when a password recovery is requested, I'm doing: $user->setOutputFormatting(false); $user->pass = $randomGeneratedPassword; $user->passwordSet = false; $user->save(); passwordSet is the name of my field. This is generating and saving the random password correctly, but that checkbox stays checked.
-
@rick Something more must be going on. At that point in scrolling JS collapses the header, adds color to the logo and gives it a white background. You may have stumbled upon a JS issue in Ubuntu.
-
Hey forum. I should have posted this one here a long time ago, but been so busy I didn't even add it to my portfolio despite being launched months ago: http://www.wholebrain-technologies.dk Wholebrain is a brainwave optimization center in Denmark. This started out as a site redesign and quickly shifted towards a complete brand overhaul with new logo, illustrations, icons, the works. The site features a simple ingredients list: Repeater, AIOM, Markup SEO and that's about it. I took a flexible approach where the basic page template features a bunch of optionals that can be combined to add testimonials, video gallery, featured video, illustration or icon cards. You can see the result navigating from page to page, as all use the same template, except for the contacts page. In the end, this site was replicated for Dynamic Brain Technologies, the same service in Ireland: http://www.dynamicbraintech.com Enjoy, H
-
Web server's security rule locking PW
heldercervantes replied to heldercervantes's topic in General Support
I've asked them to turn it off. Works for now, but I'll have to keep it in mind for future projects. HTML content in textareas are causing a false positive on an injection checker. We'll probably see more people with the same problem. The only solution I can think of would mean encoding post content when PW saves. -
Hey guys. It's the second time I've collided with this problem recently. Saving a page in PW jumps to a 404 page, and nothing is saved. The problem is having html in a textfield. My first incident was with a plain textarea (no CK), where the admin was supposed to enter an instagram embed code. Got around that one easily by switching to a text field, user enters only the ID instead of the embed code, and the template would process that. Now it happened again on another project and this time I can't work around it the same way. It's a CK editor field, and when an image is added to the text, poof! My hosting provider tells me something is colliding with Firewall: XSS Filter - Category 1: Script Tag Vector rule and sent me the following log: http_method POST action_desc Access denied with code 403 (phase 2). ip ---.---.---.- meta_severity CRITICAL meta_id 212000 path /processwire/page/edit/?id=1788 meta_logdata Matched Data: <script async defer src=\x22//platform.instagram.com/en_US/embeds.js\x22></script> found within MATCHED_VAR: <blockquote class=\x22instagram-media\x22 data-instgrm-captioned data-instgrm-version=\x227\x22 style=\x22 background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);\x22><div style=\x22padding:8px;\x22> <div style=\x22 ... meta_uri timestamp 2017-05-02 15:46:39 meta_offset 0 meta_msg XSS Filter - Category 1: Script Tag Vector||www.-----.com|F|2 http_version HTTP/1.1 host www.-----.com justification Match of "contains google_ad" against "MATCHED_VAR" required. Has anyone hit this problem? Is there a solution on PW's side that doesn't require lowering this rule on the server? Thx, H
-
Embed code in field crashing save
heldercervantes replied to heldercervantes's topic in General Support
Thanks Robin. It is a shared host and I'll ask them if this was the case. Some server change seems the only reasonable explanation. -
Hi guys, I have a website that's been running for about a year, and now it started crashing PW when I save a page, showing the 404 page after saving and doesn't actually save anything. Testing things out I've pinpointed the problem. I have a repeater field for placing instagram embed code, and adding content to just one entry is enough for the page to not save. It's a simple textfield and I'm pasting a standard embed code: <blockquote class="instagram-media" data-instgrm-captioned data-instgrm-version="7" style=" background:#FFF; border:0; border-radius:3px; box-shadow:0 0 1px 0 rgba(0,0,0,0.5),0 1px 10px 0 rgba(0,0,0,0.15); margin: 1px; max-width:658px; padding:0; width:99.375%; width:-webkit-calc(100% - 2px); width:calc(100% - 2px);"><div style="padding:8px;"> <div style=" background:#F8F8F8; line-height:0; margin-top:40px; padding:50.0% 0; text-align:center; width:100%;"> <div style=" background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAMUExURczMzPf399fX1+bm5mzY9AMAAADiSURBVDjLvZXbEsMgCES5/P8/t9FuRVCRmU73JWlzosgSIIZURCjo/ad+EQJJB4Hv8BFt+IDpQoCx1wjOSBFhh2XssxEIYn3ulI/6MNReE07UIWJEv8UEOWDS88LY97kqyTliJKKtuYBbruAyVh5wOHiXmpi5we58Ek028czwyuQdLKPG1Bkb4NnM+VeAnfHqn1k4+GPT6uGQcvu2h2OVuIf/gWUFyy8OWEpdyZSa3aVCqpVoVvzZZ2VTnn2wU8qzVjDDetO90GSy9mVLqtgYSy231MxrY6I2gGqjrTY0L8fxCxfCBbhWrsYYAAAAAElFTkSuQmCC); display:block; height:44px; margin:0 auto -44px; position:relative; top:-22px; width:44px;"></div></div> <p style=" margin:8px 0 0 0; padding:0 4px;"> <a href="https://www.instagram.com/p/54GBHhJp6h/" style=" color:#000; font-family:Arial,sans-serif; font-size:14px; font-style:normal; font-weight:normal; line-height:17px; text-decoration:none; word-wrap:break-word;" target="_blank">No matter how you look at it, the #dourovalley is a special place... #visit #Portugal #Douro #ilovedouro #instatravel #instaphoto #landscape #nature #havinganaffair</a></p> <p style=" color:#c9c8cd; font-family:Arial,sans-serif; font-size:14px; line-height:17px; margin-bottom:0; margin-top:8px; overflow:hidden; padding:8px 0 7px; text-align:center; text-overflow:ellipsis; white-space:nowrap;">Uma foto publicada por The Tourists' Affairs (@thetouristsaffairs) em <time style=" font-family:Arial,sans-serif; font-size:14px; line-height:17px;" datetime="2015-08-02T09:46:32+00:00">Ago 2, 2015 às 2:46 PDT</time></p></div></blockquote> <script async defer src="//platform.instagram.com/en_US/embeds.js"></script> It was running fine, all the site's current content was added without a problem and only recently, apparently without any changes, this started happening. Anyone got an idea what may be going on? Thanks, H
-
Module: ImageMarker Fieldtype & Inputfield
heldercervantes replied to kongondo's topic in Modules/Plugins
In my last couple of projects I've used a hacked version of this module with an extra field for inputting image map coordinates. With a little snooping around and a good dose of patience my lack of module building knowledge didn't stop me So now this shopping centre's website has a store locator where you can hover hotspots, the marker appears in place and everything is configurable in the CMS. Before this was a Swiffy converted flash object. Here's the result in the frontend: http://www.miramaiashopping.pt/lojas/ And here's what it looks like in the CMS: Now I do have another project where I also have to add hotspots to an image for showing some text. But for that the module needs some serious work. I'm just going to make subpages of a type that only has a body field and use that. It would be cool to have this work like a repeater where you have full control of the fields for each marker and only link to pages if you need to, but that would mean rebuilding from the ground up. -
Files by language, how would you do it?
heldercervantes replied to heldercervantes's topic in General Support
Already did, no cigar. If I get the first langFiles->lang, it returns 1010, same as outputting $user->language. Comparing those in an IF statement works, but the find returns nothing. I tried: find('lang.name='.$user->language->name); find('lang='.$user->language->id); find('lang.id='.$user->language->id); Nothing works. I even tried adding a title field and fake a string and still get nothing. Something's preventing that from working. But that foreach solves the problem and in this small site performance won't be an issue so I give up streamlining more. -
Files by language, how would you do it?
heldercervantes replied to heldercervantes's topic in General Support
Found a pretty cool solution for this. Repeater + Page + Files. So I set up a repeater called langFiles. Inside that repeater I added a Page selector called lang and the files field. The page selector is set to be a single select, by template = language. So in the admin I get a repeater, add an item, select the language and upload the files. Add another one for the second language, and so on. Then on the frontend: // Somehow $page->langFiles->find('lang='.$user->language) doesn't work foreach ($page->langFiles as $lf) { if ($lf->lang == $user->language) { $filesRepeaterBlock = $lf; break; } } if ($filesRepeaterBlock->files->count) { echo '<ul>'; foreach ($filesRepeaterBlock->files as $file) { echo '<li><a href="'.$file->url.'" target="_blank">'.$file->name.'</a></li>'; } echo '</ul>'; } And there it is. Add a new language tomorrow, and it adapts. And it's not too weird for the admin. -
Files by language, how would you do it?
heldercervantes replied to heldercervantes's topic in General Support
I think I misinterpreted you. Your approach is to add a file field for each language? -
Files by language, how would you do it?
heldercervantes replied to heldercervantes's topic in General Support
Thx adrian, but this doesn't seem to work for file fields. Even with outputformatting set to false I always get the default language. -
Hi forum, I'm implementing a site where a files field needs to be language-sensitive. I don't mean descriptions, but the files themselves need to be different according to language. I could have a field for each language, but that would mean having to add new fields if we add new languages later on. So my attempt was to use the description as a filter. If there is one, show the file, if not ignore it. So a file that has a description only for english would only show when viewing english. But the description defaults to the main language. Is there a way to get the actual description on a given language without defaulting when it's empty? Or some other approach that's minimally elegant for this problem. Thanks, H
-
Field for selecting form to embed (list all forms)
heldercervantes replied to heldercervantes's topic in Getting Started
Thanks for the tip @kongondo -
Field for selecting form to embed (list all forms)
heldercervantes posted a topic in Getting Started
Hello fellow PWers. Today I'm proud to be doing my first installation of Form Builder on a project. Been waiting a while for this opportunity. However I'm stuck. I want to add a field on a template, where the user can select which form to embed there. I could just use an Options field and add the form list there manually, but it would be nice to have something more elegant that displayed all available forms and that updates options automatically if new forms are created. My first thought was Page Select, but it seems FB's forms aren't saved as pages. Any ideas? Thanks, H -
Alternatively render textarea as plain text
heldercervantes replied to heldercervantes's topic in General Support
Thanks guys. Strip_tags worked like a charm -
Hello chaps. Anyone know a smart (as in short and sweet) way of rendering a textarea that is configured to use CKedit, as plain text? The regular, html version of the field's content is used on the page, but then I need a clean alternative version for some cases. Thanks, H
-
Multi language strings in includes
heldercervantes replied to heldercervantes's topic in General Support
Thanks for your help. I used Ryan's suggestion of starting the path to my includes with "./" <?php include('./includes/footer.inc.php'); ?> Worked like a charm. -
Hi guys. I'm having this weird problem with translatable text. I have it in just about every template of the site and it works fine with one exception. In every template I'm including a footer, using a regular: <?php include('includes/footer.inc.php'); ?> Then in that file I have this: <footer> <div class="row"> <div class="slogan"><?= $home->slogan; ?></div> <div class="social"> <?= __('Follow us'); ?> ... That "follow us" string shows up to be translated on the cms, and so does a second string I have a few lines down, but on the frontend it always renders what's in the code. It doesn't replace with what's set on either the current language or the default language. Just ignores everything. Any idea what's going on here? Thanks, H
-
Freakin awesome! @teppo: site of the week right here.
-
Module: ImageMarker Fieldtype & Inputfield
heldercervantes replied to kongondo's topic in Modules/Plugins
I'm doing a modded implementation on a new project using PW 3.0.41 right now. Works like a charm. -
Either I'm missing something or the module is not working properly in version 3.0.33 devns. I installed it, configured my basic page to be included and sure enough started seeing page edits appear listed on the history tab, even identifying the changed fields correctly. However, preview always shows the current version and revert has no effect.
-
Hey Bitpoet. Any progress on that sweet module of yours?
- 11 replies
-
- language
- multi-language
-
(and 1 more)
Tagged with:
-
Error: Unable to create temp dir
heldercervantes replied to heldercervantes's topic in General Support
Well, turns out it was a hosting problem. The account wasn't properly configured and ran out of space