-
Posts
4,632 -
Joined
-
Last visited
-
Days Won
55
Everything posted by apeisa
-
Best way to use page fields in a selector tag
apeisa replied to onjegolders's topic in General Support
Ah, sorry. No need for $this there. I've been coding too many modules -
It's all crazy again, in redirect loop with itself (I assume). This is the page source: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd"> <!-- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> --> <HTML> <HEAD> <META HTTP-EQUIV="Refresh" CONTENT="0.1"> <META HTTP-EQUIV="Pragma" CONTENT="no-cache"> <META HTTP-EQUIV="Expires" CONTENT="-1"> <TITLE></TITLE> </HEAD> <BODY><P></BODY> </HTML>
-
Usually sanitizing is done through textformatters: edit field => details tab => textformatters. I think there is HTML entity encoder on headline field, you can remove it if you want to. Other way is to sanitize when outputting and third way would be using some kind of autoload module (but I think there is little reason for that because of textformatters).
- 5 replies
-
- 1
-
-
- html fields
- tokens
-
(and 1 more)
Tagged with:
-
Hi Ferahl and welcome to the forums. You can put html into text or textarea fields. When using textarea, you can also choose TinyMCE editor and then customize it (per field basis) to contain only the needed controls. There ain't (or at least I don't know) any ready parser module for bb-tags, if that is what you are looking for?
- 5 replies
-
- 1
-
-
- html fields
- tokens
-
(and 1 more)
Tagged with:
-
Guys, great work! If you need my help with shopping modules just let me know. I hope to find some time to improve them.
-
Best way to use page fields in a selector tag
apeisa replied to onjegolders's topic in General Support
$biology = $pages->get("/subjects/biology/"); $biology_students = $pages->find("template=student, subject=$biology, sort=title"); It does pretty much the same as your code, but in a more readable way. Also works with multiple pages like this: $subjects = $pages->find("template=subject, some_selector=value"); $students = $pages->find("template=student, subject=$subjects, sort=title"); -
Yep, the mobile view is very very well done. Only two complains left for the forums: Working indentation Ascii smiles (they lead my poll 8 - 1)
-
Nope, sorry. My need in that project was just the authentication.
-
Which file permissions are needed for upload?
apeisa replied to Nico Knoll's topic in General Support
Good news. How about IE10 - can anyone test that? -
Sorting question (Sort users->email pages field)
apeisa replied to Harmster's topic in API & Templates
$page->users->sort("email")- 1 reply
-
- 1
-
-
I don't think it is a good practice to use official PW logo with modules, site profiles etc. It will lead to confusion in the long run. I think same with naming: actually my module name for "Shop for ProcessWire" is not good name either. It is better than "ProcessWire Shop", but I think all 3rd party modules/profiles etc should stay away from ProcessWire name and logo (but be very clear about ProcessWire connection in otherwise, of course). At least PHP has this kind of practice: http://www.php.net/license/index.php#other-lic
-
I did hit my head into wall for few hours because of this. I did build custom login and was getting very strange results (sometimes it worked just fine, other times not so nicely). Finally I did figure out the problem and it was SessionLoginThrottle. It is pretty hard one to find out, since $session->login($username, $pass) returns just false, even if username and password are right (but SessionLoginThrottle comes into play). Not sure what is best way to handle this? Maybe just information on cheatsheet, that even though username and password are right, there might be other things that prevents login. Or then - should sessionLoginThrottle be activated by default only on main admin login and let custom logins use it if they want?
-
Textformatter to convert www.domain.com to hyperlinks
apeisa replied to apeisa's topic in Modules/Plugins
I have to disagree with this. The services and software that most people use do convert www.something.fi to links (Facebook, IM clients, MS Word, Google Docs etc.) and I think it is pretty much expected behavior for many. And I did fair share of testing those and it is the www. or http:// that makes the link on those occasions. something.fi is not link, but www.something.fi or http://something.fi are. (and as an expection to the rule, IP.Board doesn't think www.something.fi is a link) -
Very interesting module and looks very cool! I think there will be many kind of use cases for this one. Interested to hear how Tom will be using this?
-
forgot backend password, how do you reset?!
apeisa replied to danielholanda's topic in Getting Started
Ah, brilliant! I tried to add the existing password field into a template without any luck on that Never realized that I could create new password fields, but it is indeed possible! Thanks Soma! Of course need to know how to calculate the password hash (to compare the one that gets added into a db), but that should be easy enough.- 18 replies
-
Interesting topic, thanks for creating it Joshua. We have had similar talks since Drupal seems to be a platform that many organisations know in Finland. Big boys only talk about Drupal or Sharepoint. I have had my talks with our clients about "PW vs Drupal"... today I just do what Ryan once suggested: show them PW - build something quick, let them see how you develop with it and how quickly you can make things. You know you can build the whole backend of "events management" or "custom application never build before" in just about 30 minutes. Just build it. But if you do want talk about PW and Drupal, you should mention these things (I am by no means a Drupal expert and too lazy to check all the facts, so take this with grain salt and please do correct me if I am telling lies): Drupal release cycle is too fast for many. They try to get new major release every two year and only two latest are supported. Also major releases do break APIs, so probably most of the custom development need to be redone at least every four year. This might be fine on some projects, but for our clients that is usually an impossible schedule. It helps a little that new versions usually don't ship on time, though - and also some community efforts are trying to keep older versions secure. Ask people about their Drupal projects... most are not too proud of those: "This is little hacky" or "We didn't follow most of the best practices here, since we were in hurry". Those comments we got from the company, that we bought to teach us Drupal development and wanted them to show us their best work... Many people build sites with Drupal without really knowing how it works... which is understandable since it takes about 6 months to learn that beast (heard that 6 months estimate from CEO of biggest Drupal company in Finland and my initial feeling and personal experience suggest that it is pretty accurate). Drupal development is very different from normal PHP coding: If you (and your co-workers) have invested 6 months to "unlearn" PHP development and learned Drupal, you don't want to think about alternatives on that point. Drupal projects are expensive. In Finland ie. "The cost of Drupal web projects usually begins at about 20,000 euros, but projects best suited to Drupal generally cost more than 100,000 euros." (source: http://northpatrol.c...nal-products-2/). I usually draw a picture where PW is lots of tiny blocks, that cover 80% of needs and very little goes away. So you just build the remaining 20% and you get exactly what is needed. With Drupal (or any other "big" platform) you do get big block that goes well over 100%, but has more than 20% of holes. So you do have to build the remaining 20%, but also end up more than what is needed. So if you want to get rid of all the bloat, you do have more work to do. I have personally tried and wanted to learn Drupal for many many times. I always end up with big frustration and sites that were "nearly there". That was before PW, of course. EDIT: This was all very technical, so might want to talk this language only with tech orientated clients. With others, I would focus on PW admin usability and flexibility on frontend.
- 83 replies
-
- 10
-
-
forgot backend password, how do you reset?!
apeisa replied to danielholanda's topic in Getting Started
Soma: through API or with advanced mode?- 18 replies
-
forgot backend password, how do you reset?!
apeisa replied to danielholanda's topic in Getting Started
Little OT: is it possible to use password field on other templates?- 18 replies
-
Textformatter to convert www.domain.com to hyperlinks
apeisa replied to apeisa's topic in Modules/Plugins
I did think about adding http:// and want to add that. But client wants and expects in this case is actually urls that start with www., so I implemented that first. But I do agree that http:// would be nice addition. I don't think there is real danger to have strings that starts with www. then have some chars, dot and 2-4 chars and not meaning to have url? I think typing http:// might be more annoyance for many non tech savvy users than using link tool? -
I build simple textformatter to convert text like www.something.com or www.something.com/site/index.html into: <a href='http://www,something.com'>www.something.com</a> Please test and comment (my regexp skills aren't that great...). <?php class TextformatterConvertLinks extends Textformatter implements Module { public static function getModuleInfo() { return array( 'title' => 'Text links to anchors', 'version' => 100, 'summary' => "Convert text links like www.domain.com to hyperlinks", ); } public function format(&$str) { if(strpos($str, 'www.') !== false) { if(preg_match_all('#\s*(www\.\S+\.\w{2,4}(\.|\,|\s+|/\S*))#', $str, $matches)) { foreach($matches[0] as $key => $line) { $url = $matches[1][$key]; $endChar = ''; $lastChar = substr($url, -1); if ($lastChar === "." || $lastChar === ",") { $url = substr($url, 0, strlen($url) - 1); $endChar = $lastChar; } $str = str_replace($line, " <a href='http://". $url ."'>". trim($url) ."</a>{$endChar} ", $str); } } } } public function ___install() { } public function ___uninstall() { } }
-
Another one: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Inputfield/InputfieldPageListSelect/InputfieldPageListSelectMultiple.module Lines 53-55 should be multilang.
-
Teppo: you are probably right. I think this might be a good idea to implement into multisite module (with setting tab maybe?).
-
Sure. How are alternative domains setup in the config? Ie. how does the textarea scales here? Just commas between the different urls where the first one maps to the actual page?
-
I have usually created custom $page->root and used that. root parent is still useful, kind of replaces get(1) when using multisite.