Leaderboard
Popular Content
Showing content with the highest reputation on 10/24/2012 in all areas
-
I know the bulk of you are coders and likely can figure this out on your own but for those who are not, I thought I'd throw this solution in here just in case someone else has a need for it. I created a simple widget-google-plus.php file for those who want to add a Google Plus widget to their sidebar (or elsewhere) in Processwire. To use, simply upload the attached widget, changing the profile URL to yours and add the CSS / tweak as needed. I've no clue how to build a module so I am doing this as a tutorial. First the logic: If you are anything like me, you crave customization. I hated the fact that Google wouldn't let me remove the border from around their google plus badge so I decided to create a solution of my own. Here's how it looks straight from Google: To get rid of this obnoxious border, I created a new widget (attached) with this code: <div id="googleplus_widget"> <span> <div class="g-plus" data-width="275" data-height="69" data-theme="light" data-href="https://plus.google.com/your-profile-id-goes-here"></div> <script type="text/javascript"> (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })(); </script> </span> </div> As you can see, it's wrapped in divs which I then styled with the following CSS: #googleplus_widget{ width: 280px; height: 50px; } #googleplus_widget span{ width: 200px; height: 50px; float: left; overflow: hidden; background: #fff; } #googleplus_widget span div{ margin: -1px 0 0 -1px !important; position: relative; } To use, simply modify the attached widget-google-plus.php with your google plus profile URL, upload to your ProcessWire installations /site/templates directory and go to Setup and then Templates within the back end of your install. The new widget php file should show up under the "Templates found in /site/templates/*.php" , check it off, click add template and then add it to your sidebar if you choose to do so. That's it. Hope that helps someone. I know it's a minor contribution but at the very least, this is recorded for me to reference later when / if I forget BTW. If there's an easy way to make this into a module, I'd love to be able to do so even if just for myself and future newbs. widget-google-plus.php3 points
-
Once installed, you'll see a new "Short Links" page under your site root. This is a bin for storing shortlinks - which are simply child pages. If you edit the "Short Links" page you'll see various parameters that control the automatic generation of link names. You should be able to leave these as-is with no problems (unless you need more than 27,000,000,000+ links in your bin!) The parameters, if curious, are... You can add as many bins for shortlinks as you like to your site, just create a new page using the template "LinkShortenerHome" and give it a relatively short page name. Anyway, let's add a short link now. From the page tree just click new next to the "Short Links" page. This creates a new shortlink page (uses the "LinkShortener" template) and automatically creates an unused, random, page name using the parameters we just looked at from the parent bin. Something like this... If you are not happy with the spelling of the generated shortlink (if it happens to be offensive in your native language for example) then you can change it now and hit the save button which takes us to... ..where we just type/paste in the target for the redirect this shortlink will make and then hit the publish button... ... and we can see the short link and a "Go!" link for testing it. That's about all there is to it except to say that it will help out the ProcessRedirects module if it is installed and you have configured the URL Shortener to help generate names for it. HTH.3 points
-
You just create fieldsets and use width column option. The trick then is to hide the fieldset label via css. Ive done it myself with teflon theme and will soon update it with same approach and also made the field labels white to remove cluttr.3 points
-
Adam is the designer, initial static html was done by me and Soma have made most of the grunt work (pw => html, lot's of tweaks and details). Current status is little blurry, Adam have provided new tweaked designs and those would require some front end coding. So there extra hands you guys are offering would come in handy. In the other news, we have been doing this for ages, so thinking that just releasing and tweaking it afterwards might be a good way to go too.3 points
-
Few days ago I've posted sneak preview of new admin template (it didn't have name then), so I've managed to squeeze some time to finish it and here it is... Ergo Admin Template DOWNLOAD https://github.com/nvidoni/ergo USAGE 1. Create folder named "templates-admin" under /site/ folder 2. Copy all files (including folders) into newly created folder 3. ProcessWire will load the new admin template automatically EXTRA If you would like to use custom TinyMCE theme created for this template, follow this steps: 1. Download TinyMCE Ergo theme from https://github.com/n...ni/ergo-tinymce 2. Copy "ergo" folder to /wire/modules/Inputfield/InputfieldTinyMCE/tinymce-3.4.7/themes/advanced/skins/ folder 3. Open /site/templates-admin/default.php and change in line 86 "default" to "ergo" If you find any errors please post them here so I can commit them accordingly. EDIT 1. Changes have been made according to diogo's and Soma's posts.2 points
-
Thanks for posting those, the screenshots answered it. Looks like I had an htmlentities() call without the 'UTF-8' in it for that header cite line. This has been fixed and committed to the source.2 points
-
Hey Antti, Not a theme (yet) - just a few CSS tweaks I made. Nico has seen it and keeps encouraging me to make a theme out of it.2 points
-
I've written a module that fulfils a small but hopefully useful need to provide clients with links to "live" but work-in-progress pages so they can be viewed by those that don't have a CMS login. The basic process is to add a "create draft" link to the page listing (after edit, new, move, delete etc). When clicked, this link creates a clone of the page and adds an MD5 hash of the current time to the URL so that a draft clone with an effectively "un-guessable" URL (name) is created that can be given out to clients to view the page. This clone has a "publish" link added to it in the page listing so this can then be copied over the original published page, and the draft deleted, with one click. The cloned pages also has "(DRAFT)" added to the title. Does this sound useful to anyone? The only problem is that, because the "draft" page is published it will show up in menu listings and anything else that is utilizing the site structure or API to grab live pages. If the "published" nature of the cloned pages makes this idea unworkable then I will go back to the drawing board! But if it has potential to be useful then I will at the very least publish the source on github or copy it in here so it can be tampered with by others. It occurs to me that it wouldn't be hard to filter out these pages with "(DRAFT)" at the end of the title so they don't show up in menu listings etc, but this would require extra effort on the part of the developer in every case where the fetching of pages is occurring.1 point
-
Hi, I just rebuild my website using ProcessWire: http://nico.is/ Should be working on all major browsers (that excludes IE). Two things: - The "browsers" are build with pure CSS3 (not the arrows) - Have a look at the footer / Nico1 point
-
thanks for the input. Will fix these things when I got the time. I owe u both a coffee1 point
-
This is exactly correct. Lets say you've got this page /user-profile/ in your site. You also have a template called user-profile, and it has URL segments enabled. In the code, all you need to authenticate is to compare $user->name to $input->urlSegment1. Meaning if user 'onjegolders' accessed the URL: /user-profile/onjegolders then you would allow them to make changes to their profile. if(!$user->isGuest() && $user->name === $input->urlSegment1) { // user is authenticated and may change their password if($input->post->submit_pass) { if($input->post->pass !== $input->post->pass_confirm) { echo "<h2>Passwords do not match!</h2>"; } else if(strlen($input->post->pass) < 6) { // if you want to enforce a minimum password length (recommended) echo "<h2>Your password is too short. Must be 6 characters or more.</h2>"; } else { $user->of(false); $user->pass = $input->post->pass; $user->save(); $user->of(true); echo "<h2>Your password has been changed</h2>"; } } echo "<form action='{$page->url}{$user->name}' method='post'>"; echo "<p><label for='pass'>Change your password</label>"; echo "<input type='password' name='pass' /> "; echo "Confirm: <input type='password' name='pass_confirm' /></p> "; echo "<input type='submit' name='submit_pass' />"; echo "</form>"; } The above was just written in the browser so may need tweaks.1 point
-
Technically the pageName sanitizer isn't actually necessary here (as PW wouldn't even get the request if the pagename wasn't in the right format), but it is a best practice to sanitize anything you are planning on putting in a selector. So I would do it the same way as apeisa and sanitize with pageName, even if it's not technically required.1 point
-
Wow this needs to be made into an admin theme. I really like the look of this!1 point
-
The infinite scrolls drive me nuts. But I agree it would be fun to see how one has implemented this.1 point
-
I have usually created custom $page->root and used that. root parent is still useful, kind of replaces get(1) when using multisite.1 point
-
Sounds good Michael. I start today with a very basic template for the shop.1 point
-
Thanks to both of you! I wasn't aware of the sanitizing process… Works like a charm! I'm using the page name because it appears in the URL and i want to keep them clean.1 point
-
Just as Soma mentioned, use the FieldSet field type to create your columns, and then set their width so they float next to each other. In my case I made 3 FieldSet columns. (column_1, column_2, column_3) — although I only used 2 columns in the screenshot above. I didn't want to change how the admin looked anywhere other than within these columns, so the only thing I changed about the default theme was a few lines of CSS that are specific to these columns. You can grab the CSS here1 point
-
One thing to remember: there can be multiple pages with same names (but with different parent). But here is how you do it (this returns the first page it finds): $myPage = $input->urlSegment1; // Remember to sanitize! $myPage = $sanitizer->pageName($myPage); // $pages->get() returns single page while $pages->find() returns PageArray $p = $pages->get("name=$myPage"); // And finally, we want the url echo $p->url;1 point
-
Sorry guys, absolutely no time for a chat today. But how about setting up a Google Document or so, which we can fill with ideas, requirements etc?1 point
-
I've stuck the code on github, perhaps someone would care to give this a quick test before I publish it into the module repo here? https://github.com/robphilp/ProcessPageDraft1 point
-
arjen hinted you the solution. 1 Loop: You have a page field with multiple pages (array) so you need to loop them. 2 Loop: Each page has files so loop it and output them. $file_pages = $user->files_link; if (count($file_pages)) { foreach($file_pages as $file_page) { // loop pages! $files = $file_page->files; foreach ($files as $file) { // loop files! echo "<a href='$file->url'>$file->description</a>"; } } }1 point
-
Looks nice renobird! Could you point out how to start making columns? From there I can figure it out myself, but at the moment I haven't got any clue! Thanks!1 point
-
It's very nice & clean, I like it. If you'll have time it would be a cool theme.1 point
-
It looks great. I think it is does superb job to make admin feel little less "lot of boxes with borders". Hopefully you get it released at some point!1 point
-
1 point
-
1 point
-
how .about edit /site/templates/markup/posts.php cha.nge if($total) echo "<h3>" . sprintf(__('Posts %1$d to %2$d of %3$d'), $start, $end, $total) . "</h3>"; to if($total && wire('page')->id > 1) echo "<h3>" . sprintf(__('Posts %1$d to %2$d of %3$d'), $start, $end, $total) . "</h3>";1 point
-
check oot minddk.play make module https://github.com/mindplay-dk/PageListPin also.can use bread crumbs trailers en admin1 point
-
Thanks Ryan, I managed to sort this out by sticking with the repeater option, but instead of using a repeater as a singular method for date entry, I used it for "additional dates". That way, the majority of events are entered with a typical start/end date, but events with more complicated schedules can use the repeater. I set the ready fields to 2, that seems like a good place to start. I think this will be less confusing to the people entering events — at least I hope. See attached. (note: tweaked the admin via FieldSet to create 2 columns for calendar entry, I love how flexible PW is.)1 point
-
1 point
-
1 point
-
I would love if renobird/tom would contribute to the front-end dev. @renobird: I guess you have to talk to adam if you really want to1 point
-
We have been developing it with varying speed for a long time already. How does it feel for you guys? Any ideas where to improve? Direct contributions to css are also welcome I think. Jbroussia: not exactly a framework, but it is built using goldilocks approach. I think it is still one of the best ways to do responsive design.1 point
-
1 point
-
I just wanted to share that I just published a ProcessWire review on CMS Critic. If you have anything to contribute as to why you love ProcessWire, please share in the comments. Thanks guys!1 point
-
Due to the name change, the module is now here: https://github.com/mindplay-dk/PageListPin I have tagged it as 1.0.0.1 point
-
I've not tested this code but it's a first guess at how I might try this. It assumes $email and $pass hold sanitized input from a custom login form. $who = wire()->users->get("email=$email")->name; if($who) $user = wire()->session->login($who, $pass); if($user) { // they authenticated ok... } else { // they didn't }1 point
-
I think it definitely is possible with ProcessWire, a lot of the building blocks are already there. I do think that it will take a considerable amount of programming to make it do exactly what you want. Some modules for like/dislike functionality, follow, notifications, streams, front-end logins and such. PW isn't a social platform out of the box. If you are already comfortable with something like Symfony it may be faster using that. Another option would be to checkout specific social networking solutions like buddypress.org or elgg.org1 point
-
I posted a comment on the module page. At the bottom it says åäö ÅÄÖ. Image attached so you can se the encoding in "my" admin. Thanks for looking in to this! EDIT: Added another image for clarity.1 point
-
Forgot to mention: you can do a PW style 'or' in the field part of the tag. Like this... Look at the "{title|name|id}" page to... Or this... Hello {user.firstname|name>title}, ...1 point
-
Minor misunderstanding: when you said "I cannot simply put the .php file in the styles folder and include it in my templates", I thought you meant "include" literally -- using PHP include(), that is. Sorry, my mistake. Anyway, including content of style.php inside <style> tag (instead of linking to it with <link> tag) definitely is one way to do this, but not what I meant. That way user would have to download those styles again for each page they view instead of letting the browser cache the stylesheet file on first load. What Soma was explaining above is pretty much exactly what I meant with option 1: put your style.php into root or a folder in it, at the same level with /site/ and /wire/ directories. Let's imagine that your site lived in /example.com/ directory: /example.com style.php /site /wire This way you can link it to any other template with <link> tag. With option 2. above I meant a structure like this: /example.com style.php => only things you'd put in this file would be CSS header and "include(./site/templates/style.php);" /wire /site /templates style.php This second method is no "better" than first method, mostly just more complicated. It'd let you put your style.php inside templates folder, though, if that's what you want; I myself prefer to keep all template-specific content there, so I always know where to find them when making changes. This method isn't pretty but it does allow for style.php to live inside templates directory and still get referenced with direct URL. By the way, if I may ask, what kind of stuff are you using PHP for in your stylesheet? I'm just trying to wrap my head around exactly why you'd wish to use PHP in your stylesheet but not have it as a PW page -- wouldn't it be nice to be able to, for an example, manage possible variables directly from PW?1 point
-
This one has been on the @todo list for a long time, as it's kind of a tricky query to implement. Go ahead and try out the latest dev branch, which should implement this capability. So far it seems to be working here, but could definitely use more testing.1 point
-
Hi, today I want to introduce my biggest and most powerful module until today: ProcessPermalink. The main function is to change URLs of pages so that you can customize the pages URLs (e.g.: http://example.com/article/abc/ -> http://example.com/2011/10/10/abc/). You can set a separate URL formats for each template under "Your Template -> URLS -> Permalink Format". For this, you can use the following placeholders (I'll add some more in the future): %name%, %author%, %id%, %year%, %month%, %day%, %hour%, %minute% and %second%. It's not perfect right now but it's working. Unfortunately you have to do two core hacks to make some core functions hookable: Change "buildEditFormURLs" to "___buildEditFormURLs" in line 916 of "wire/modules/Process/ProcessTemplate/ProcessTemplate.module" Change "path" to "___path" in line 865 of "wire/core/Page.php" Another problem is that you have to add a URL format to every existing template and to every template you'll create in the future. And something that will probably be missed right now is %parents% (and maybe something like %default%) but I'm working on it. But I would be happy if you could try it out and report errors to me so that I can optimize it. You can download it here: https://github.com/NicoKnoll/ProcessPermalink Hope it will work for you! Greets, Nico1 point