Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/24/2016 in all areas

  1. Hey guys, I think a few things in the code examples above need to be moved around. Also, since Repeaters don't know about languages, if you are creating repeater items on your own from the PHP side, you'll have to enable those items for all the languages they are applicable to. I replied on that GitHub issue report, along with suggestions for adjustments to the code.
    3 points
  2. If you just need the url for a redirect this does work: $session->redirect('.');
    3 points
  3. So if I understand correctly, you are going to have each team member listed as a link, bringing up a modal like the code above, when the link is clicked? Which means you need that code foreach team member. (See what I did there?) <?php foreach($page->team as $member): ?> <div id="g-wertich" class="uk-modal"> <div class="uk-modal-dialog"> <a class="uk-modal-close uk-close"></a> <div class="uk-modal-header"> <h2><?=$member->name?></h2> <img class="uk-thumbnail uk-border-circle team-detail" src="<?php echo $config->urls->templates?>layout_images/g.suhr.jpg" width="100" height="100" alt="$image->description" alt=""> </div> <h3>Aufgabenbereiche</h3> <ul class="modal-list"> <?php foreach($member->tasks as $task){ echo "<li>$task->description</li>"; } ?> </ul> <h3>Kontakt</h3> <p class="bezeichnung"><span><i class="uk-icon-phone uk-icon-justify"></i></span><?=$member->phone?></p> <p class="bezeichnung"><span><i class="uk-icon-mobile uk-icon-justify"></i></span><?=$member->mobile?></p> <p class="bezeichnung"><span><i class="uk-icon-envelope uk-icon-justify"></i></span><a href="mailto:<?=$member->email?>"> E-Mail senden</a></p> <h3>Hobbies</h3> <ul class="modal-list"> // Similar to tasks </ul> <h3>Motto</h3> <blockquote> <p><i class="uk-icon-quote-left uk-icon-large uk-icon-left"></i><?=$member->quote?></p> </blockquote> </div> </div> <?php endforeach; ?> I've guessed at tasks (which was a machine translation - it might be 'responsibilities' or something) and Hobbies being something that can be iterated over. Couple of things to note - The whole code block for the modal is wrapped in our foreach() using the alternative syntax. I have used short echo statements - like <?=$foo?> - which have been standard since PHP 5.4.0. (Sometimes known around here as PW's templating language.) Hope I haven't made too many assumptions and that you don't know all this stuff already.
    2 points
  4. @netcarver That's perfect, thanks. Getting the full URL using API methods only is surprisingly long-winded. This is the best I could manage: $full_url = $page->url; if($input->urlSegmentsStr) { $full_url .= $input->urlSegmentsStr . "/"; } if($input->pageNum > 1) { $full_url .= $config->pageNumUrlPrefix . $input->pageNum; }
    2 points
  5. This tiny module is intended as a helper for Ryan's Hanna Code module by providing a way to select existing Hanna Code tags within the editor. This is something I felt our clients needed in order to start properly using Hanna Code tags. See attached screenshot for details -- there's really not that much to it at the moment. Each editor requires it's own plugin and currently I've only cooked one up for CKEditor, where the plugin presents itself as a context menu item (visible on right click). I'm planning to expand the feature set of that one slightly and then probably convert the CKEditor plugin to TinyMCE, but that's just about it. Ideas are welcome, though. Some of the code is pretty much duplicated from Ryan's original module. I hope he doesn't mind -- though for the record I've also tried to make it very clear in the source what part that is and where it's from.. GitHub: https://github.com/teppokoivula/HannaCodeHelper Modules directory: http://modules.processwire.com/modules/hanna-code-helper/
    1 point
  6. Hello everyone, Last night as a "saturday night shitty weather stay at home" project I attempted to migrate a project that was on PW 2.7.x to PW 3.x I use a lot of partials on the project so I have around 200 php files that needs to be namespaced. Compiler was giving me trouble with "Call undefined function" errors. Being the lazy developer I attempted to wrote a script after getting bored over pasting the namespace Processwire; line into around 10 files. Below you can find the script, that is very basically adds <?php namespace Processwire;?> as the first line of every .php and .module file in the given directory and shows you the results. Of course it checks for namespace Processwire first By default it assumes ./site/templates folder but I tried it with a module which is giving errors due to namespaces and worked fine. Be careful and remember to take backups first https://gist.github.com/borantula/e41c4b6ba36f78b1110d400a16754691
    1 point
  7. proud to share the release of a little handy sorting module for image and file fields (edit: some bugs in the screencast that are already solved) the autosort option can be set in the field-admin: Caution there is some work planned on the images field, so this may break the functionality of this module. have this in mind. github: https://github.com/BernhardBaumrock/InputfieldFileSort module directory: http://modules.processwire.com/modules/inputfield-file-sort/ changelog 1.0.0 initial release
    1 point
  8. This week I've got to keep the blog post a little brief because I've been so caught up in this weeks' updates that I've run out of time to write much in the post! The updates this week are not actually to the core code, but rather to the API reference documentation for ProcessWire 3.x. There's lots more work to do still, but I definitely have a good start, so going to introduce it here in this post. https://processwire.com/blog/posts/processwire-3.x-api-reference/
    1 point
  9. I actually don't think this is a matter of file paths. That error points to one file (like _func.php) having a namespace, and another file (like main.php) not having a namespace (or not referring to the function in the namespace that it exists). If you are letting PW decide whether to compile a file based on whether it has a namespace or not, then you've got to take those same considerations for any files it might include(). A file that doesn't get compiled isn't going to have files include()'d from it compiled either. So it sounds like you probably do have a namespace defined in your _func.php file, but not in your main.php file (or the opposite). For your case, since you are adding a namespace to the to of all your .php files, I'd suggest disabling the compiler by setting $config->templateCompile=false; in your /site/config.php.
    1 point
  10. You can do $file->page (http://cheatsheet.processwire.com/files/file-properties/file-page/) so $filter->page->url should work.
    1 point
  11. I would probably solve this using a search & replace on files.
    1 point
  12. Yeah something might have changed in the last few months. As soon as I have a little bit of time I'm going to look into these recent issues with a new fresh PW 3 installation.
    1 point
  13. If you have team members in a repeater called, say, team, they would be accessible through the API via a foreach(). Something like this- <dl> <?php foreach($page->team as $member){ echo "<dt>$member->name</dt>"; echo "<dd>$member->phone</dd>"; } ?> </dt> Note the bonus suggestion of using a definition list.
    1 point
  14. You probably had the same problem as described here: https://processwire.com/talk/topic/13101-files-are-compiled-twice-translatable-strings-are-not-translated/
    1 point
  15. @Robin, You might be able to get most of what you need from the $_SERVER['REQUEST_URI'] value. You may have to prepend the scheme and host.
    1 point
  16. Thanks both of you - so it really does seem to be a permissions issue. Given @netcarver's report about the file permissions being correct, I was wondering if there was maybe an issue with the folder permissions - I was initially thinking it might be a lack of execute permission on the created "/site/assets/logs/tracy/" folder, rather than the log files themselves, but then I don't see how the file could be written in the first place unless the permissions have changed since the file was initially written. So I am actually not getting anywhere I do have a couple of tweaks coming (one which might fix the issue where @netcarver still had the problem even when the Tracy logs panel was disabled), but I don't think anything will fix this properly yet. What do you both have your $config->chmodDir set to? If you change this (increase permissions), delete the /logs/tracy folder and send something to the log again, does it work now?
    1 point
  17. Oops ... Problem solved! Code beneath should be in home.php and not in _main.php Sorry for this rather stupid mistake! <div id="modalwin" class= "reveal-modal tiny" data-reveal aria-labelledby="modalTitle" aria-hidden="true" role="dialog"> <?php if(!$session->noPop){ echo $pages->get("/inthepicture/baie-musiek")->body; $session->noPop = 1; } ?> <a class="close-reveal-modal" aria-label="Close">×</a> </div>
    1 point
  18. Thanks, Martijn, for looking into this. It was a really stupid mistake on my side that caused the problem. Code in #2 is working fine.
    1 point
  19. You can halt() like this: <?php if ($config->ajax) { // Do your stuff here echo 'Heard It Through The Grapevine'; // Call halt() to prevent further loading return $this->halt(); }
    1 point
  20. just bougth a new PI3, setup apache + pw default profile and got the following performance on the homepage on my local network via WIFI (don't know if a wired setup would be faster?! the pi3 has wifi onboard) 60 requests over 60 seconds (1 per second) 300 requests over 60 seconds (5 per second) 600 requests over 60 seconds (10 per second) PW 3.0.15 everything is really smooth only thing that takes a little time is resizing big images of some MB via GD really nice
    1 point
  21. Better late than never. I'm almost done with my WordPress vs. ProcessWire series. I have about ~8 videos left to make. I will be uploading all the videos to YouTube in a playlist. Need a couple more weeks to finish them off and add a little polish. Here are the videos in the series (not yet in the final order): Installation Pages Page Templates Custom Fields Custom Post Types Blog Documentation API Updates Client Help Plugins Forms Shortcodes Page Order Images Videos Themes Widgets Menus Global Settings and Options Page Caching Search Engine Optimization XML Sitemaps JSON Data Search Users and Roles Config File Multi-Language Data Migration Ecommerce Community Comments Revisions Admin Themes Command Line Interface Hosting Multisite Admin Section Performance Visual / WYSIWYG Editor Bootstrapping Admin Bar Composer Debugging Front-end Editing Page Builders Each video is about 3-10 minutes long and compares a feature in WordPress with the same or analogous feature ProcessWire quickly and concisely. For example, Shortcodes vs. HannaCode, Gravity Forms vs. FormBuilder, WP-CLI vs. Wireshell, WP Rocket vs. ProCache, WP's Menu Builder vs. Menu Builder, etc. Some are a little more in-depth than others. I do give WordPress a fair shake, try to remain objective and let ProcessWire's superior approach to features speak for itself. I will most likely be adding an intro video that explains the series as well with some background as to why I use ProcessWire instead of WordPress and the philosophical differences between the two. The goal is to get people, particularly advanced developers and web firms who know how to code and who are on the fence about switching to a new CMS, to quickly see all the analogous features that they are used to in WordPress done in ProcessWire. Hopefully they will get the warm and fuzzy feeling and explore our community further. If there are any topics you feel that I have missed, please let me know. Make sure the topic is specific enough to warrant a video of its own, as this series is a feature-to-feature comparison. Thanks
    1 point
  22. Great module. Feature suggestion: Would be great if the option to load the dialog could be done via a button on the CKEditor toolbar rather than having to right click to present the context menu. I feel it's too hidden that way.
    1 point
×
×
  • Create New...