Wanze
PW-Moderators-
Posts
1,116 -
Joined
-
Last visited
-
Days Won
10
Everything posted by Wanze
-
Exactly the same way as above. Only with the difference, that the "$cnt" variable gets incremented automatically, no need to write $cnt++ at the end of the loop: foreach ($pages->get('/news/')->children("limit=5") as $cnt => $item) { $firstClass = ($cnt == 0) ? "first" : ""; }
-
Custom Page field in user template won't fully change
Wanze replied to adrian's topic in API & Templates
Can you provide a code snippet? Caching enabled (allthought the cache should be cleared when you save the page)? -
I think you need at least 4 characters for the search: http://processwire.com/api/selectors/
-
You are right. If you need more fields (first name, last name, image etc.), you can add them to the user template. $u = new User(); $u->firstname = "Gonzo"; $u->lastname = "Ipsum"; $u->name = "gonzo"; $u->pass = "BamBam!"; $u->addRole("guest"); $u->save();
-
Sweet! The animations are super smooth, especially in webkit browsers.. (think I need to clear my firefox data, but don't want to wait 2 hours right now) ;-)
-
I also think that recaptcha is too difficult to read. But not only the text - also the audio is not understandable. So my solution which works perfect so far is the same as yellowled said: //HTML <input type="text" name="email2" id="email2"> //CSS #email2 { display: none; } //PW / PHP if (trim($input->post->email2) != '') echo 'hi spam'; For larger sites with lot of traffic, a combination of mulitiple approches is better
-
Depends on the Hardware of your server. Most standard shared hosting don't allow setting to high values. When uploading big files, you should also check out the settings "max_input_time" and "max_execution_time".
-
Thanks to your post i now know that Pw comes with a FileLog class. Just checked it out. Very handy for my next project, so I wasn't wasting my time Cheers
-
I also had the Problem with umlauts and strftime. The solution that worked for me was this line of code: setlocale(LC_ALL, 'de_DE.UTF-8'); Hmm PHP why isn't everything utf-8 by default...
-
One solution I used: Give your main menu items that should redirect to the firt sub menu a "redirect" template. Then in your template, simply add this code: $children = $page->children; if (count($children)) { $session->redirect($children->first()->url); } else { //This page has no children to redirect... throw a 404 or do other work throw new Wire404Exception(); }
-
Anyone having trouble with Email Obfuscator in 2.2.9?
Wanze replied to CliffG's topic in Modules/Plugins
Hi CliffG and welcome! Do you see any errors in your javascript console? Any other "special" modules installed? -
Hi casey, You can use $image->url foreach($page->images as $image) { $big = $image->size('', 800); $thumb = $image->getThumb('thumbnail'); echo "<a href='{$big->url}'><img src='{$thumb}' alt='{$image->description}'/>"; } The Cheatsheet is very handy to check methods and properties: http://processwire.com/api/cheatsheet/ Cheers
-
Hi Soma, Just used your profile and I had the same Issue with the error message after the login. Turned out my sessions folder was missing too, so I created it manually with Permissions chmod777 and it worked. What I observed: Normally when installing Pw with the default profile, I have to give my assets folder + site/config.php write access. In my case, this is 777. With your profile, this was not the case. But the permissions on the assets folder were 755, so maybe that's why the sessions folder doesn't get created. Weird... Cheers
-
Simple responsive documentation admin theme
Wanze replied to Michael Murphy's topic in Themes and Profiles
Michael? -
Modifying a class's style definitions for a specific page
Wanze replied to pwusr's topic in Getting Started
Frontend? I usually do this in my templates: <body class="<?php echo $page->template . ' page_' . $page->id; ?>"> Then in your css, you can define styles by Template or if necessary, by Page: /*Set styles for basic_page template*/ body.basic_page ul { margin: 0; } /*Or for a Page*/ body.page_2003 ul {margin: 20px; } -
Trying to get the first object with a condition
Wanze replied to tinacious's topic in General Support
Wow that's good to know... very nice. The time before ProcessWire when I had to write the sql queries myself... don't miss them- 16 replies
-
- conditional
- foreach
-
(and 1 more)
Tagged with:
-
Hi Bjorn, not exactly sure if get what you want to do From the docs: http://modules.processwire.com/modules/lazy-cron/ So if you need your refresh exactly at midnight, a Cronjob would be the better solution. See the last paragraph, "How to make it not lazy" in the link above. Cheers
-
If I'm right, it's the same as ->get($key) From the cheatsheet: Returns the single item at the given zero-based index, or NULL if it doesn't exist. eq = equals I guess
-
$wire->pages->get(1001)->nn_basic_page_file->pagefiles->delete(); Leave out pagefiles, the name of your field is "nn_basic_page_file" Try this: //Delete the first file $firstFile = $wire->pages->get(1001)->nn_basic_page_file->first(); $wire->pages->get(1001)->nn_basic_page_file->delete($firstFile);
-
Congrats and thanks for the great modules! Can you even sleep without a daily dose of 50-100 Pw-likes?
-
Hi Joss, This happens because all the Pages are loaded via ajax. Your Code does not work for content that is loaded dynamically into the DOM. JQuery provides a function to select also ajax content: http://api.jquery.com/on/ Now the question: On which event do you want to append this class? Would work like this: $(document).on(events, selector, data, handler); Maybe you need to hack the ProcessPageList.js? Cheers
-
Jacked, For multilang Websites which need localized urls, there's a great module: http://modules.processwire.com/modules/language-localized-url/ If you have problems or questions, it's always best to give some details what you want to achive and also share some code-snippets. The people here are very helpful. Btw, ryan is also a designer and I think that Processwire's backend is the best so far in terms of usability. Just take some time to explore Processwire and how it works, you can do everything with it ;-)
-
Why do you have to check this always? As for your second idea: Got to: Setup -> Templates -> Filters -> Show System Templates? -> Yes Edit the "language" template, add a textfield "code" and set your language code
-
Cool! Yes, as apeisa mentioned above: That's because the passwords use a salt which is unique per Processwire installation.