Leaderboard
Popular Content
Showing content with the highest reputation on 03/07/2015 in all areas
-
Just checked in a first beta version of a new module I'm working on. Feel free to test out and see what's up with it. Pollino (beta) A simple poll module for ProcessWire This module makes it simple to setup polls for your website. It is based on a simple page setup to create the polls. So each poll is a page, and its children are the answers. Pollino will create the templates and a PollinoPolls page in the root to start with. You can add fields to the templates as you wish and later use hooks to modify the output of the poll. This can be useful, for example, to use images as options or just some custom markup etc. It provides some API to render the poll form and the result. These methods are hookable and it's easy to customize the output if needed. It can be rendered on any page and even multiple on the same page. Pollino takes care of saving the votes and preventing multiple votes. It comes with some configuration settings to choose what method to use to prevent from multiple votings: using cookie and an expire time or by IP and optionally also the UserAgent with and expire time or by logged in User Pollino isn't 100% plug'n'play but it provides a solid foundation and comes with some premade theme and output for you to start. It takes care of the boring stuff and lets you concentrate on the front-end stuff and styling. That's what matters after all. It does support multilanguage, as all strings are translatable in the module. Also since it's using simple pages and templates you're free to add or change fields to make its output multilanguage without much hassle. ----- Read more and download https://github.com/somatonic/Pollino Online Demo I setup a little demo here to see using https://lightning.pw http://titanium-x77.lightningpw.com/ Have fun.4 points
-
This site was recently launched and has been running great for the last few weeks. It is probably the largest PW project I have done; there is a lot of media to keep organized, this label has about 70 albums and over 400 artists... http://www.newfocusrecordings.com/ the homepage displays 12 random albums the catalogue page, uses datatables and loads the cover images on demand; the filtering is all done with the datatable, and the urls are updated without page reload... the album page: the pw version replaces a joomla version that was used for about 6 years.. and was a pain to work with; some modules: AdminCustomFiles AdminSaveActions AdminTemplateColumns AIOM+ FieldtypeColorPicker FieldTypeSelectFile (for selecting huge media instead of uploading into PW) FieldtypeTemplates (for selecting which template a certain support doc should show on) FormBuilder FormSaveReminder ImportPagesCSV (used to import some of the data from Joomla and Zoo) InputfieldSelectExtended (used to show additional info after a select action) PageReferencesTab PageTreeAddNewChildsReverse (new albums need to be at top of list) ProcessCustomUploadNames (to ensure the asset naming matches the catalog numbers) PageListerPro ProcessRedirects (for some legacy URLS) ProFields TextformatterBBCode (used for formatting of track and album titles with special characters, superscripts, bold, italic) VersionControl HannaCode SiteUtilities - a custom module that controls many helper functions, read id3 tags, move audio files, rename stuff etc.. some forum threads that relate to this project, and as always thank you to everyone who helped and more generally who take part in the forum! https://processwire.com/talk/topic/8366-setup-sharrre-sharing-widget-in-5-minutes/ https://processwire.com/talk/topic/8392-simple-built-in-docs/ https://processwire.com/talk/topic/8350-module-fieldtype-yaml/ I also work for this label, and have designed about 10 of the covers.. - - - - Special Features: Press View There is a user role called press, and on the user profile, site admins can select certain albums to allow access to for that press user. When the user logs in they can see which albums they have extended access to and then when they view the album there is an extended view and additional media and content. The page audio player will play full streams of the tracks, whereas the public view only plays the edited preview files; the presence of the full stream is indicated with a radio/wave icon.. left widget showing some extra content:4 points
-
I just committed an update that brings full support for repeater fields (images and images embedded into RTE fields inside repeaters). I also fixed a bug with the new core cropping functionality if you set a filename format that is not available on file upload, such as $file->description. There were some significant changes to hooks and logic to get the repeaters working, so please test and let me know if you come across any problems.4 points
-
3 points
-
This is what you are looking for: $this->pages->addHookAfter('added', $this, 'hookAdded'); public function hookAdded(HookEvent $event){ $newPage = $event->arguments[0]; $this->message('it worked here is the id of your new page:'.$newPage->id); // Yes, this will work }2 points
-
@cstevensjr - thanks for checking it out and for the compliments, most appreciated! @martijn - thanks! yeah i think you're right; it might be annoying the way it is now with the small link icon to open the album.. maybe i need to lose the icon and then make the link be on the .entry-innerwrap as you suggest.. that would leave more room for the text2 points
-
Assuming that the structure of the fields is always the same (Question, Checkbox 1, Checkbox 2), I think that the approach depends on who defines the questions: the user (like a "create your own form" type of page) You (with a fixed set of questions that the user must answer on the page) In the first case, you could use the Profield Table, as suggested by nickie, or even simpler, a PageTable (which is not a Profield): You create a template called question, with the fields question_text (text field), question_answer (text field), display (checkbox field), include_in_email (checkbox field). Then you create a PageTable field questions, that uses this question template. Finally you add this questions field to the target template. This way, the user can add as many questions as he wishes on a page. The second case is more difficult. The "pure" way of doing it would be to create a field for each question's subquestion, i.e children_answer, children_display, children_email, pets_answer, pets_display, pets_email, etc. The problem is that this would create an enormous amount of fields, which becomes inefficient (see this post from Ryan). You could create your own compound Fieldtype to group the three subquestions in one field (see the Events Fieldtype/Inputfield as an example), but this would still require 50-80 different fields, which is a lot. I think that the approach that I would attempt is the following: Create a question template with fields question_text (text field, with visibility set to visible but not editable), answer_text (text field), display (checkbox field) and include_in_email (checkbox field). Create a questions PageTable field that uses this question template. Add the questions field to the target template (let's call it questionnaire). Write a module to hook after Pages::added, so that each time a questionnaire page is created, it adds the question pages under it. Here is an example of what I mean: // Inside a module public function init() { $this->addHookAfter("Pages::added", function($event) { // Activate the hook only if the added page is a questionnaire if ((string)$event->arguments(0)->template == "questionnaire" $this->hookAdded($event); }); } public function hookAdded($event) { $questionnaire = $event->arguments(0); // List of all your questions $questions = array( "Do you have children?", "Do you have pets?", "Do you have rabies?", // etc. ); foreach($questions as $q) { // Create a question page under the new questionnaire $p = new Page(); $p->template = "question"; $p->parent = $questionnaire; $p->question_text = $q; $p->save(); // Add the question page to the questions field of the questionnaire $questionnaire->questions->append($p); } // Save the questions field of the questionnaire $questionnaire->save("questions"); } You should also adjust the permissions for the question template so that a user can't delete them. Yet other approaches would be to create a custom Process module (see the Hello Process Module for an example), or to set up a custom front-end template to answer the questions instead of using the admin back-end.1 point
-
I had a realization recently about the PW data-model that I would like to share. The PW model is actually very akin to that of the Entity/Component model. Pages can be seen as Entities, and Fields can be seen as Components of those Entities. Templates can be seen as Component Types. One important difference from the E/C model, in terms of implementation, is the shape of the resulting entities - Fields are mapped directly onto Pages; or in other words, Component properties are mapped directly onto Entities, which means the Components themselves are limited to a single property at the model-level, even though some Field types are backed by tables with more than one property value, e.g. more than one data-column. I can't help thinking the resulting model is really close, but one step removed from being anywhere near as powerful as a real E/C data-model. To explain why I feel this way, here's a very simple case example. Let's say you have a shop with different types of products, many of which have at least one thing in common - they have a unit price, product title, and manufacturer name. With the PW model, I will add these three fields individually to every Template that describes a product type, and I will address these as, say, $page->price, $page->title and $page->manufacturer. Fetching these three fields requires three joins to separate tables. Conceptually, these three fields are meaningless on their own - they belong to a single component that defines the necessary properties required for something to "be" a product in our system. The, let's say, shopping cart service, for example, is dependent on the presence of all of these three fields and doesn't function if one of them is missing. With the Entity/Component model, instead of adding three individual fields, you define a component type that defines these three fields. You would address them as, say, $page->product->price, $page->product->title and $page->product->manufacturer. In other words, these three fields, which belong together, are exposed in the model as a single, integral component. Fetching these three fields requires a single join to one table. The ability to group together related properties in components has performance advantages (fewer joins/queries) but more importantly, it has practical advantages in terms of programming. You wouldn't need to group together related fields by prefixing them with "name_" anymore, which seems like an unnatural way to create a kind of "pseudo component". Adding/removing properties to a component property would naturally propagate that change to every entity that uses that component, rather than having to run around and update them manually. Controllers/services could define their requirements in terms of component shape. I realize it's a pretty substantial departure from the PW data-model, but perhaps something to think about for an eventual future 3.0. Or perhaps just an idea to consider for a different CMF in the future. Or perhaps just something interesting to think about and do nothing1 point
-
I don't think that such drastic changes need to be operated, since it is already possible to create compound FieldTypes that group different values. An example of this is the Events Fieldtype/Inputfield created by Ryan to demonstrate how to create custom fieldtypes. The Date, Location and Notes of an event are stored as different columns in a single table, and could therefore be compared to the Component. What would be needed is a good way to create such compound fields in the admin section. As I understand, this is what the Table ProField does, though it is still a little limited, since you can't use page fields for example. But this would tend to indicate that the changes to be done would not be so drastic.1 point
-
Story: https://processwire.com/talk/topic/9250-what-should-i-do-to-make-pw-to-work-with-a-reverse-proxy-cache/ After a few days of reading documentation, I got processwire to work with nginx reverse proxy cache. This is not a tutorial on how to install server software. A working nginx config copy will be posted on next reply. Ubuntu 14.04.1 x64 Nginx 1.4.6 apache 2.4.7 mysql 5.6.19 php 5.6.6 (php5-fpm) A new copy of content will be fetched instantly. A screencast of this demo1 point
-
I've just finished the work on this page and got the permission to share it on the showcase page. Maxim produces and distributes cosmetic products for many different brands in Germany, France and other European countries. This website showcases the company‘s high standards in quality and design. In a few days the translation will be ready and the website gets multilanguage support (Thank you, Ryan, for this awesome CMS).1 point
-
nginx.conf user www-data; worker_processes 4; pid /run/nginx.pid; events { worker_connections 768; # multi_accept on; } http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; include /etc/nginx/mime.types; default_type application/octet-stream; include /etc/nginx/cache.conf; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; gzip on; gzip_disable "msie6"; gzip_vary on; gzip_proxied any; gzip_comp_level 2; include /etc/nginx/conf.d/*.conf; include /etc/nginx/sites-enabled/*; } cache.conf proxy_cache_path /etc/nginx/cache levels=1:2 keys_zone=one:100m inactive=60m loader_threshold=300 loader_files=200 max_size=200m; proxy_cache_key "$scheme$proxy_host$uri$is_args$args"; /etc/nginx/sites-available/default server { listen 80 default_server; proxy_cache one; add_header X-Cache-Status $upstream_cache_status; proxy_cache_valid any 1m; proxy_cache_min_uses 3; proxy_ignore_headers Set-Cookie; proxy_ignore_headers "Cache-Control" "Expires"; root /var/www/html; index index.php index.html index.htm; server_name dev.local.net; location / { try_files $uri $uri/ /index.php?it=$uri&$args; } location ~ \.php$ { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location ~ /\. { deny all; } } A modified basic-page.php of pw installation profile <?php $lastModified=($page->last_modified); $etag = md5($page->body); $ifModifiedSince=(isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? $_SERVER['HTTP_IF_MODIFIED_S INCE'] : false); $etagHeader=(isset($_SERVER['HTTP_IF_NONE_MATCH']) ? trim($_SERVER['HTTP_IF_NONE_MATCH']) : false); header("Last-Modified: ".gmdate("D, d M Y H:i:s", $lastModified)." GMT"); header("Etag: $etag"); header('Cache-Control: public'); //check if page has changed. If not, send 304 and exit if ((@strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE'])===$lastModified) || $etagHeader == $et ag) { header("HTTP/1.1 304 Not Modified"); exit; } //$content = "This is a demo"; // basic-page.php template file // Primary content is the page's body copy $content = $page->body; //$content .= $etag; // If the page has children, then render navigation to them under the body. // See the _func.php for the renderNav example function. if($page->hasChildren) $content .= renderNav($page->children, 0, 'summary'); // if the rootParent (section) page has more than 1 child, then render // section navigation in the sidebar if($page->rootParent->hasChildren > 1) { $sidebar = renderNav($page->rootParent, 3) . $page->sidebar; }1 point
-
I setup a little demo here to see using https://lightning.pw http://titanium-x77.lightningpw.com/ You see it one single on home sidebar and on the PollinoPolls page you see two. The expire time is set to 1 minute. via cookies1 point
-
1 point
-
@Soma - where's your tip jar? I don't see it on your Modules page or signature.1 point
-
How cool. I'm in discussions with a client to move his pretty large site over to PW. One of the features that I could see being a problem was a custom developed Poll snippet the client loves on his current site. I was literally worrying about this all week and how client would take news that his 'upgraded' site didn't have one of his most often used features Thanks so much!1 point
-
Impressive ! On the home page I was clicking the covers, expecting a click (link), maybe you could add some JS magic to trigger a click on the link. Or make .entry-innerwrap the link.1 point
-
Just hold the new c't one of the big german computer magazines....it's a 4 page article....very nice written. some extractions translated: ...backlinks online and in the end of the article $pw->awesome->url = http://ct.de/ybn5 best regards and a great weekend mr-fan1 point
-
Nice one ESRCH, but that only affects the View tab on editing a page - I also like to change the view links on the page tree. Yours does cover the only critical issue as that is when it is possible to lose changes to a page (unless you have Soma's Form Save Reminder installed). I just posted this over at: https://processwire.com/talk/topic/7588-admin-custom-files/?p=89331 because it uses Martijn's Admin Custom Files. This version also changes the view links on the page tree. ProcessPageList.js $(document).ajaxComplete(function(){ $('li.PageListActionView a').each(function(){ if($(this).attr('target') == undefined){ $(this).attr('target','_blank'); } }); }); ProcessPageEdit.js $( document ).ready(function() { if($('#_ProcessPageEditView').attr('target') == undefined){ $('#_ProcessPageEditView').attr('target','_blank'); } }); Maybe someone else will also like this approach.1 point
-
1 point
-
@tuxy Make sure that you put right URL to your logout page in "<a href='/logout'>". I recommend you to use ProcessWire API to get right URL. <?php echo "<a href='" . $pages->get("id=33977")->url . "?redirect=$page->id". "'>Logout</a>"; ?> 33977 change to your logout ID page. If you don't know how to find page ID just try to edit that page and get it from url /page/edit/?id=33977 ?redirect=1 probably mean that you try to to logout from homepage, which always have ID=1.1 point
-
@mr-fan Fastest gun in Bavaria. You post login, not logout code and "/somewhere/" never redirect you to the same page.1 point
-
Chances are high that if you find a more real bug, that broke something, it's often on Ryan's prio list and usually a matter of hours or 1 day to fix it. If it's something more complicated it can take longer but then it may was even in master undiscovered since some time. Also as other have mentioned dev is pretty darn stable, just make sure to report a bug if found. It's fun It's going on so fast, now 2.5.3 feels like an old hat. Go with the flow. http://processwire.com/blog/1 point
-
Welcome to processwire. Let's face it, without offense, but wordpress has been quite a few times in the news, and recently is, about it's plugins being exploited and has millions of hacked wordpress sites. That must give you something to think about. Secondly with processwire you don't have to learn your way around a new system that: "let you" make websites. With processwire you are going to make websites directly from the core. That means that all the experience you already have learned in the past with html, css, php, etc. you can start using directly with processwire and make a website in any way you would like to see it. 2k visitors, 6K pages daily won't be any problem because Processwire has been made scalable from the ground up. About templates that is where Processwire really shines because you can literally make your own templates both in the backend (admin) and in the frontend. About markdown editor, here are some good reads: https://processwire.com/talk/topic/4213-markdown/ http://modules.processwire.com/categories/textformatter/ http://wiki.processwire.com/index.php/Text_Formatters Open this page: https://processwire.com/api/multi-language-support/multi-language-urls/ and read the part where it says: Changing the rich text editor About upgrading processwire in the future: https://processwire.com/talk/topic/52-how-do-i-upgrade-processwire-to-the-latest-version/ About making your right choice, no fanboy talk here but from my own (and others) experience if you compare processwire with the "popular" big 3 out there, processwire is going to save you a lot of time and headache. Isn't that what we all seek over "popularity" ? In processwire a lot of practical functionality is already included, no need for those to plugin afterwards e.g. you will have multi-language out of the box. Don't forget browsing the processwire api and the modules: https://processwire.com/api/ https://processwire.com/api/fieldtypes/images/ https://processwire.com/api/variables/templates/ https://processwire.com/api/variables/fields/ http://modules.processwire.com/1 point
-
Patron Saint of Firefighters and soapmakers http://en.wikipedia.org/wiki/Saint_Florian Always said you were wonderfully saintly, Soma!1 point
-
The Table fieldtype doesn't support files or images. Of course a link to an image is really just a file path so you could theoretically store these path in a table field, but you'd have no way to upload the images to the server. Depending on the size of the gallery and what information you want to record for each image, I would actually recommend using an individual child pages for each image. Otherwise, the new PageTable field might also be a good solution. There isn't much documentation on this yet because it is only available in the dev version, but it is very powerful. It is a core module in the dev version, but not installed by default. Some links for you: Gallery tutorial from Joss which uses a single images field: http://wiki.processwire.com/index.php/Simple_Gallery_System Another tutorial from everfreecreative: https://processwire.com/talk/topic/3990-another-simple-photo-gallery-tutorial/ Post from Ryan about the advantages of having one image per page for its ability to store whatever metadata you wish: https://processwire.com/talk/topic/417-extending-image-field/?p=6982 Remember that a "page" in processwire is really just a row in a database file and show shouldn't be considered as being a workaround - it is actually very efficient and effective.1 point
-
Yep, easily one of the most useful PW modules around. It fits great into my workflow, and now with version 3.0 and the added LESS support it gets even better. Keep up the good work! PS Have you guys considered adding Autoprefixer support to the module (maybe as an option)? I'm not sure if this is easy to implement but it saves people the hassle of writing all kinds of vendor prefixes in their CSS, and instead just automatically takes care of this.1 point
-
Would it much work to build it as a universal module? Maybe with a config file to match the database table fields? So everybody can use it independent of use case. Just an idea. Maybe to much work to do it.1 point
-
Just. Don't. Use. It. Seriously: I worked with Joomla exclusively a while ago (around 2004/2005) and the whole concept hasn't changed imho. The main problem is: It is by no means a flexible content management system, it is more a portal system. Let me explain what I mean: Let's say you have a large scale company with 1000 employees. All of those employess have a name, an email, a title and a linked department. You want to display one/several employees on each page in a kind of sidebar. The PW way: - Create a employees template - Add desired fields - Create page field in your other templates for selecting employees - You are then totally free to select employees in your template and you are able to output what you like (HTML, CSS). - You also have the possibility to use that information somewhere else because these are just usual PW fields. - An editor selects the employee(s) where it is needed: While editing the page The Joomla way: - Look if a module exists for that does this job for you (perhaps there is one, but probably not). - even if there is one you have to add your employees in some kind of extra database, where you are tied to the output of the module (not necessarily, perhaps the script kid lets you customize it). - But the biggest problem: Your editor will not be able to select the employees where it is needed. They have to go the modules section in the backend, have to find the module, have to identify the page they want to edit and then have the possibility to select an employee. This is a ridiculous workflow, image you have not only an employee to select but also header images, other side information and so on. The rest of Joomla can be summed up: - Bloated - poor security - inflexible - poor templating Joomla totally is okay for smaller groups, clubs or where ever no technical experience is needed and where the requirements are low. Everyone can set up a site really fast and choose from a lot of plugins (mostly poorly coded though). But when it comes to comfort, flexibility for editors... it is just poor.1 point