Leaderboard
Popular Content
Showing content with the highest reputation on 09/09/2015 in all areas
-
[update] Seems Google Cloud Platform has now a "one click" launch for a VM with ProcessWire installed. https://cloud.google.com/launcher/solution/bitnami-launchpad/processwire4 points
-
Hi folks, I know how to get ONLY the first image from an Image field, but how to you exclude the first image? <?php foreach ($page->project_images->not()->first() as $image) : ?> Any thoughts? Sorry... just noticed slice in the cheatsheet... <?php foreach ($page->project_images->slice(1) as $image) : ?>3 points
-
3 points
-
3 points
-
I don't get some of the criterias you have on those methods. Why is speed a criteria for such rarely changing information as footer texts. Just cache it for like 24h and the speed of any used method is a non-issue. Also additional database tables (fields) are not really an issue, as it's mostly few additional bytes just like if you'd store the information in a file. The difficult parts (which really draw resources) that databases have to handle are other things. With that in mind i'd go for additional fields of method 2. either on the homepage on a dedicated settings page.2 points
-
Yep, it's part of the 2.6.5 updates: https://processwire.com/blog/posts/extra-action-in-your-page-list-processwire-core-updates-2.6.5/#get-extra-action-from-the-page-list-and-lister2 points
-
2 points
-
@diogo - I've had this suspicion for a while that someone at Google likes us - ever since I realised posts on this forum are indexed on Google within minutes, which doesn't usually happen on such a relatively small forum (at least to my knowledge). Now this has happened - this doesn't seem to crop up for some of the "major" systems out there so... thanks Google! (Or if it's just that Ryan has been applying the correct schema's in the HTML then thanks Ryan).2 points
-
This one is pretty fun and gives some ideas on how to make things fun and interesting (just the first 5 mins, once he gets started): https://www.livecoding.tv/video/live-with-stephen-wolfram/ Could have a PW one where you get ideas from the audience before starting and run through a bunch of common scenarios that way1 point
-
CKEditor is already in the core of ProcessWire nowadays so you don't need to install it again. Simply delete the /site/modules/InputfieldCKEditor/ folder and it will go away. Several versions ago, TinyMCE was the default, so that's why the module exists, but isn't needed on newer installations.1 point
-
1 point
-
Hey Alan, Actually, both work, although they're different. This is how you would use the doc version: $session->set(test, "test"); echo $session->get(test); // outputs: test Maybe the thing you did wrong was not echoing the get line? I think they left that out of the docs since you can use the variable for multiple operations and not only echo it. for instance, $test_works = $session->get(test) . " worked out fine"; // outputs: test worked out fine Hope this helps1 point
-
This is like Benjamin is forever destined to answer questions about next() and prev()1 point
-
https://processwire.com/talk/topic/10589-nextprevious-links-excluding-pages-based-on-options-field/1 point
-
@Andrei: I think it is a typo, but an incorrect example may be confusing for beginners. $pages->find($selector) always returns an array, where you further need to select one item out, with e.g. ->first(), ->last() or ->eq(#). If you know that there is only one page that will match your selector, (or you only need to get the first match), you can use $pages->get($selector), which will return only a single item.1 point
-
1 point
-
Thanks a lot - have updated and it works fine. At the moment without translation support for the buttons but very nice!1 point
-
Hi, First, try to follow that tutorial : Simple Website Tutorials to see step by step the basic PW mechanic. Then, take your time to get around the rest of The Docs Meanwhile, I'll try a "short version" of that, with the content circulation from creation to the browser: 1> First you create a *CustomField* to store some content, who will be at the end shown into the browser. And giving to that field some unique name. 2> Then, your "Page" is more of a box where you store a set of specific CustomFields. That box is associated with one unique *Template* 3> The *Template* is simply a .php file stored into /site/templates/ 4> -Now the magic happen, basically as follow Assuming that you have a TextField, with the name "myContent", that you can fill in the backend on a Page (box) named "Test", and tied surprisingly to the test.php template ... 1. To output the Content (aka our field) on the Test Page, just open test.php template and in the chosen spot type: <?php echo $page->myContent; ?> // Classic form... <?= $page->myContent; ?> // or short form. 2. Basically again, if you need that content on another template/page than Test, you can pass from the global variable, and find the right "fields box" by the template name it use. So, on any other template, you can access the content of the "myContent" field like so: <?php echo $pages->find("template=test")->myContent; ?> // Classic form... <?= $pages->find("template=test")->myContent; ?> // or short form. PS: There are many other ways and forms to target and display the content, take some minutes with the Selectors - Don't know if I really understood your question ^^, but hope it helps a little.1 point
-
I'd really like to use this Hasklig or FiraCode, but sadly sublime text and phpstorm don't support open type ligatures.1 point
-
This is really cool! I would love to throw a site up to see how it runs. Thanks for the heads up. **Runs amazingly well, the only trick is they use buckets like amazon and the server only uses a 10gb fixed partition. Never have been able to figure out how to get that to work, guess I could symlink the /site directory like I do on my dev boxes.1 point
-
it is already activated under the following conditions: not available for 'home' ($page->id == 1) not available for 'admin' ($page->template == 'admin') page editable status is needed to show lock/unlock current user needs page-lock permission trash/restore button only available for superuser functionality disabled in demo mode If you like to have a deeper view have a look in the script: /wire/modules/Process/ProcessPageList/ProcessPageListActions.php1 point
-
Since I've been working on a few projects where I used Bootstrap 3 and will be using it for future projects, I put together a blank site profile with Bootstrap 3 Sass, Fontawesome and a few markup render functions for Bootstrap dropdown menu, image carousel and accordion. You can find it at https://github.com/gebeer/site-pwbs Features bootstrap-sass-official font-awesome SASS version jquery modernizr render functions for:BS3 dropdown menu BS3 accordion from PageArray BS3 carousel from PW images array Prerequisites compass bower How to install from zip: download the zip extract the folder "site-pwbs" into a clean ProcessWire install's root folder during install of ProcessWire choose the profile "bootstrap-sass-official fontawesome blank profile" After installation The last step after installing the profile is to install all assets with bower: open a terminal in site/templates and execute "bower install" How it works The profile is based on the blank site profile that comes with PW 2.5 and uses the delegate template approach. It comes with a top navbar, a main container and a footer section. Rest is up to you. CSS gets compiled through compass. You can easily override BS variables and exclude BS components that you don't need. I intentionally did not add structure to the sass folder so you can structure your partials yourself as you please. There is only one folder "generic" with _mixins.scss whith a very lean and flexible breakpoint mixin that I discovered here. JS Since I only use the BS javascript plugins I really need, I usually copy them over to my plugins.js file. I use bower to install bootstrap-sass-original and fontawesome because it gives more flexibility than requiring them through ruby gems. This way you can tweak the BS and FA partials to your liking (of course only if you don't intend to do "bower update" further down the road) Enjoy!1 point
-
Hello again. A very basic feedback. I feel stupid... Maybe this is a feature (minimal install, just add what you need etc.), and not a bug. . In that case, of course, just pretend I said nothing. I have had a problem with the collapsed navbar with bootstrap. It just wouldn't expand at all. Not good for mobile user, of course. But the power of the ancestral RTFM technique gave me a hint. Actually, the problem is trivial : the plugins.js included in the templates/js folder does include "transition" and "dropdown". However, "collapse" is nowhere to be seen. Solution is very simple : copy and paste the collapse public class definition, from the bootstrap.js in the bower folder, into your plugin.js file. As I said, maybe it is normal behavior, and I'm just being thick, here. But since this wonderful "out of the box" template doesn't allow collapsed navigation bar to expand straight away, maybe others will be as thick as I was. Thanks again for this nice profile.1 point
-
To phrase my question more precise, does your homepage template have urlSegments enabled?1 point
-
No it is not in the modules directory. Read here: https://processwire.com/talk/topic/8508-page-status-toggler/?p=82345 By the way there exists a built-in functionality, which makes my and the modules of geniestreiche obsolete. if you still want to use it you can download it by clicking the link in the first post. It should work with the newest PW releases.1 point
-
Thanks for your hint. I looked into fredy module which is use to display edit form on the front end. I didn't have much time so I did a bulk copy/paste of all the css and js files included and it worked. I will take time to clean that to keep only the need css and js file for the asmselect field and I will report it back here. So that if anyone needs this information in the future... Thanks1 point
-
ProcessWire would probably really benefit from being listed at https://developers.google.com/webmasters/mobile-sites/website-software/index?hl=en and having its own page like it is already the case for: - WordPress, Joomla!, Drupal, Blogger, vBulletin, Tumblr, DataLife Engine, Magento, Prestashop, Bitrix, Google Sites, Typepad (external site), Squarespace (external site) and Wix (external site). See "How do I make my site mobile friendly?" and "If your website software isn’t listed or you have any feedback, feel free to fill in this form.".1 point
-
I use sendgrid for a production site that has a mass mail module, works great and doesn't cost a dime.1 point
-
all.u need to asks is how many pooeple.switch from wordass to pw ? = many how.many poople switch from pw to wordprass ? = null1 point
-
I prefer to use PHP variables whenever possible. But there are some cases where it wouldn't be applicable or possible, like with a call to WireArray::implode(), etc. If there's an instance where you need to supply an output format (like with markup) before the variables are known/available, then the only way to do it is to {tag} it with placeholders. This is useful when providing an output format for something ahead of time that's going to be repeated over many times. For instance, the supporting markup for PW's Inputfield forms is generated in this manner, so that a module or core can specify the output format without having to get involved in the runtime rendering of the form. But it's not really a question of which strategy you should use, because most of the places where we support {tags} using variables isn't a possible alternative.1 point
-
There's a fundamentally difference between your example strings. The first one is using tags, that are mostly used in conjunction with WireArray::implode and WireArray::explode or in newer versions you can also use them in the backend to create custom pageList labels in templates. These use the wirePopulateStringTags() helper function, that does replace the tags with their value out of a known or provided context. Nothing as fancy as a templating language, but nice for simpler usage. The second one is plain php, but the curly braces are actually optional as long as you're just calling a direct property of the variable. If you want to call deeper nested properties, then you need the curly braces (e.g. "<span>{$page->parent->title}</span>"). One last notable difference, while the tags are just strings, and therefore work no matter how they are created, the php string interpolation does only work when using double quotes.1 point
-
I'll try it, but it won't be as efficient as your mysql statement. // This is optional if you know the templates $t = new TemplatesArray(); foreach($templates as $template{ if($template->hasField("myfield")) $t->add($template) } $ps = $pages->find("template=$t"); $list = new PageArray(); foreach($ps as $p){ $list->import($p->get("myfield")); } $list = $list->unique(); $list->explode("name"); Edit: getting the templates could be more efficient like this, but I'm not sure about this. $myfield = $fields->get("myfield"); $fgs = $myfield->getFieldgroups(); $t = new TemplatesArray(); foreach($fgs as $fg){ $t->import($fg->getTemplates()); }1 point
-
Hi all Adding "rtl" Right to Left support to the template have no problem rather the website is RTL only or RTL and LTR. *with a lot of ways But when it comes to the CKEditor, If the website is RTL only it's no problem according to http://ckeditor.com/forums/CKEditor-3.x/No-BiDi-or-RTL-LTR-button-or-option-or-plugin-Drupal So in file: /wire/modules/Inputfield/InputfieldCKEditor/ckeditor-4.4.3/config.js In the CKEDITOR.editorConfig = function( config ) { I just add config.contentsLangDirection = 'rtl'; But what If I use multi language, English (ltr) and Arabic (rtl) ?!! I want the English body filed to show the editor ltr (default display) and the Arabic rtl (showing the content from Right to Left for easy editing) Its the same problem in TinyMCE here1 point