Jump to content

gmclelland

Members
  • Posts

    565
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by gmclelland

  1. I'm not sure if we are talking about the same thing, but I remember having a similar issue. To get rid of that message, I had add this to my config.php

    // I receive a warning when visiting the admin area
    // Warning: your server locale is undefined and may cause issues. Please add this
    // to /site/config.php file (adjust “en_US.UTF-8” as needed): setlocale(LC_ALL,'en_US.UTF-8');
    setlocale(LC_ALL,'en_US.UTF-8');

     

  2. I'm not fully understanding your question.  Are you wanting to update the composer dependencies from within Processwire like the Processwire Upgrade module does?

    Ex. update a GoogleCalendar library to the latest version?

    Or.. Are you asking what is the best way to include a third party library within a module?

    In this case, I would advise NOT including the library directly in the module.  Have the user install it separately via Composer.

    I like how Wanze did it in the new version https://github.com/wanze/TemplateEngineTwig

    One command ran by the user will download the third party dependency, update the composer.json, install the dependency in the correct vendor folder, and install the module in the correct Processwire modules folder.

    Here are a couple links you might find interesting:

    https://processwire.com/blog/posts/composer-google-calendars-and-processwire/

     

     

    • Like 1
  3. Maybe you can use the truncate method https://processwire.com/api/ref/sanitizer/truncate/ ?

    // Truncate string to closest word within 150 characters
    $s = $sanitizer->truncate($str, 150);

    Here is another example of how to use a hook to add a "summarize" method to all the $page objects

    https://processwire.com/blog/posts/pw-3.0.28/

    Here is reset https://secure.php.net/manual/en/function.reset.php

    Here is explode https://secure.php.net/manual/en/function.explode.php

    • Like 1
    • Thanks 1
  4. So it seems like both Page Trees (the one at /processwire/pages/ and the one shown in the picture above) have an id = 3.  So I guess you would somehow have to determine if the page is displayed in some kind of modal or not and then apply the hook or MarkUpPageTree?  Does that sound right or even doable?

  5. Thanks @tpr and @Robin S!  Your module update **very quickly** fixes the immediate problem with the breadcrumb trails and breadcrumb dropdown menu items when used with the MarkUpPageTree module.

    A little off topic to this thread now, but I would still like to modify the MarkUpPageTree module to only operate on the Page Tree on /processwire/page/.  Do you know of any way to do that?  Maybe only somehow autoload on page id = 3 or something like that? 

    This is what I want to prevent.  In the picture you can see the MarkUpPageTree module showing the template names in Page Tree Side Panel.  I really only want to show that on /processwire/page/

    pagetree.thumb.jpg.21dd3441a171e5d28693a9fd46a338a2.jpg

     

  6. Just tested the new feature in 0.1.16.  It worked great except I had to disable the MarkInPageTree module from https://github.com/benbyford/MarkInPageTree

    I use that module to include the template name floated to the right of the Page name when viewing the Page Tree.

    Ideally, I only want the MarkInPageTree's Page Tree modifications to only show when I'm on the Page Tree at /processwire/page/.

    I've tried modifying the MarkInPageTree module's autoload key to the following:

    using a selector string

    'autoload' => 'id=3',

    and using an anonymous function

    'autoload' => function() {
                  if((wire('page')->template == 'admin') && (wire('page')->id == 3)) return true;
                    else return false; 
                },

    as seen from 

    Both didn't seem to work.  The labels on the Page Tree stopped showing on /processwire/page

    Any idea of how I can get the MarkInPageTree module to only show when viewing the Page Tree on /processwire/page and not show in the breadcrumbs when the BreadcrumbDropdown module is enabled?  I also don't want the MarkInPageTree module to show when the sidebar is opened and the Page Tree is displayed when clicking on the tree icon.

     

     

    • Like 1
  7. 1 hour ago, ryan said:

    I went back and forth on this one a couple weeks ago, but settled on the centered version after a lot of testing. Centered felt much more balanced, perhaps because the lines are so short that all the weight ends up on the left side. These are just short snippets of text, but if it were any longer then no doubt we'd want to go left aligned.

    - Sorry if I wasn't fully clear.  I meant to only left justify these elements on the mobile breakpoint/view when everything is vertically stacked.  Above that breakpoint everything looks fine center justified.

×
×
  • Create New...