Leaderboard
Popular Content
Showing content with the highest reputation on 11/12/2014 in all areas
-
6 points
-
Just a simple contact form including spam protection. Optional support for Twig (TemplateTwigReplace) as template engine. --- Please have a look at the readme on github! If you upgrade from version 0.0.9 and below, there are some extra steps to be taken. The Guides Installation Module Settings Spam Protection Usage Logging Upgrade Notes4 points
-
get(selector) does a findOne(selector); findOne(selector) does a find(selector)->first(); $pages->get('parent=/blog/, sort=sort')3 points
-
There's also the chance that you could simply create these as child pages of a page. At the beginning it may sound strange to do it that way, but It's actually the cleanest way and makes everything very clear to you and to the client. Plus, if you set the template of these pages to admit only one parent, you will automatically have a quick button in the admin to create these pages.3 points
-
Update: Blog is now in version 2.2.2 (merged changes in dev version to master). See changelog here: In the coming days, I will update the docs with the changes introduced in this version3 points
-
This module is obsolete and will not be developed any further. Please use the ImageExtra Module instead. Overview This module allows you to add additional informations to an image (for example: title, description, link, orientation and any field you may need). If you want to, you can install FieldtypeImageExtraLanguage to get multi-language support. For more informations have a look at the readme. Installation 1a. Clone the module and place FieldtypeImageExtra in your site/modules/ directory. [OR] 1b. Download and unzip it from the module page. git clone https://github.com/justonestep/processwire-fieldtypeimageextra.git your/path/site/modules/FieldtypeImageExtra 2. Login to ProcessWire admin and click Modules. 3. Click "Check for new modules". 4. Click "install" next to the new FieldtypeImageExtra module. If you need multi-language support, you have to install the FieldtypeImageExtraLanguage module. 5. That's all - no settings are required but possible. Define your custom fields 1. Login to ProcessWire admin and click Modules. 2. Open `Images Extra Inputfield` Settings. The following fields are available by default: orientation - image orientation orientation values - values to use as classnames or identifiers for different image orientations title - image title to use for title/alt tag or/and caption, if empty, the content will be generated from the applications filename description - image description link - image link to internal pages If these fields are not enough for you, you can add any other field (for example _author_ and _location_) by writing it (separated by comma) in the field otherField. If you don't need all custom fields, you can easily disable them. One more exception is orientationValues. Here you can insert identifiers for classnames or similar separated by comma. This values will be available in a dropdown list. Usage 1. Under Setup and Fields create a new field using type `ImageExtra` or `ImageExtraLanguage`. 2. After entering the new field name and label, click Save. 3. Configure it depending on your own needs. 4. Save. 5. Add your new field to one or more Templates. Accessing the value This is no different than accessing the value of any other field. $image = $page->image->getRandom(); echo $image->title; echo $pages->get($image->link)->url For use with TemplateTwigReplace {% set image = page.images.getRandom() %} {{image.title}} {{pages.get(image.link).url}} Screenshots Here is a litte example how to access the new fields: // if there are images, lets choose one to output in the sidebar if (count($page->images)) { // if the page has images on it, grab one of them randomly... $image = $page->images->getRandom(); // resize it to 400 pixels wide $image = $image->width(400); // output the image at the top of the sidebar $sidebar = "<img src='$image->url' alt='$image->description' />" . "<h3>$image->title</h3>" . "<blockquote>$image->description</blockquote>" . "<p>$image->author ($image->location)</p>" . $page->sidebar; }2 points
-
If you want results in a specific order, use "sort": $pages->find('parent=/blog/, sort=sort')->last(); // and if you want just one item, don't forget limit // (or use get(), and check viewability separately) $pages->find('parent=/blog/, sort=sort, limit=1')->last();2 points
-
I think it's just about presentable, so here is, my own blog, http://dpreston.com. It uses Kongondo's excellent blog module (which I butchered somewhat in the process) and a couple of others as noted in this post, and takes advantage of a CloudFlare free account to benefit from spdy and https. Nothing fancy, but I'm reasonably happy with it.2 points
-
This module adds a "SEO" tab to every page where you can define a special title, description, keywords, etc. Try it http://aluminum-j4f.lightningpw.com/processwire/ Name: demo Pass: demo123 How to use You can choose between include automatically or use the following methods: $config->seo // includes all the default values and configuration settings // e.g.: $config->seo->title $config->seo->keywords $page->seo // includes all the default values mixed with the page related seo data // e.g.: $page->seo->title $page->seo->keywords // for rendering: $page->seo->render . . Screenshot Download You can download it in the modules repository: http://modules.processwire.com/modules/markup-seo/1 point
-
1 point
-
The Netherlands are writing History. For the first time in history, a space vehicle has landed on a comet. This happened today at 16:05 GMT The project is under Dutch supervision by Fred Jansen. Landinggear, solarpanels, explorer testing was all done in the Netherlands. It took the carrier 10 years, 5 months and 4 days to reach the comet. The comet has almost no gravity so there was a risc for the explorer to bounce back after the landing since a pushing thruster failed to work as also 3 harpoons don't seem to work. It takes about half an hour for a radio signal to reach the Earth. But today the explorer has left the carrier and landed successfully on the comet. The comet has a size of about 3 x 5 kilometer and is now at a distance of about 500 million kilometers from Earth. There are many sources where you can find more info here is one of them: http://www.theatlantic.com/technology/archive/2014/11/for-the-first-time-humanity-is-landing-on-a-comet/382664/1 point
-
1 point
-
Thanks Charles. It is a similar issue but extends a bit further. In the case you linked to, the poster was only concerned about the admin account. In the case here, it is that as well as any other account really.1 point
-
I remember there was a similar issue with the Blog Profile. https://processwire.com/talk/topic/1394-blog-profile/page-6 I believe that issue dealt with displaying the admin account name when listing the Authors. I don't know the details of how your Blog module is setup, however the solution presented for the Blog Profile was pretty nice.1 point
-
Thanks Teppo, that was bang on. Thanks Mats, didn't know that one either.1 point
-
As a tech demo I think it's great. As a mechanism for turning browsers into leads, I'm not so sure it'd give you a great response. I don't think you have provided someone is at the stage where they know what they want or they're ready to divulge that info That's quite a gamble up front. IMO you want to start off with the broadest conversation possible with the least amount of fields. Before you start funneling people down into specifics you could have a form which asks for : Name: Email: Company: How can we help? This way people can free type in the "how can we help" field. If they have specific details at hand, they can tick a box titled I have project details ready (Yes/No) which loads the larger form. But make it clear to people that they don't have to go down this route.1 point
-
There are multiple ways of doing what you seem to describe. Check out the fieldtypes repeater, multiplier, page, and pagetable, for example. Some of these are ProFields that you can license for little money. Which one is best suited depends on the kind of data you want to store. You can’t add the same field to a template multiple times. You either have to use one of the repeating fieldtypes that work similarly to image/file, so you can have multiple values per page, or create more fields. For example, it might make sense to have a field for a phone number and another for a fax or mobile number, instead of one repeating field where it might be difficult to tell which is which after the fact.1 point
-
Email and phone are extremely annoying in Firefox desktop as well. They’re very picky and don’t work well with standard keyboard commands. My first instinct was that the tab key takes you behind the @, instead it took me to the next field and threw out all my previous input. Then I tried End, which didn’t work at all. It never occurred to me that you have to type the @ yourself. Also pasting doesn’t work and neither does arrow-down to show the browser’s suggestions. Those are probably the most common ways people enter their email addresses. +11 point
-
I think you're talking about repeaters. This fieldtype is in the core of processwire but by default it's disabled. You can enable it in the modules section. You can find further documentation here: http://processwire.com/api/fieldtypes/repeaters/.1 point
-
1 point
-
Hmm, that's an interesting observation Russell. Let me have a think...I see two solutions... 1. Use the $sanitized->pageName() of the author 'display name', e.g. if John Doe, the link will be /authors/john-doe/. The potential problem with this is that in blog-authors.php, we need to get the name (i.e. user name) of the author in order to return their posts. OK, it is still possible to get the user by working it out from their pageName sanitized display name but that is not foolproof. There could be two John Doe's? 2. Use the user's ID in the link, e.g. /authors/1234/. In a link that's fine but in the URL that's not nice. I'll see if I can use this option but with a 'prettier' URL. Glad to hear other thoughts! I aim to resolve this quickly.1 point
-
Oh sorry I think I've confused you. The module was not updated by the update process. I ran the "update from url" step, but then when I looked today, the module was still the old one. No drana I just downloaded the .zip again and overwrote with the new module. As for aurhor name, I have it displaying my name fine, but the problem is the link url still shows the username, not the display name, thereby giving someone withp malicious intent a foot into the backend door.1 point
-
I can't fill the email and phone field etc on my mobile. There's js going on that makes it impossibLe.1 point
-
Looks good to me. In the text on the left, I would clearly say that they can contact you by phone and talk about everything or if they prefer they can fill the form. I wouldn't recommend anyone nowadays a non responsive / or non mobile website. I'd rather explain this somewhere else as a quality aspect of your websites. I also wouldn't make Company Name a required field. just my 2cts1 point
-
This is a nice looking, clear design. I don't miss borders around the form fields or focus styles at all. But this depends on personal preference, I guess. The light grey type renders clean on Linux Chrome and FF But to me it could need a little more contrast. Personally, I hate long forms like this. Maybe you want to split it up and make it a multi page form. Your idea of breaking the form into a wizard would help in keeping it shorter. From my own experience it is easier to obtain the info that you want to collect through your form in a personal chat with the client. A long form like yours would drive me away. So you might want to consider asking less questions and trying to put the focus more on convincing the clients to give you their contact details. Then you can call them and talk about all that other stuff.1 point
-
Okay, so we all like to think we are super organised when it comes to planning our ProcessWire site, but sometimes life is not like - we are uselessly lazy and can't even make our coffee in the right order (is is add the whisky first or second?). So, here are a couple of really lazy ideas to make everyone feel better about messing up. First Lazy idea Oh, I forgot to create a field! (or two, or three....) On the template edit page where you add the fields, how about a Create New Field button that allows you to create a field and add it to that template. Probably opens a modal window to create the field. Second Lazy Idea OH, why didn't I create the field BEFORE I created all these templates? No Problemo! On the field Info tab where you can see which templates use the field, what about having another box that lists all the templates that do NOT use the field and are displayed in columns with little check boxes next to them - tick the boxes and save to add the field to those templates. Third Lazy idea Adding a group of fields to a group of templates. I have actually just changed this from what I was going to suggest because my original idea was not lazy enough - far too much work for the user. So, you get a new button at the bottom of your list of fields and a check box next to each field. Hit the check box and the button gives you the option to Add fields to Template. A modal opens where you can change the order of the fields and select which templates you want to add them to. In addition, you get the option to add them within a tab set or field set and give that a name. Click Add and all those fields are added to the templates in the order you have set them. (Note, if any of the fields have already been added to any of the templates, then it either does not add those fields and tells you which were not added to which templates, or it fails completely and tells you which were not and so on.) Fourth Lazy Idea Lazy blokes template creation with fields. So, you suddenly realise you need 20 more templates with 18 existing fields each but you haven't got a handy dummy template with the right fields in. Don't panic. On the new template screen, simply select the fields you want, complete with tabs, field sets, and the right order, then choose the templates you want to create as normal and done! Wow, that was lazy! Fifth Lazy Idea I can't remember what I am doing where, why and when! So, this is a new screen under set up called something like Field Matrix. Basically it is a large, scrollable chart that has fields down the Left and templates across the top. From this chart you can now see which fields are being used on which templates shown by ticks and crosses. PLUS! You can actually add and remove fields from templates by clicking on their tick or cross to change it. THIS IS REALLY DANGEROUS (and probably a bad idea) but it is also wonderfully lazy! Doesn't all that laziness feel good? So there you go: Five lazy ideas to help tired, overworked, and disorganised web people get through their day, Joss (I know, far too many changes in one go - but I enjoyed thinking about them!)1 point
-
Something else I've just come across. Since I'll be probably posting articles and don't particularly want to swap between an admin login and an author login all the time, I was hoping for some way to change the Author links to use the display name, instead of the username. I'm guessing this would require module changing and not just something I could code myself while still using the MarkupBlog author functions?1 point
-
1 point
-
1 point
-
@Mary...With the current module you can't...but...with the following simple change, you can . Of course, you can always just request Ryan to make this configurable (i.e. whether to completely hide the field or just lock it down, etc)...Meanwhile.... 1. Create a custom copy of the module 2. Rename the module file from PageEditFieldPermission.module to say PageEditFieldPermissionCustom.module 3. Rename the module class similar to #2 plus change all instances of PageEditFieldPermission (whole word) in the module code to PageEditFieldPermissionCustom 4. Change line #91 in your PageEditFieldPermissionCustom as shown below (see inputfield collapsed setting constants here) //if($field) $field->parent->remove($field);//comment this out if($field) $field->collapsed = Inputfield::collapsedNoLocked;//add this line Haven't thoroughly tested...1 point
-
Today I've created a really simple little module that is configurable and attaches to hooks. So it has more or less everything of a real world module in it. I thought processwire beginners would be interested in reading how to create such a module so I added some comments to the source code in a way the module should explain itself... Here it is: /** * BackgroundChanger module for demonstration purposes * * Demonstrates the Module interface and how to add hooks in a more real world manner... * * ProcessWire 2.x * Copyright (C) 2014 by Domenic Helfenstein * */ class BackgroundChanger extends WireData implements Module, ConfigurableModule { public static function getModuleInfo() { return array( /* * the __("text") methods are used for multilanguage support * see: https://processwire.com/api/multi-language-support/code-i18n/ */ 'title' => __('BackgroundChanger'), 'summary' => __('This is a simple real world module that can change the background color.'), 'version' => 105, /* * autoload must be true if the module depends on hooks * see: http://wiki.processwire.com/index.php/Module_Creation#Details_of_what_the_.22autoload.22_property_means */ 'autoload' => true, /* * it is wise to run modules in singular mode when using hooks * see: http://wiki.processwire.com/index.php/Module_Creation#Details_of_what_the_.22singular.22_property_means */ 'singular' => true, ); } public function __construct() { //set default values $this->backgroundColor = 'yellow'; /* * !!! the value in the db will be automatically injected into this var * because it is named equal to the value of $field->name in * getModuleConfigInputfields !!! */ } public function init() { // add a hook after each page is rendered and modify the output $this->addHookAfter('Page::render', $this, 'changeBackground'); } public function changeBackground($event) { $page = $event->object; //do only modify non-admin pages if($page->template == 'admin') return; $extension = <<< _OUT <style> body {background-color:{$this->backgroundColor};} </style> _OUT; $event->return = str_replace("</head>", $extension."</head>", $event->return); } public static function getModuleConfigInputfields(array $data) { //create a fieldset $inputfields = new InputfieldWrapper(); //create field for background color $field = wire('modules')->get('InputfieldText'); $field->name = 'backgroundColor'; $field->label = __("Enter the hex-code or name of the desired background color. (visit colorpicker.com)"); //if there is already a value stored, set this value to the field if(isset($data['backgroundColor'])) $field->value = $data['backgroundColor']; //add the field to the fieldset $inputfields->add($field); //return the fieldset to display return $inputfields; } } I hope this helps others creating their own modules! BackgroundChanger.module1 point
-
Hi Philipp, You can do this Check out the module config options of "InputfieldPageName" - you can actually edit the replacments there.1 point
-
Using your existing example, you could do it this way, which is a little simpler and less code. Basically you'd just add your own 'totalPages' temporary variable to each category… and use that in your output. That way you don't have to retrieve those categories any more than once (it would execute faster too). $categories = $pages->find("template=kom_catlanding"); foreach($categories as $category) { // populate your own made-up variable: totalPages $category->totalPages = $pages->count("template=kom_project, project_services=$category"); } echo "<ul id='catcloud'>"; foreach($categories as $category) { echo "<li><a href='$category->url' class='$category->totalPages'>$category->title</a></li> } echo "</ul>"; If you wanted to sort them by count or something, you could do this: $categories->sort('-totalPages'); // sort most to least1 point