Jump to content

gmclelland

Members
  • Posts

    565
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by gmclelland

  1. https://github.com/processwire/processwire-requests/issues/191
  2. I was just wondering if it is possible in Processwire to move Composer's vendor directory outside of the web root folder to a location that is not web accessible? Is there a configuration variable to control this? I couldn't find information in my searches. Why would I want to do this? ...for security. I don't want script kiddies trying to scan for/exploit vulnerabilities in my installed php libraries.
  3. Hello @Soma, thank you for providing this module. On one site in production, I noticed that for some reason the top level menu items change randomly in a different order. On a page I can keep hitting the refresh button and the menu items will randomly change order. My tree order looks like this: Home About Us Support Us Resources Memberships Sometimes the menu is rendered correctly and other times it renders like: Home About Us Support Us Memberships Resources Here is how I'm calling it: (Note: I'm using the TemplateEngineFactory module. That is why you see the $view->set) I have also tried it without the sort=sort, but I have the same random results. Does anybody have any ideas as to why I'm seeing this problem? I'm running Processwire 3.0.101. Thank you for any help you can provide.
  4. This was an interesting read. http://blog.mauriziobonani.com/processwire-building-a-basic-reserved-area/
  5. @justb3a I was able to fix this module to work with the latest version of TemplateEngineTwig by modifying TwigExtensions/composer.json to: { "require": { "twig/extensions": "~1.5", "twig/twig": "~1.35" } } and then run composer update. Twig also gets installed when composer install is ran because it is a dependency of Twig Extensions Library. So anytime the TemplateEngineTwig module updates it's version of Twig, this module will also need it's version to match. Here's the pull request. https://github.com/justb3a/processwire-twigextensions/pull/11 I think we also should remove the debug extension. That's included in the TemplateEngineTwig module now. See https://github.com/wanze/TemplateEngineTwig/commit/776d3d8b3cf2fd04ea584d92fdc33e214468996b#diff-174a5e0bac30f021aa66bb8899550f87R55 I'll try to create a pull request for this fix as well. Hope that helps!
  6. @V7dev make sure you're using the versions I specified above. If you use all the latest versions of the modules, you will run into the errors.
  7. @V7dev - Twig Extensions module seems to work fine with Template Engine Factory 1.1.3 and Template Engine Twig 1.0.4 Hopefully @justb3a can take a look some time soon to see why it's not working with Template Engine Twig 1.1.0? I'm still trying to figure it out, but I'm not making much progress.
  8. Strangely, I tried updating the module with the ProcessWireUpgrade module, but it gave me an error "Session: Invalid download URL specified." It might have been because I originally downloaded the module from github. The text looks good now, it's no longer cut off. Thanks Robin!
  9. The problem with the core implementation is that isn't immediately discoverable that you can click the image's filename and rename it whereas your solution make's it obvious with a label "Rename / Replace." Most content editors aren't very technical savvy. Ah..Forgot about that one. Thanks I tried to take a look at tonight, but it looks a little more involved to get it just right across the different themes. I think the cutoff text is due to the negative margins. I'll investigate some more the next chance I get. I'm running Chrome on a mac with the latest version of Processwire and AOS.
  10. That's a great solution! Thanks Robin for providing this module. I just installed it and noticed a minor issue: See how the "R" in Rename and Replace gets cutoff? Do you plan on adding it to the Modules directory? It would make it easier to upgrade. It would also be cool if you made a similar module to handle image fields the same way. Maybe with an option to disable core's "click the filename to rename" feature and the drag and drop on thumbnail to swap the image? That way file and image fields are consistently the same and the "Rename / Replace" feature would be controlled by a permission both for image and file fields. I doubt many people know of those features any way? Drag and drop an image on a thumbnail could be considered a destructive action that may not be the intended behavior of the user? An easy way to disable the rename of the filename feature could be to remove the contenteditable attribute? I'm in hurry right now, but I just wanted to share the few thoughts I had. Thanks again
  11. Great job @adrian! I'm just confirming that the update did get rid of the error I was seeing. I like the new enhancements and how the image is displayed. What do you think about the thumbnail linking to the original file?
  12. Hi Adrian, Just upgraded to the latest version and noticed an error in the "Request Info" panel: ErrorException: Trying to get property of non-object in /Users/glenn/websites/mysite/wwwroot/site/assets/cache/FileCompiler/site/modules/TracyDebugger/panels/RequestInfoPanel.php:643 Stack trace: #0 /Users/glenn/websites/mysite/wwwroot/site/assets/cache/FileCompiler/site/modules/TracyDebugger/panels/RequestInfoPanel.php(643): Tracy\Bar->Tracy\{closure}(8, 'Trying to get p...', '/Users/glenn/we...', 643, Array) #1 /Users/glenn/websites/mysite/wwwroot/site/assets/cache/FileCompiler/site/modules/TracyDebugger/panels/RequestInfoPanel.php(458): RequestInfoPanel->getFieldArray(Object(ProcessWire\Page), Object(ProcessWire\Field)) #2 /Users/glenn/websites/mysite/wwwroot/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Bar.php(159): RequestInfoPanel->getPanel() #3 /Users/glenn/websites/mysite/wwwroot/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Bar.php(108): Tracy\Bar->renderPanels() #4 /Users/glenn/websites/mysite/wwwroot/site/assets/cache/FileCompiler/site/modules/TracyDebugger/tracy-master/src/Tracy/Debugger.php(293): Tracy\Bar->render() #5 [internal function]: Tracy\Debugger::shutdownHandler() #6 {main} I tried refreshing the modules but it didn't make any difference. ProcessWire: 3.0.98 PHP: 7.1.12 Webserver: Apache/2.4.29 (Unix) MySQL: 5.7.10-log
  13. Thanks @Wanze, I haven't ran into any issues so far, but that's good to know. The only thing I'm currently stuck on right now is trying to figure out how to get the TwigExtensions module to work with the latest versions of TemplateEngineTwig. It was working previously before TemplateEngineTwig 1.1.0. Any help testing is appreciated. Are you using TwigExtensions library at all in your projects? If not, don't you need the date functions and text truncating functions? After I get my sites upgraded to the latest version of TemplateEngineFactory and TemplateEngineTwig, I can start checking into a possible bug I think I see with the new changes to handle Wire404Exception. Side note: I really appreciate the work you've done on this module. To me it is so much cleaner looking at Twig code than looking at a php mixed with html. I like that in Processwire, I can simply build up my variables in the template to be sent to the view. That way my views(Twig files) are very simple and contain simple logic only.
  14. Nevermind. Rookie mistake. I just needed to check if the post.template == "calendar-posting" before trying to access post.event_description.
  15. I have two templates: basic-page title body calendar-posting title event_description I'm trying to build a search page that can search for text in any of those fields. Right now my selector looks like "title|body|event_description*=support, limit=3". It correctly returns a Page Array when I perform a search. I can output the page's title just fine, but the problem happens when I try to output the event_description field. I get the following error: User Error Exception: An exception has been thrown during the rendering of a template ("Method Page::event_description does not exist or is not callable in this context") in "search.twig" at line 50. (in /Users/glenn/websites/mysite/wwwroot/site/assets/cache/FileCompiler/site/modules/TemplateEngineTwig/TemplateEngineTwig.module line 110) Note: I am using the TemplateEngineTwig and TemplateEngineFactory modules. In my search.twig {% for post in paginated_items %} <article class="card post"> <div class="card-section"> <h3> <a href="{{ post.url }}" title="{{ post.title }}">{{ post.title }}</a> </h3> <div class="meta"> <p>{% if post.editable() %} <a href="{{ config.urls('admin') }}page/edit/?id={{ post.id }}">Edit</a> {% endif %} </p> </div> {% if post.event_description %} <div class="post-content">{{ post.event_description|striptags('<style>')|truncate(440, false, "...") }} <a class="read-more" href="{{ post.url }}" title="{{ post.title }}">{{ 'Read More' }}</a> </div> {% endif %} </div><!-- card-section --> </article> {% endfor %} Anyone have any ideas as to what could be the cause? If the returned PageArray from my find returns two items, I should be able to access and output any of those page's fields right?
  16. Although Drupal specific, https://www.chapterthree.com/blog/slice-template this explains the concept of page slices. "It’s a design structure that enables site authors to create web pages out of modular, horizontal components that span the width of the browser." Basically I was just wondering if what you were making would allow an editor to build these page slices that contain columns that contain components/widgets?
  17. In my comment, I was referring to something like this: See how the row background spans all the way to the edge of the screen? Some people call these page slices. In the example image there is two page slices that each contain their own columns. One has a white background the other has a grey background.
  18. Thanks for sharing your video @Jonathan Lahijani! In case your interested, I added your technique to my "Techniques for flexible page layouts in Processwire" document https://docs.google.com/document/d/1peY-FUpevKgy87cKOxIVz8jwcv2-3c61zbiJr3QKO6c/edit?usp=sharing
  19. Great work @theo! I'm interested to see how this plays out. Will you be sharing the steps/code used to make this? I added your technique to my document "Techniques for flexible page layouts in Processwire" https://docs.google.com/document/d/1peY-FUpevKgy87cKOxIVz8jwcv2-3c61zbiJr3QKO6c/edit?usp=sharing. Will this also handle the case where you have full bleed rows with contained columns on the inside?
  20. Also another thing I noticed is that as of Twig 1.5 debug extension is replaced by Twig's dump function. https://github.com/twigphp/Twig-extensions/commit/5807439c9924323e202c728ceb3199635f09c7e6
  21. @ak1001, Forget about home.html. You only need to use home.php and home.twig. All of your PHP stuff goes into home.php and your html stuff goes into home.twig. Example: in home.php <?php namespace ProcessWire; $view->set('mytitle', $page->title); In home.twig <h1>{{ mytitle }}</h1> <div class="body-content">{{ page.body }}</div> This code assumes your Processwire home template has a title and body field.
  22. Hi @ak1001, Welcome, I personally like to use home.php as my controller and home.twig as the view. Using the .twig can provide Twig syntax highlighting in some text editors. Make sure you set the .twig extension in the Template Engine Twig module settings > Template File Suffix I prefer to keep those file in the same directory. It's less context switching when your looking for files. Template Engine Twig module settings > Path to templates = templates/ In your case, I would use the following: site/templates/home.twig <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>{{ page.title }}</title> </head> <body> <h1>{{ page.title }}</h1> {{page.body}} <hr> <p>myvar:{{myvar}}</p> </body> </html> site/templates/home.php <?php $view->set("myvar", "my test var"); Hope that helps
  23. Hi @justb3a, I just noticed when I upgraded to the latest version of TemplateEngineTwig that I'm now getting an error message. I think the TwigExtensions vendor library might possibly need to be upgraded in this module as well. On https://github.com/twigphp/Twig-extensions it say's it is up to 1.5.1. This module includes 1.3. TemplateEngineTwig upgraded Twig from 1.24.2 to 1.35 I just manually tried to "composer update" in the TwigExtensions module directory, but now I get a different error: Do you have any ideas as to why I'm getting these errors?
×
×
  • Create New...