Leaderboard
Popular Content
Showing content with the highest reputation on 01/03/2014 in all areas
-
A site for a group of museums I recently built using PW. http://www.kunstmeile-hamburg.de/ - multi-language (german/english) using multi-language fields and page names Exhibition dates are managed per museum and are then chosen to show up on the home page. Perfect for this type of website with frequently changing content. Haven't had a single question from the client regarding the use of PW! Cheers Claude6 points
-
You could solve this with javascript/jQuery. <script> // document ready $(function(){ // add class InputfieldFileLink, to every href that links to an image. $("a[href$='.jpg'], a[href$='.gif'], a[href$='.png']").addClass('InputfieldFileLink'); $(".InputfieldFileLink").whatEverLightBoxYouLike(); }); </script> (extended the post)3 points
-
Soma you and some other guys here make my job easy because most of the hard questions were already answered. So thank you for all the help and support give here. You all make this forum great.3 points
-
My second PW site, theanodyne.com, features info for a local bar & pool hall and is designed to look like a vintage menu. They love how easy it is to update the site.2 points
-
@Ryan et al: Can't help writing a line to say thank you for this amazing project and forum and community! I've been lurking around here for a few weeks already, attempting to set up a project to migrate an existing static web site. I quickly figured out that PW was the way for me to go, because of it's technical features and concepts. What surprised me, though, was the fact that I was able to get answers on nearly every question that arised during that process "in an instant" - thanks to the excellent resources of this community and forum contributors devotedly offering a helping hand. That's simply impressive - I hope to continue to maintain a steep learning curve to be able to return a little bit of that at some time...2 points
-
Each role object has some additional functions to help with checking, adding and removing permissions: // Add $role->addPermission("page-edit"); // Remove $role->removePermission("page-edit"); // Don't forget to save $role->save(); The parameter (here, "page-edit"), can be a permission ID, name, or instance of a permission (i.e. doing $permissions ->get() or ->find()) This was taken from the reference on the cheatsheet - $roles - click [+].2 points
-
We will put up http://fi.processwire.com site like there are http://de.processwire.com and http://it.processwire.com. If you want your company or yourself portrayed on that page, please provide image and link here on this topic. We also have processwire.fi domain, that we will simply redirect to fi.processwire.com when everything is ready.1 point
-
Marvelous, easy when you now how to. $t->useRoles = 1; $t->set("roles", array('1316','2006')); //view $t->set("editRoles", array('1316','2006')); //edit $t->set("createRoles", array('1316','2006')); //create $t->set("addRoles", array('1316','2006')); //add children The array contains as Martijn said the roles's ids. Thanks to you three.1 point
-
This code that I just wrote might help: // Lets clone the "mallitoimipiste" that has all the required pages $fc = $this->pages->clone($model); $fc->title = $this->input->post->name; $fc->name = $name; $fc->location->address = $this->input->post->address; $fc->removeStatus(Page::statusLocked); $fc->save(); // create role for this fitness-center $fcrole = $this->roles->add("fitness-center-" . $name); $fcrole->addPermission("page-view"); $fcrole->addPermission("page-edit"); $fcrole->addPermission("page-sort"); $fcrole->addPermission("profile-edit"); $fcrole->save(); // add template permissions for the new role in fitness-center template $fctemplate = $this->templates->get("fitness-center"); $addRoles = $fctemplate->get("addRoles"); $addRoles[] =$fcrole->id; $editRoles = $fctemplate->get("editRoles"); $editRoles[] =$fcrole->id; $createRoles = $fctemplate->get("createRoles"); $createRoles[] =$fcrole->id; $fctemplate->roles->add($fcrole); $fctemplate->set("addRoles", $addRoles); $fctemplate->set("editRoles", $editRoles); $fctemplate->set("createRoles", $createRoles); $fctemplate->save(); // add the current role as a edit_role for the page $fc->edit_roles->add($fcrole); $fc->save(); Not sure if that set("createRoles", $createRoles) is even required, probably works with ->add just like "roles" does.1 point
-
Hello Martijn. Your code is working I used $t->useRoles = 1; $t->set("roles", array('1316','2006')); // where 1234 is the ID of the role you want to add. It allows those roles to view pages using this templates but edit, create and add. Hi Soma. This page will have many roles and users I prefer do to it automatically with the api.1 point
-
1 point
-
I think if you searched the entire web of forums you would be hard pressed to find a more responsive forum with such dedicated members. I hope those of use trying to learn ProcessWire everyday can help out in the future. It also baffles me that Ryan leave no question unanswered.1 point
-
I think it's bad practice to depend on $modules->get('JqueryFancybox'). Now you're depending on ryan's updates. ( new versions will use MagnificPopup, so probably this stops working after a while ) Next, jQuery is now loaded twice. First is the old one 1.4.2 that came with the default install. ( I think ) Better to not use Fancybox anymore. It's old and depending on old jQuery versions, relying on $.browser which is deprecated for a long time. Oké, to work: 01. Remove your $modules->get('JqueryFancybox') call. 02. revove the old jQuery 1.4.2. link. 03. Grab a new version jQuery and make sure that it is loaded first before all other scripts. 04. Take a look at other lightbox scripts. I do like magnific popup (instructions) if all scripts are loaded: $(function() { // Teppo's add class trick $('a[href*="/assets/files/"]:has(img)').addClass('InputfieldFileLink') $('.InputfieldFileLink').magnificPopup({type:'image'}); });1 point
-
Think you have to set: $t->useRoles = 1; $t->set("roles", array('1234')); // where 1234 is the ID of the role you want to add.1 point
-
I'm not sure about this, but could you try: $u->language = $languages->get("english"); ps, I think $user is a bad variable name, because $user is the current user. Also note that the guest role is added automagically.1 point
-
Simple explanation: // Type Null (variable with no value) echo $p->id // throws error. // Type NullPage (object type of NullPage) echo $p->id // outputs 0, evaluate to false if(!$p->id) { echo "We have a NullPage"; } else { // we have a valid Page echo $p->title; } Not relevant to your question: /** * Here $page is always that selector, so always true. * You need atleast a double == * I prefer the tripple version === , then type also matters */ if ($page->id !== 0) { $page->stuff... } else { // not found stuff } // little bit changed, to clarify take a look: comparison operators1 point
-
It's in the main.js of the theme. There was some fix in ~2.3 for that.1 point
-
...well you can ...Edit your first post using the full editor (click on "Edit", then click "Use Full Editor")1 point
-
AutoSave This module saves the page via ajax when editing in the admin. The interval for saving the page is configurable in the AutoSave module settings. By default it will only be enabled for unpublished pages. So far it seems to work fine for all fields and supports multilanguage. There's a message dialog show on top of page when saving happened with either a success or error. Requirements ProcessWire 2.3+. Haven't really tested with 2.3. Known Issues Nothing really obvious so far. Note that when you have multiple editors editing pages, it would be possible 2 persons editing the same page would overwrite each other, since the page is autosaved! The only solution for this would be to have my PageEditSoftLock module enabled with the complete "Lock" option active, so the page would be locked for editing. Todo Add some checks, if connection is lost. To be defined This module is currently a proof of concept. This module may not be suitable for all instances, but for personal use it may help preventing loss of long edits, most likely blog posts. Not sure this should be used for regular sites with clients editing. Most likely there's some more issues that interferer with what a CMS "page save" has to deal with. So you might find some ugly stuff happening. Thanks to Apeisa and his great Fredi font-end module, from where some logic is borrowed to save the page via ajax. Download https://github.com/somatonic/AutoSave So, that would be my last stroke for this year! Have a great silvester party and a happy new 2014!1 point
-
This is a basic site for a car restorer: http://www.tcfautocare.co.uk/ Its a fun and slightly silly site for people who want to get their old campervan or classic car restored. Since this is a very personal, passionate sort of thing for people to do, I decided that the site should be more friendly and show that the company is as passionate and daft about these old cars as the customer is. Some restoration projects can take years, so it is important to build friendly relationships from the outset. For this reason, the call to action is biased towards getting customers to phone rather than use a contact form. Personal contact is essential. PW 2.3.9 Bootstrap 3 It has a small blog system with a category field that just allows blog posts to appear on the bottom of specific pages as well as the main blog page. So, a blog about Campervans will also appear on the Campervan Restoration page. It has a blocks system (repeater field) for the main product pages (Campervans, classic cars ...) that allows a block to be created and then placed in the left column or right column. The block can have title, text, image, video and will display slightly differently depending on which of these are enabled or not. A block can also be disabled rather than deleted if it is not required at that moment. Photos are mostly by me (the arty ones are mine) All copy (including the two blog posts to get him started) is by me - and probably a bit obvious! All graphics are by me, including the campervan and fiat - took me sodding ages! There are actually three domains - two of them have static pages with unique copy, but all the menu links are through to this main site.1 point
-
Hello, no idea how that happend, but for some reason it seems to work all of a sudden. Problems magically disappearing into thin air. Nice way to start the year!1 point
-
I finally caught up with those 9 pages of posts and am down to 0 posts in my "new content" list. Sometimes things escape my new content list, so if anyone is waiting on me for anything or aware of something that I might have missed, please let me know. Happy New Year to everyone! Hope that you all have a great New Years day today.1 point
-
Strangely I can't duplicate the issue, but the error message you guys have mentioned is correct. It was attempting to call a parent::__construct() even though the class it was extending had no __construct in the chain of classes. I'm guessing some versions of PHP care and some don't. I have updated the module to remove that call. Please let me know if it works for you guys now?1 point
-
Hi! Here is my second work on PW: one page promo site for super mega cool strut mounts (some car stuff). www.ss20gold.com - ProcessWire 2.3.7 - multilingual; // pm me, if there are funny/wierd mistakes, please - scroll-scroll; - animated gif reincarnation; - about 50 times of Massive Attack - Heligoland in process. Thanks all of you, you guys are rock!1 point
-
Hey, k07n. Great website! Looks clean and informative. I must say I love Massive Attack, been twice on their live gig in SPb. My all time favourite is their classic Mezzonine - dark, hazy and trippy album. Pure delight! (Those who watched "House MD" might hear "Teardrop" in its opening titles) For lazy folks I'll leave the link to the album here. Give it a try.: https://www.youtube.com/watch?v=WCwfUX58IZw1 point
-
Peter, thanks for sharing this -- always interesting to hear how others are solving issues like migration from one system to another. I'll have to read this more carefully later, just had a chance to browse through and check out the code parts. Two quick comments on those, though: This might be just a question of preference, but it looks like you could've easily used Hanna Code for those snippets. Personally I've got a tendency to go with the "as little custom code as possible" route, and so I might've preferred that. You don't really need to redirect user to 404 page, especially not with a hard-coded path (though it's unlikely to change). You can get current 404 page with $config->http404PageID and use it's real ("dynamic") URL or you can simply throw a Wire404Exception(). Again, thanks for sharing this with us. Very much appreciated1 point
-
Most likely something with mod_security. Try creating a template that has nothing but a 'title' field, then create a page using that template and save. I'm guessing that'll work, because the POST has no HTML in it. Some hosts using mod_security just aren't friendly with rich text editors, especially multiple instances on the same submission. You'll want to ask your host how to disable mod_security.1 point
-
Another one finished (only german/swiss at the moment, english is in the works): http://www.helveting.com/ Responsive (also with responsive images + art direction via thumbnail module for the slider/header images) Form Builder for applications as always, the great thumbnail module from Apeisa Thx to Soma for the always used SimpleMarkupNavigation module and countless others ;-) Perhaps worth a mention: The locations overview, a combination of a repeater and Ryan's map marker fieldtype: http://www.helveting.com/about/organisation-und-standorte/ rendered with styled Google Maps Feedback welcome1 point
-
I mean the way our idol is describing it here: http://processwire.com/talk/topic/740-a-different-way-of-using-templates-delegate-approach/#entry6174 For most scenarios this is the best way for me. For bigger sites with a lot of different page types the "in main template logic" can get confusing or just too difficult. My structure is like that (simplified): /site/templates/ home.php standard.php ../tpl/ main.php ../css/ and so on. In my "real" templates (meaning PW templates) "home" and "standard" I define page parts like this (simplified): $title = $page->title; $summary = $page-summary; $body = $page->body; $contact = ""; if(count($page->contact)>0) $contact = $page->contact->title; $content = " <main> <h1>{$title}</h1> <p class='summary'>{$summary}</p> {$body} </main>"; include('tpl/main.php'); and in my main.php (simplified): <html> <head> (...) </head> <body> <header> (...) </header> <?= $content ?> <footer> (...) </footer> </body> </html> Of course there is much more. But the thing is: the main.php handles the overall markup, while the templates handle the logic. In this case I use only the standard.php file while I have more templates in PW admin for presenting different fields. In my standard.php I differentiate by querying if($page->template->name == 'location') { $content .= ...list some locations } for example.1 point
-
I've just been playing with upgrading the Foundation 4 profile to version 5. Here are my extensive steps for anyone that wants to attempt them: Overwrite all the .js and .css files Change <nav class="top-bar"> to <nav class="top-bar" data-topbar> in _main.php Fin! The Orbit slider works fine, and I wholly approve of the updated styles as they seem more refined in v5. I think it helps that the ProcessWire Foundation profile doesn't use much more than the grid, Top Bar and Orbit so upgrading wasn't too tricky.1 point