Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/08/2015 in all areas

  1. Page Field Edit Links GitHub: https://github.com/thetuningspoon/AdminPageFieldEditLinks Direct Download: https://github.com/thetuningspoon/AdminPageFieldEditLinks/archive/master.zip This module is based on--and is the successor to--Macrura's AdminPageSelectEditLinks (https://processwire.com/talk/topic/8477-adminpageselecteditlinks-module-for-enabling-edit-links-on-multipage-selects/) Page Field Edit Links adds modal editing capability to ProcessWire's Page fields in the admin editor, allowing editors to easily view and edit the content of any page(s) that have been selected, as well as create new pages without leaving the current screen. Edit links are updated in real time when new pages are added to the field. Compatible with all available types of Inputfields including Select, SelectMultiple, Checkboxes, Radios, AsmSelect, PageListSelect, PageListSelectMultiple, and PageAutocomplete.
    10 points
  2. The modules directory now has an option for PW 3.0 compatibility. Please test your modules with the latest dev version of PW and tag your modules with the new 3.0 option if everything works as expected. Thanks for all your contributions which help make PW what it is! For those who haven't discovered it (it's not terribly obvious), here is a list of all the modules that are currently tagged as being compatible with 3.0: http://modules.processwire.com/versions/3.0/
    3 points
  3. Building on LostKobrakai's suggestion, you could do it like this: #1 Enable urlSegments on the home template https://processwire.com/docs/tutorials/how-to-use-url-segments/ Then, on the home template, you'll want to find the user by the provided segment: if ($input->urlSegment1) { $cleanUser = $sanitizer->pageName($input->urlSegment1); // sanitize user input $foundUser = $pages->get("parent=/users/, name=$cleanUser"); // find the requested user page if (!$foundUser->id) throw new Wire404Exception(); // throw a 404 if there isn't that user echo $foundUser->render(); // render the user page } else { // code for the homepage } The problem here is that if you have a page that is children of home with the same name as a user, that page will be called and the segment will be ignored. Make sure to check the best practices for working with url segments here: https://processwire.com/docs/tutorials/how-to-use-url-segments/page3 #2 You could still keep the products under /products/ and have a second urlSegment on the homepage. The logic would be the same as in #1. So, all together (written in the browser, don't trust the code too much): if($input->urlSegment3) throw new Wire404Exception(); // we don't care for a third segment, so throw a 404 if it exists if ($input->urlSegment1) { // first check the user $cleanUser = $sanitizer->pageName($input->urlSegment1); // sanitize input $foundUser = $pages->get("parent=/users/, name=$cleanUser"); // find the requested user page if (!$foundUser->id) throw new Wire404Exception(); // throw a 404 if there isn't that user if ($input->urlSegment2) { // check the product $cleanProduct = $sanitizer->pageName($input->urlSegment2); // sanitize input $foundProduct = $pages->get("parent=/products/, name=$cleanProduct"); // find the requested product page if (!$foundProduct->id) throw new Wire404Exception(); // throw a 404 if there isn't that Product echo $foundProduct->render(array('mobile' => $foundUser->id)); // render the user page telling the product template which user to use } else { echo $foundUser->render(); // render the user page } } else { // code for the homepage } I used render, but you can write the code directly of course. On the second render, I'm passing the user as an option so you can use it on the products template. Ryan explains options in render here https://processwire.com/talk/topic/3145-multiple-views-for-templates/?p=32876
    3 points
  4. http://eressurs.no/no/processdisplay/
    2 points
  5. There's a real security concern to just having the one USB Type-C port and no other way of charging the device. It means that just to charge it you are connecting a fully-enabled data port to a potentially hostile connection - especially if you leave your own charger at home or plug into a charging port integrated into a power socket. How do you know that all your machine isn't being compromised as well as charged?
    2 points
  6. This module creates a per-page activity log. It's not version control, but it is a history of changes made to all core field types. See the screenshots below for further explanation. It consists of 2 modules: MarkupActivityLog ProcessActivityLogService (handles ajax calls for show old/new values of textareas) More information on github Non-Superusers add an 'activity-log' permission. Thanks Nico, Netcarver, Ryan. MarkupSEO, Field Change Notifier, and FormBuilder where heavily referenced (*cough* copied) at points. Activity Log Tab Changes to textareas show in modal Module configuration
    1 point
  7. Hey, if I'm using the Language Translation Tool strings automatically get deleted if they match the original string. This is really annoying because it shows those strings as "blank" in the overview but you can't fix them. Why not just let them be as you type them in? - Nico
    1 point
  8. Hi all, A client needs 12x languages on Processwire - I've set this up and it works beautifully out of the box. Again Processwire is wonderful thing. One thing they've asked for a way that languages are shown on fields on a per-user basis. This is so translators won't be able to accidentally edit the wrong language. So for example: A German translator will only be able to edit the German version of the fields. Is this be possible? I know that you can set a default language for each user, but could there be a way to set this and therefore restrict their access to one language only. Any help here would be massively appreciated as always. Thanks!
    1 point
  9. This a script I use to install new sites (mainly pw) in an amazon EC2 with bitnami stack (ubuntu 14.04). Maybe it can be useful for somebody else. To access your bitnami terminal you have to install a .pem or .ppk key on your home folder then ssh -i ~/.ssh/bitnami-hosting.pem bitnami@yourbitnami.bitnamiapp.com now we're connected through ssh. cd /home/bitnami # Create a file called createWeb.sh sudo nano createWeb.sh // paste the long script at the bottom sudo chmod +x createWeb.sh sudo ./createWeb.sh yourwebsitename //note down the random BD password cd ./apps/yourwebsitename/htdocs # download and unzip pw wget https://github.com/ryancramerdesign/ProcessWire/archive/master.zip unzip master.zip sudo cp -R ./ProcessWire-master/* . # change permissions to install chmod 777 -R ./site/assets ./site/modules chmod 777 ./site/config.php mv htaccess.txt .htaccess # change permissions after install chmod 644 ./site/config.php sudo find . -type d -exec chmod 775 {} \; sudo find . -type f -exec chmod 664 {} \; sudo chown -R bitnami:daemon ./* # enter your .htaccess and around line 117 make sure the line looks like RewriteBase / RewriteBase /yourwebsitename/ Open your url and ready to install a fresh pw. Note that in the script you have to substitute PASSWORD by your actual mysql pass in the following line: mysql -u root -pPASSWORD << EOF #!/bin/bash # creaweb miweb miweb.zip # 1.- Crea estructura de directorios sudo -u $USER mkdir -p /opt/bitnami/apps/$1/htdocs /opt/bitnami/apps/$1/conf # 2.- Permisos archivos y directorios para el usuario bitnami sudo -u $USER chown -R bitnami /opt/bitnami/apps/$1 # 3.- descomprimir zip de la app, sino exite crea un phpinfo como if [ -n "$2" ] then unzip ./$2 /opt/bitnami/apps/$1/htdocs/ else sudo -u $USER echo '<?php phpinfo(); ?>' > /opt/bitnami/apps/$1/htdocs/index.php fi # 4.- Crea configuración para acceder a la web http://mibitnami.com/miweb sudo -u $USER cat > /opt/bitnami/apps/$1/conf/$1.conf <<EOL Alias /$1/ "/opt/bitnami/apps/$1/htdocs/" Alias /$1 "/opt/bitnami/apps/$1/htdocs" <Directory "/opt/bitnami/apps/$1/htdocs"> Options Indexes MultiViews AllowOverride All <IfVersion < 2.3 > Order allow,deny Allow from all </IfVersion> <IfVersion >= 2.3> Require all granted </IfVersion> </Directory> EOL # 5.- Añadir en la útima linea de la configuración de apache la nueva entrada echo Include "/opt/bitnami/apps/$1/conf/$1.conf" >> /opt/bitnami/apache2/conf/httpd.conf # 6.- Reinicializar servicio apache /opt/bitnami/ctlscript.sh restart apache # 7.- lista webs disponibles ls -ls /opt/bitnami/apps # 8.- Crear Base de datos echo "creando BD" pass=`tr -dc A-Za-z0-9 < /dev/urandom | head -c 8 | xargs` echo $pass mysql -u root -pPASSWORD << EOF CREATE DATABASE IF NOT EXISTS $1; GRANT USAGE ON *.* TO $1@localhost IDENTIFIED BY '$pass'; GRANT ALL PRIVILEGES ON $1.* TO $1@localhost; FLUSH PRIVILEGES; EOF
    1 point
  10. Hello for all, not sure can my suggestion help (I am still new in PW world ), but had experiences in other systems. When I need to create multi-relations I also use tagging ("tags"). In that case you get new relations (eg. have categories, but categories + tags can give you almost unlimited options). Maybe you can try that option? regards, Sasa
    1 point
  11. Have you set the description field for all languages? What is the default language for Guest users? (Admin - Access - Users - Guest)
    1 point
  12. Regarding Problem #2: I think the best way would be to store product information in a separate part of the tree, without frontend access and then use the data from there in all the places you need them. For both problems I'd suggest you should take a look at urlSegments.
    1 point
  13. Nice, although I would suggest using PDO - I know teppo's module doesn't use it yet, but I am sure he will update sometime soon. Try this: $query = $database->prepare("SELECT login_timestamp FROM process_login_history WHERE user_id = :userid AND login_was_successful=1 ORDER BY login_timestamp DESC LIMIT 1,1"); $query->execute(array(':userid' => $user->id)); $lastvisit = $query->fetchColumn(); echo $lastvisit; Note that I also went with the user id - always better to look up an integer than a text field. PS - Just remember (and I know I already said it above), but this really isn't the "last visit" - you can go forever without needing to login if you visit a site regularly before the session has expired.
    1 point
  14. For everyone who also wants to use the Login history module from Teppo (http://modules.processwire.com/modules/process-login-history/), here is my attempt to make a sql query to output the date and time of the last visit on a frontend template. $query = $db->query("SELECT login_timestamp FROM process_login_history WHERE username='{$user->name}' AND login_was_successful=1 ORDER BY login_timestamp DESC"); $lastvisit = $query->fetch_row(); echo $lastvisit[0]; This will give you an output for the last successful login like this: 2015-05-08 16:40:59 It calls the table "process_login_history" from the module. The dates of the logins are stored in the column "login_timestamp". If the login was successful or not is stored in the column "login_was_successful" and has the value "1" for a successful login. The username is stored in the column "username". I dont know if the code is the best but it works. If someone has an improvement, please post it here. Best regards
    1 point
  15. Oh my god… Obviously this was the most stupid question ever. Sorry for that, and thanks for answering anyway
    1 point
  16. This module allows you to change the admin default style. For lazy people. It's just a sketch. More information soon. Done: - You can change the main colors of processwire To do: - Add ability to change fonts (fonts google) and read your opinions - Fix the Logo url field (default value). - Export/Import config. - Add more color options. - REWRITE
    1 point
  17. FYI, in 2.5.26 dev this module works but has an odd side effect. In the page editor images images do not display. They come back as soon as you uninstall the module.
    1 point
  18. This behavior is normally the reason to go for language alternate fields. But you can still get the field as normal by calling file_en or even not using language alternate fields. Either way you would need to build the logic to select the appropriate field on your own.
    1 point
  19. Crosslink for translated Blog module and ScheduledPages module... https://processwire.com/talk/topic/7403-module-blog/page-22#entry94588 best regards mr-fan
    1 point
  20. How often do you actually log out of a site? My point is that I am not sure how relevant last login/logout is, which is why I went with last_page_load and actually record the date/time the user last loaded a page. My example here: https://processwire.com/talk/topic/5534-new-articles-to-users-with-cookie/?p=53935 takes that approach and works well for me and it about as close as you will get to knowing when a user was last on your site. Is there a reason that won't work for you? If you're sure that they are always going to logout (and therefore be logging in again each time they visit the site) then this should work for you. Put it in your templates/admin.php file. wire()->addHookAfter("Session::login", function(HookEvent $event) { $user = wire('user'); $user->of(false); $user->last_login = $user->current_login; $user->current_login = time(); $user->save(); }); Note that I have two fields there - current_login and last_login, and that the value from current gets moved to last each time the user logs in and then a new current is set. Then on your page you can simply output the value of $user->last_login Does that help? You could potentially solve the problem with a session variable to store the last login before it is overwritten by the hook on login, but I think this is cleaner and more reliable. PS If you don't want to add these fields to your user template, you could make use of teppo's Login History (http://modules.processwire.com/modules/process-login-history/). It maintains a dedicated database table of logins which you could query.
    1 point
  21. Thanks, Adrian. Jumplinks is done (edit: 2.7).
    1 point
  22. http://fooexperience.com/ This is a site i actually did last year, thought i would share my one and only processwire site. Unfortunately im stuck using other tools at work where processwire would be a better fit!
    1 point
  23. Sounds like the field has a text formatter applied or the CKEditor configuration does not allow html tags. Check the "Details" and "Input" tabs of the field.
    1 point
  24. What is possible is to use a concat field to "save" the count of the images field and then use that for the visible dependency selector. Create a concat field "imagescount" and enter "images.count" as the value. Add that field to the template. And enter "imagescount>0" in the textfield's dependency. This works after only after you uploaded images and saved the page.
    1 point
  25. Ok, images and files fields aren't supported. It's not a matter of the textfield being multilanguage or not, it's how file fields and dependencies work. images.count>0 on a text field will only work if you upload a image via the dialog upload, cause that <input name="image[]"> is the one observed checking for its count. Once you save the image and reload the page that input is again 0. So it's not a bug but a "not supported" thing.
    1 point
  26. You could just alter this to your needs. This adds a second button to the pageEdit, which then triggers an action if clicked. <?php class HookPageEdit extends WireData implements Module { public static function getModuleInfo() { return array( 'title' => 'Hook PageEdit', 'version' => 1, 'summary' => '', 'singular' => true, 'autoload' => true, ); } public function init() { $this->addHookAfter('ProcessPageEdit::buildForm', $this, 'addButtons'); $this->addHookBefore('ProcessPageEdit::processInput', $this, 'addButtonsMethods'); } /** * Add a button besides "Save", which lets the user accept the application * */ public function addButtons($event) { $page = $event->object->getPage(); if($page->template == "application"){ $form = $event->return; $accept = $this->modules->get('InputfieldSubmit'); $accept->attr('id+name', 'hook_accept_application'); $accept->class .= ' ui-priority-secondary head_button_clone'; $accept->attr('value', $this->_('Accept Application')); $form->insertBefore($accept, $form->get("id")); } } /** * Triggers the pageAction of "PageActionAcceptApplication" if the page was * submitted via the added button. This won't save the page, because that only * happens if the button is named "submit_save" or "submit_published" * */ public function addButtonsMethods($event) { if($this->input->post->hook_accept_application){ $page = $event->object->getPage(); $event->replace = true; if(!$page->id){ $this->error("Invalid application to be accepted."); return; } $accept = $this->modules->get("PageActionAcceptApplication"); $accept->action($page); } } }
    1 point
  27. Please have a look a the actual source-code and not the dom representation of the devtools. They sometimes hide things all together if there's a issue with parsing. The "include=hidden" selector shouldn't matter, as it's only part of getting the page. If your image is shown, then your selector is working. With you stating that it works for logged-in users, could you please post what this shows you if you're not logged in? var_dump($logo->description); Also please make sure $config->debug is enabled, so errors are shown.
    1 point
  28. The Google Trends analysis IMO isn't of much help, it doesn't show the inherent "value" of PW as a CMS/CMF, it just throws hard to analyze numbers at the wall. In sheer numbers, WordPress should be the "B357 3V4R" solution out there. WP also benefits from having a LOT of marketing and PR involved, which the PW community doesn't really have (yet?). Look at the ecosystem around Laravel.. Laracasts, dedicated podcasts and blogs, training sessions and communities all over. It didn't get to be known with no effort, there has been a lot of time (and money?) put into it, the creator and his team have explained this numerous times. On another note, I actually have a two-pager to introduce PW to clients, unfortunately it's in French and heavily branded and I don't have much time to translate it right now. But it might be of interest. The main selling points I see and discuss in it — and I'd be very interested to know what's your opinion on this and what has worked well or not so well for you — go like this: Ease of use (for users and devs alike) — self documentation, data validation, fast development cycle Extremely fast — w/o caching, it's fast. With caching, it's fast as hell. Still need moar speed?! Throw ProCache at it and bingo! Static websites with all the benefits of a dynamic system and none of the pain of static generators. And fast websites mean better SEO, better visibility and better conversion rates! Win-win-win! Scalability — Does small and large scale sites really well. Hierarchical structure, when necessary, make it easy to manage content (plus it's built-in search system). Stability and security — Costs less to maintain and isn't very prone to attacks due to its inherent architecture. You don't need to update it every other day. Efficient development — Up to date development paradigms, easy to maintain and develop with growth in mind, content "agnostic" (i.e. it not targeted at one kind of use/market). Most things are already in core, no need to extend the core to do things I consider basic in this day and age, and pay annual fees for them on top of that.. I prefer to invest that time and money helping PW the best I can, that's how open source is best IMO. Relational content — It's hard to explain to clients, but it's seriously what generally cuts in when I need to select a platform for a client and really, PW wins hands down on this. Everything is a page and a page can be related to any other page in the way that pleases you. This enables really powerful contextual information, advanced "member" sections and such. I think that sums it up, then I usually add one or two paragraphs at the end that describes further why PW is a good choice for this project. Most of these arguments have been working well so far.
    1 point
  29. Part of the goal with rich text editors (and LMLs even more) is to place limitations upon the input in order to maintain quality and consistency. ProcessWire's TinyMCE and CKEditor come configured to focus purely on portable and semantic markup. Once you start introducing non-semantic things in the markup like inline styles, colors, arbitrary font sizes, etc., then your content is no longer semantic or portable. It becomes essentially anchored to your current site design (if you are even that lucky with the client). You'd likely have to go back and make edits to all those fields the next time the site is redesigned. An even bigger problem is that when you give clients the tools to do these kinds of things, they start to get creative and think of it as an art project. But they blame you 1-2 years later when their site no longer looks professional. CMS control of style in text output ensures degradation of consistency and quality of output over time. For these reasons, you usually want to keep your content management tools (and especially rich text editors) focused purely on semantics of content, and as far from style as possible. This is one reason why I think front-end inline editors are a bad practice, as they keep the focus off the semantics of the content and on the subjective aspects of how it fits the area. Let all the style aspects be handled the site designers, in your front-end CSS stylesheets that accompany the site's design. If you still want to inject style, Hanna code is not a bad way to go because it does at least introduce some separation of concerns. It still leaves the content semantic, even if the underlying Hanna code isn't. If the site is for your own use and you are okay with the compromises, then both TinyMCE and CKEditor can be configured to let you do nearly anything you want. I'm not an expert on how to configure them that way, but if you look at the demos at either site, they have "all options enabled" configurations you can see and these configuration options can be duplicated in PW. Lastly, a plain textarea field (no rich text editor) on it's own also works well for just regular HTML input. This is what I use when I do need something that lets me copy and paste HTML directly, though it's something I'd only do on a site where I'm the only admin/editor (at least for that particular field).
    1 point
  30. Bah, this EU Cookie directive and corresponding implementations in national laws are an abomination. I honestly think it has done more harm than good. Annoying the hell out of people leading to blindly accept any popup that mentions the word cookie.
    1 point
  31. Working on a Mac using Safari and Firefox, I recently had exactly the same problem after moving a website from developing server to live server (from another provider). After that I could only upload images with a file size of max. 200 KB, while max upload file size set by the provider was 16 MB. In Internet Explorer 8 I had no problems uploading larger files. In that browser the AJAX-uploader (with drag-and-drop functionality) isn't supported, instead the 'classic' uploader is used. So I thought the AJAX-uploader should be the problem. I solved the problem after editing line 296 of InputfieldFIle.js (wire/modules/Inputfield/InputfieldFile/) from: InitHTML5(); into: InitOldSchool(); Strange thing is that this problem only shows up at some providers...
    1 point
×
×
  • Create New...