Leaderboard
Popular Content
Showing content with the highest reputation on 09/26/2015 in all areas
-
It's been an extremely busy last few months for me, but I finally managed to launch Christopher Todd Studios: http://christophertoddstudios.com/ I'm using my go-to frontend approach, which is based off of Sage. Some frontend packages I'm using include: Bootstrap SASS Animsition for the page transitions Slider Revolution for the home page slideshow (using the Ken Burns effect) Slick Carousel for the portfolio slideshows (with the lazy loading feature enabled... very important) Ekko Lightbox for the video modals Headroom.js for the navbar hide/show interaction jQuery Lazyload for other image lazy loading (like the blog) MatchHeight for some areas that need matched heights ResponseJS for loading content when a specific breakpoint is hit (rather than it being loaded but hidden, which is bad for performance and sloppy; very important) Linearicons I wrote the slideout navigation menu myself. Just some CSS and JS. My goal was to make sure this site is fast and doesn't feel clunky. I feel it has met that objective especially with the performance and optimizations that have been done (there's still a few I will eventually get to and squeeze out even more performance). In terms of ProcessWire modules being used: FormBuilder is being used and it's submitting results to Tave, which is a lead management system. FormBuilder made this easy with its 'Send duplicate copies to to another URL or 3rd Party Service' feature. Image Extra Social Share Buttons Page List Image Label Hannacode The original site was based on WordPress and had many blog articles. Using Ryan's great writeup, I imported all the posts into ProcessWire. The blog setup is self made and inspired by the Blog Profile (not using the blog module). The original site also didn't have permalinks enabled in WordPress, so I wrote some code to capture the necessary URL variables and forward them to the correct page so that old links are maintained, which is also good for maintaining SEO. The client loves ProcessWire and its simplicity.6 points
-
Hello everybody, I found about processwire when in search of a new CMS for my sites. Mainly there were articles in blogs that made me curious. I found it difficult at first ... wasn't used to the freedom the system gives me. Yes it's a freedom to have fields and templates for whatever you like. But coming from other cmses one is not used to having that freedom. In most cms you're told what to do where and how. Processwire is different. Also ... the many tutorials are very helpful, the API docs , the forum. Though I didn't need to ask questions here myself up to now I found answers for all the problems that arose while working. Putting it together: I feel comfortable here and hope to make some more sites with it.3 points
-
Using Hashids you can accept encrypted page IDs in a querystring, decode them for use in selectors. Why would you want to do this? In my case I have a private calendar feed where each calendar is a page, but i don't want people seeing the page IDs and then possibly guessing another person's calendar id. 1.) include the hashids class, either with the composer or in my case i'm using the old version which is 1 php file (you can find this in the wordpress plugin version). 2.) Depending on which version you use, the method is different; read the docs to see which version you need; my code is relevant to the old 0.1.3 version which is good enough for this application. include('./classes/hashids.php'); $hashids = new hashids('your_unique_salt_here'); if($input->get->cal_id) { // the cal id coming in is a text hash ID: $cal_id = $sanitizer->text($input->get->cal_id); // decrypt the hash ID to the integer $cal_id = $hashids->decrypt($cal_id); // Look up the calendar: $calendar = $pages->get($cal_id[0]); if( !$calendar->id ) exit('Calendar not found.'); // at this point you would execute your actions, e.g. render your calendar feed etc.. exit(); } You would also need a way to generate your links wherever you are sending or displaying them, with the hashed ID. $calId = $hashids->encrypt($calendar->id);1 point
-
You're using limit in both selectors and pagination does set the start value automatically, if there's non present. That's why both finds do get paginated. Add start=0 to the widget selector and it works.1 point
-
There's currently no option in the admin UI to add images to the image-field from an external url. Via the api you can just use $page->imageField->add($url);, but I doubt that's what you're asked for. About that description field, are you talking about literally two separate fields both called description? If so that would be a bug. If there are two separate fields they should be called description and tags. If you're just talking about a single multi-line field which is labeled description, than it's caused by a setting of the image field. You can change the field to show as many lines of description as you need.1 point
-
@Adrian: One day later, I think the best way really would be to have an upload / import function for svg-images, where they get prepared for further usage in the module. At least this should include to check/set width and height to 100% and to inject a css-color-var. That said, you need to drop or reformat my usage with the svg-template. But I think this isn't the big part of the changes we will see! Regarding the storage of the original / source images, (DB or files), I think DB is saver. Files easier can be changed / deleted by accident. I'm very happy that you take it and bring it further. PS: I have updated the gist to version JamesBond, (0.0.7). Mainly added/corrected the presentation function, what draws nice overview charts.1 point
-
Hi FreeAgent, the renderNav function only processes the items within the PageArray just in the order how you have created the PageArray. So, you don't need to change the renderNav function, you need to sort the items of the PageArray in the order you want them to be displayed. First thing is: how have you managed the order in the admin pagetree (in backend)? have you set the blog children to be sorted newest first? ("-created") If not, you I think you should set it this way and I expect that this order will be used to build the PageArray what is passed to the renderNav function. Changing the sort order for a pages children can be done by opening the relevant page for editing, selecting its children tab and go down to the field "sort settings". --- --- --- And going one step further: To ignore the selected sort order of the Admin-PageTree and to sort items of PageArrays by the API is also possible and used very often. // here you collect all children of the current page $pageArray = $page->children("sort=-created"); // here you first "get" the blog-page (the parent / rootparent of all blog entries) and then collect all of its children $pageArray = $pages->get("name=blog")->children("sort=modified"); // with the selector string you can, (besides others), also pass a param for the sorting order // "find" something different: $pageArray = $pages->find("template=news, sort=-modified"); // it is possible to sort by other things, please refer to the docs . Also useful is to refer to somas awesome cheatsheet.1 point
-
To make it the default Theme for your site(s) is very easy: go to modules and install renotheme go to the guest user and select renotheme as the default admintheme Ready! I think, when building a new site, everyone uses his / hers individual "starting site profile" with some modules allready installed or some setting tweaks. If you do so too, you need to switch renotheme to be the default only once for the next couple of years. Besides that, my experiences are that for many less techsavy users, the default theme looks to be more cleaner (empty!). For those, I like to put everything out of the way and give them the most possible minimalism admin backend. And this is best done with the default admin theme. Another fine thing is, that you can enable both themes and give the user(s) (by roles) the choice to select / switch their default. Sorry for being a bit redundant on this.1 point
-
I figured it out. If anyone else is trying to do this here was the very simple change to get it working... if ($page->parent->name == "blog") { echo "social share stuff"; }1 point
-
Hi FreeAgent, If I get you right, then you have a page with name "blog" under the homepage. If the current page is a child of "blog", you want to display the shares, right? if ($page->rootParent->name == "blog") { echo "social share stuff"; } // if this doesn't work, you can try additionally if ($page->rootParent->name == "blog" && $page->name != "blog") { echo "social share stuff"; } PS: the editor button with this sign: <> opens a box for code.1 point
-
I have liked the Default theme from the beginning and I also think Reno is a great alternative. I use the Default theme all of the time. Occasionally, I will use the Reno theme just to make sure any client using it won't have any issues. My clients have never had a problem with using the Default theme. Some of them do like the Reno theme and some of them are more comfortable with the Default theme. I like the fact that you actually have a choice in ProcessWire and certainly wouldn't mind if there were more alternative themes.1 point
-
1,5 month later, after I did most of the project and be sure that I understand PW system, I finally finished that part. It's not perfect of course but it's working fine. Here is how I did it: Templates And Fields: I created 2 templates: grid and grid_item and 1 pagetableextended field grid_items. In grids page I can enter grid_items like below: Title, summary, featured_image for content on the grid items, external url for obvious reasons, grid_ratio is to determine size of item. Design is limited with ratios from 1x1 to 3x3, so I made it selectable page items from options use_border : for images with white bg, so they don't look like they are floating Modules I have created 3 modules. InputfieldGridBuilder,FieldtypeGridBuilder and GridBuilder. Whenever I save the page, new items from grid_items pagetable are available to use like below. I can order items, add new rows, delete row etc. Whenever I change something, there is a method that works to serialize data to the hidden input field,InputfieldGridBuilder. Also, just in case I call the function it every 5 seconds. I make a small fixed grid that is very similar to the one used in the frontend. So anything that you can do here with jQueryui sortables, it's available for using in the frontend. Last module GridBuilder is used for mostly utility purposes for both frontend and backend. It has methods like getItemSize, getItemImage, build etc. Frontend Normally these will be used in homepage but I made the view of page available to users with editing roles, so before using them they can see that it look like. For example this one in the gif above looks like this. So even with the empty rows, it works. And for using in the homepage, I added a multiple selection page field. So they can use more than one grid, or with the location options we already added they can select to have a different view for different countries. (I added Location settings is globally for every page) Questions, critics, feedbacks or "hi,there buddy"'s are highly welcomed.1 point
-
@caribou, I have been working on a commercial module that does exactly that (minus the thumbnails in the selected pages list). It is nearly done. A few things remain, such as the CSS. See screenshot below for a (unfinished-state) preview. I will try post a video demo later today. I'll be looking for beta testers so might PM you if you are interested. Thanks.1 point
-
The default installation profile of processwire does include a _func.php with an renderNav() function. I suggest taking a look at that one, as it does create that exact structure.1 point
-
You could filter them out in a temporary array...e.g. //example code $interests = $pages->find('template=poi, interests!=""'); //method 1 foreach ($interests as $int) { foreach ($int->interests as $p) {//interests is a multi page field; PW returns them as objects $array1[$p->id] = $p->title;//overwrite duplicate ids in the array key } } //method 2 foreach ($interests as $int) { foreach ($int->interests as $p) { if(in_array($p->id, $array2)) continue;//if we already have that id, skip it $array2[] = $p->id; } } //testing echo '<pre>'; print_r($array1); echo '</pre>'; echo count($array1); echo '<hr>'; echo '<pre>'; print_r($array2); echo '</pre>'; echo count($array2); Above are just examples. You could even store objects in the arrays, or create a temporary WireArray and store them in there. WireArray and PageArray docs: http://processwire.com/api/arrays/ Btw, the above code will not do the counting you want. That's easily doable as well... Edit: Reading your question again, this is probably not what you want...Oh well, code stays though..1 point
-
UNTESTED, probably have some typos + poorly formatted code (I gotta run...) You want to add this to your template file....Wrap it around code that ensures only Superuser can load the code... //absolute path to a directory called 'tmp' within the site folder where we have our images $dir = $config->paths->site . 'tmp'; $addAndPublish = false;//true if you want to publish on save //prepare some variables we'll need later $a = 0;//for photo pages count $failed = array(); $parent =$pages->get('/portraits/'); $t = wire('templates')->get('your-portrait-template-name'); //if we found the directory (here we use Standard PHP Library (SPL)) if (is_dir($dir)) { $directory = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); //iterate through each file in this directory foreach ($directory as $path ) { set_time_limit(30);//we try to avoid timing out //Remove and delete invalid file types $validImagesExts = array('jpg', 'png', 'gif', 'jpeg'); if($path->isFile() && !in_array($path->getExtension(), $validImagesExts)) { unlink($path);//we delete the invalid file continue; } //if valid image file we create a page named after it and later save it to the page if($path->isFile()) { //we are ready to start creating pages... $p = new Page(); $p->parent =$parent; $p->template = $t; $title = $path->getBasename('.' . $path->getExtension()); $p->title = $this->sanitizer->text($title); if (!$p->title) continue;//skip to next if no title found (just in case) $p->name = $this->sanitizer->pageName($p->title);//sanitize and convert to a URL friendly page name //check if name already taken if($p->parent->child("name={$p->name}, include=all")->id) { //if the same name already exists, add it to the $failed array [to display to user in error later] and skip to next title if ($path->isFile()) { $failed [] = $path->getFilename(); } continue; } //if add and publish is false, we save new page unpublished if (!$addAndPublish) $p->addStatus(Page::statusUnpublished); $p->save(); //add image to the page and save again $p->images_field->add($dir . '/' . $path->getFilename()); $p->save(); $a++; unlink($path);//we delete the temp file } }//end foreach //delete the tmp directory wireRmdir($dir, $recursive = true); //create a string of "failed" category titles to add to error message $failedTitles = implode(', ', $failed); //give the user some feedback... if($a > 0) echo 'Added' . $a . 'Portraits<br>'; if($failedTitles) echo 'Some Portraits not added because names already in use. These are:' . $failedTitles; }//end if (is_dir($dir))) else echo 'No Such Directory Found!';1 point
-
I heard first time from Mar also as MadeMyDay here in the Forum. He was some kind of mentor for me for MODx. Even though I was sometimes annoying, he always had an answer via Twitter or Forum So i worked one or two years with MODx. After I noticed that he is on a new CMS called processwire i had start to read about it. It took some time to understand this. But now Im in love with PW1 point
-
It is the title that ticked me off. For an 'experienced' publisher like tutsplus I expected at least the title to match the contents. For such a big outfit, my cynical side is telling me they knew exactly what they were doing....they know that was not an introduction to ProcessWire. Compare that to this introduction to Craft CMS. OK, so the authors are different but I expect articles are not published without going through some editorial process. Anyway, am good now... Edit: Ah, I see, Felix also commented about the Craft CMS intro...1 point
-
That's a better description...Like @tpr has suggested, this would be better managed on the admin side rather than in an include file for at least two reasons: 1. Your images will have a description - no need to type that text in some template file where your client/editors will not be able to change it 2. Dynamism...in case needed in the future. Here are some options: Option 1: Create an image field (e.g. call it content_header). Attach this image to the template used by your parent pages (Whale, Guppie, etc). I am assuming all these parent pages have a single shared template (please note, I am talking about a template here; not a template file). Image fields have a description text area. Use that for your 'brief descriptions'. content_header->description will give you access to those descriptions. More here on image fields. Then on the children pages' template file(s) call on their parents' image field and description...e.g. $page->parent->content_header->description Option 2: Create a dedicated page to hold all the content headers and their descriptions. Let's call it 'Content Headers'. Add one image field to it that accepts multiple images. Add your '25' images named similar to your parent pages, e.g. whale.jpg, guppie.jpg, etc (if practical, or use some other naming format). I can't remember if you can use the API to find an image using its name (i.e. $image->basename). Anyway, you can activate the 'tag' text area of an image field (in the field's settings). In that case, no need to give your images any specific name. Then, give each image a tag that is identical to your parent pages names or titles. You can find each specific image using their tag, i.e., $page->images->getTag('mytag'); Or, in your case you refer to the dedicated page, e.g. $p = $pages->get('name=content-headers'); $chImage = $p->content_header->getTag("$page->parent->name"); If you gave the whale header image a tag called 'whale', then, when viewing Whale's child pages, this image will be retrieved. The advantage here is that you can edit all your content headers in one place. Option 3: If your descriptions are quite long, then, create a dedicated text field(s) and a separate image field using either of the above options Option 4: I think you could also use repeaters or PageTable(?) Haven't tested the above code and I have been away a while, so, there could be other better ways to accomplish what you are after.1 point
-
Here you go....read this (whole) topic very carefully: Enable debug mode for only superusers or a given username $config->debugIf might also be of interest..1 point
-
I would say, admittedly without knowing Airbnb itself too well, that ProcessWire is a great platform for something like this. Such a project will involve quite a bit of custom work, from the registration and access management to reviews, but that you probably already knew. There are some modules that could come in handy, especially for the access management part. I'd check out Dynamic Roles, at least. Access management and registration are the parts you'll want to get right on the first try, as those are security-wise potential weak spots of just about any site or application out there. It's easy to model, manage, and query all sorts of data with ProcessWire, making things like complex searches easy to set up. In large scale you'll need to be careful with your limits (querying is relatively cheap, but fetching hundreds or thousands of results in memory is not; always define sensible limits and use built-in paging!) and you'll also want to test things out properly before letting too many users in. ProcessWire is known to scale well into millions of pages, but considering that usually (almost) everything is a page, that's not an impossible number to reach, of course depending on how you build this platform. I'd suggest taking a closer look into the (commercial) ProFields module package, as it could potentially boost the performance of certain parts a lot (thinking of things like reviews here, which might make more sense as Table rows than actual Pages; the built-in comments module is another solution that could work). I wouldn't worry about this solution scaling indefinitely right now; ProcessWire will scale pretty far, and if this service does indeed become hugely popular, eventually you'll have to go through a lot of hoops to get it running smooth no matter what technology you choose. Pretty much every big platform out there has gone through more than one more-or-less complete rewrite. That's not bad planning – it's simply smart to start with something that makes things easy (and relatively cheap) to get up and running, and worry about massive scale if/when you actually get there.1 point
-
Just to tell you I'm not a coder, I'm a designer and artist who happens to like coding as it's also a creative process. I used Tpyo3, Wordpress, Joomla, WebEdition, Modx and other CMS when starting with CMS's. I barely could code php. I only struggled with those platforms and had to deal with stuff I didn't want to, be it security issues or updating, learning something arbitrary platform specific. Modx happen to be a tool I worked with before ProcessWire. Within days and many hours I had a prototype of a module which didn't do anything other than say hello. All those system never really let me do what I wanted without getting in the way or installing some plugins that didn't work really. It's because they're too opinionated to be useful in a wider range of contexts. They're all cluttered (I think you got that all wrong). Which all lead to frustration and hours and hours of wasting fighting a system. They try to save you time but in fact they put you in constraints that often make little to no sense. Now all those systems try to solve certain issues by putting yet another layer of complexity and so on. Then I discovered PW and finally I was in charge, saving time, focusing on things that really matter. Within an hour I had my first module "HelperFieldLinks" working without even reading a manual other than the HelloWorld.module. It's so simple, it didn't take me long to see the simplicity and power of PW. I am able to put contrains where the project demands and not the system. It's all so simple even I could as a non coder. PW makes me shine, and people think I'm a good coder. lol. So wrong. I have built websites for my mom and sister, and never had to explain or show them how to edit their site, they found out them self, which speaks a lot of the usability of PW.1 point
-
Teppo has nailed it. It's the unfriendly comments from earlier on that derailed it and hence the replies - it shouldn't be surprising that people got upset when you talk about the death of a platform that is alive and healthy because it's not headed in the direction you want and basically ignoring the many others who are happy with it doing what it does. But let's put that aside for now or we will be going in circles. So firstly, as teppo says, Processwire is a framework. It is possible to extend ProcessWire to work in the way you want, but I know this is frustrating you as you want examples. There are too many examples - I have a whole Intranet running news, asset tracking for thousands of assets, purchase orders and invoicing, health and safety observations, contract information and tracking, ship tracking (with some maps integration) and a knowledgebase that links heavily into the assets so we have instruction manuals and guides on how to fix them as well as their fault history). What I can't do is show you any of it because it was built for a client. So that is a Web application - when its function is to process business data. The back-end of an ecommerce shop to me is an application too. The reason people say "you can do anything" is because you can. Your imagination should be allowed to run wild - because Processwire is essentially a framework that still let's you use PHP you can theoretically build anything you can see out there that is already in PHP but it depends on programming skills to make any of it happen.1 point
-
If working on my own personal projects I develop locally on MAMP and then push everything live to the server once done. I don't use Git as much as I should, I need to work on that. For client projects, I have a random domain name that I develop client projects on, I just make sure they're not indexed by any search engines and only the client has the url to watch the site build and progress. Once I'm finished and they're happy and I've been paid I then migrate it to their server. This has worked well for me over the years and keeps clients happy as they can track the progress of the build.1 point
-
I work locally using MAMP Pro (OS X). The 'problem' for me has been getting a development version in front of a client. I can't use port-forwarding and DynDNS at all and I'm a command line & GIT noob. But I recently discovered Pagekite which lets you tunnel your localhost to a publicly available URL. With a bit of tweaking on the MAMP Pro side of things I can serve a locally running site to a client for, not only review, but for them to add content. Example. The last bit of the process is uploading the site files and moving the database when going live. If anyone is interested in more details of my setup let me know.1 point
-
Don't be scared off by the look — it might look a tad dated, but there is a very active and helpful community. The admin can be themed to look a bit more modern (keep in mind I did that nearly 4 years ago). There is a lot going on behind the scenes with development, and I think they are well on their way to releasing a complete overhaul (TXP5). I can't recommend it enough if you are looking for solution that offers a tagging language and lots of ready-to-use plugins.1 point
-
I would suggest you take a look at Textpattern for the smaller builds where you need a stable of plugins that can do a variety of what you mentioned above. It uses a tagging language much like EE, although I personally find Textpattern's a bit easier. I've built dozens of sites with Textpattern, and still continue to use it for a variety of projects. Good luck.1 point