Jump to content

Recommended Posts

7 hours ago, dragan said:

Is it possible to show also custom page list names?

i.e. if I define in my template to use certain fields for page list

{title} {client_name} {pl_active_only} {year}

I added support for this in v0.1.16

  • Like 4
  • Thanks 1

Share this post


Link to post
Share on other sites

Wow, thanks a lot! 👍

Will give it a try tomorrow.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
13 minutes ago, gmclelland said:

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?

In v0.1.17 I call the label method so hooks are not triggered - please update and report back if you're still experiencing issues.

  • Like 1

Share this post


Link to post
Share on other sites

@gmclelland With AOS PageListTweaks you can add "{title} [em.my-template-class]{template.name}[/em]" to a template's "List of fields to display in the admin Page list" and they are shown only in the page tree and not in the breadcrumb dropdown. Note that this requires editing every template so it may not be the one you need.

image.png.3b8ba44180298b2eafb20e452dc57be3.png

@Robin S

I have some pages without title and they show up in the breadcrumb menu like this:

image.png.096dd7e78db63efb2578363fd6ebc213.png

I know it's not a common thing but apparently PW saves the page even if you don't fill the title, so the page name could be added as a fallback ($page->get('title|name')). Perhaps such pages could be surrounded with eg. square brackets to indicate that it's the name and not the title.

  • Like 2

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

Can't you just hide them there with CSS?

Share this post


Link to post
Share on other sites

That could be an option.  Although that would probably be my last option.  I prefer to prevent the extra data from being loaded in the first place.  

Share this post


Link to post
Share on other sites
57 minutes ago, tpr said:

so the page name could be added as a fallback ($page->get('title|name')).

Thanks, added in v0.1.18

57 minutes ago, tpr said:

Perhaps such pages could be surrounded with eg. square brackets to indicate that it's the name and not the title.

I understand your thinking here, but I think it's clearest if Breadcrumb Dropdowns keeps to the conventions of the page labels in Page List as much as possible, and Page List falls back to the page name without adding square brackets.

  • Like 2

Share this post


Link to post
Share on other sites

@Robin S - would you be willing to add support for User pages (ProcessUser) as well please?

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, adrian said:

would you be willing to add support for User pages (ProcessUser) as well please?

I have added support for this in v0.1.19.

The scenario of editing user pages is a different kettle of fish than "normal" pages because you are then outside the structure of what are normally considered editable pages. So there isn't much that's useful in the dropdowns apart from the last dropdown.

  • Like 3

Share this post


Link to post
Share on other sites

Thanks @Robin S - that's a really handy addition for my needs - hopefully others will enjoy also!

  • Like 2

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks @flydev, but that solution feels less than ideal - I think there is a better way. If you want to implement the AdminThemeUikit breadcrumbs in your custom theme (which you would have to in order for the Breadcrumb Dropdowns module to work) then you can just call AdminThemeUikit::renderBreadcrumbs() because it is a public method.

So in your custom theme template files where you want to output the breadcrumbs you can do something like this:

echo $modules->get('AdminThemeUikit')->renderBreadcrumbs();

 

Edited by Robin S
typo
  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks @Robin S I see,

anyway I just tested to call this function, it works fine on ProcessPageEdit but when I switch to, for example, on a ProcessModule (a config module page) the breadcrumbs isn't rendered :

<!-- MAIN CONTENT -->
	<main id='main' class='pw-container uk-container uk-container-expand uk-margin uk-margin-large-bottom'>
		<div class='pw-content' id='content'>

			<div class="uk-breadcrumbs">
				<?php if ($layout != 'sidenav' && $layout != 'modal') echo $modules->get('AdminThemeUikit')->renderBreadcrumbs(); // echo $adminTheme->renderBreadcrumbs(); ?>
			</div>
          
[...]

 

Result on ProcessPageEdit :

1595557160_Capturedecran2019-05-23a09_23_57.png.ab46ff33eae896ea9ee1bc51108ae302.png

Result on ProcessModule (Breadcrumbs's module config page) :

807590720_Capturedecran2019-05-23a09_23_11.png.96b3ded81da04542092adbcfaa40a070.png

Edited by flydev
typo

Share this post


Link to post
Share on other sites
3 hours ago, flydev said:

when I switch to, for example, on a ProcessModule (a config module page) the breadcrumbs isn't rendered

Ah right, unfortunately AdminThemeUikit::renderBreadcrumbs() returns early unless some protected class properties are set, and there is no setter method provided.

It's a shame that AdminThemeUikit wasn't designed with flexibility for customisation in mind, because it means that users like yourself have to create a totally separate theme that duplicates almost the entirety of the AdminThemeUikit code just to achieve a few minor changes. It would have been nice if something like Markup Regions could have been employed in the theme template files.

But it looks like there's no better way for now, so I've merged your PR.

  • Like 2

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild. 
      EDIT: You can now install it directly from the Modules directory: http://modules.processwire.com/modules/inputfield-float-range/
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Optional step value (Read more) Optional manual override of the selected value (will still adhere to the rules above) Configurable rounding of manually entered values (floor, round, ceil, disable) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant  
      Changelog
      004 (current version)
      - Make rounding of manually entered values configurable (floor, round, ceil or disable)
      - Fix small JS bug when the value-display field was not displayed
      - Update README
      003
      - Code cleanup, add some ModuleInfo data & LICENSE
      - Submit to PW Modules directory (http://modules.processwire.com/modules/inputfield-float-range/)
      002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional
      001
      - Initial release
       
      Thanks!
       
       
    • By Gadgetto
      Status update links (inside this thread) for SnipWire development will be always posted here:
      2019-10-18
      2019-08-08
      2019-06-15
      2019-06-02
      2019-05-25
      If you are interested, you can test the current state of development:
      https://github.com/gadgetto/SnipWire
      Please note that the software is not yet intended for use in a production system (alpha version).
      If you like, you can also submit feature requests and suggestions for improvement. I also accept pull requests.
      ---- INITIAL POST FROM 2019-05-25 ----
      I wanted to let you know that I am currently working on a new ProcessWire module that fully integrates the Snipcart Shopping Cart System into ProcessWire. (this is a customer project, so I had to postpone the development of my other module GroupMailer).
      The new module SnipWire offers full integration of the Snipcart Shopping Cart System into ProcessWire.
      Here are some highlights:
      simple setup with (optional) pre-installed templates, product fields, sample products (quasi a complete shop system to get started immediately) store dashboard with all data from the snipcart system (no change to the snipcart dashboard itself required) Integrated REST API for controlling and querying snipcart data webhooks to trigger events from Snipcart (new order, new customer, etc.) multi currency support self-defined/configurable tax rates etc. Development is already well advanced and I plan to release the module in the next 2-3 months.
      I'm not sure yet if this will be a "Pro" module or if it will be made available for free.
      I would be grateful for suggestions and hints!
      (please have a look at the screenshots to get an idea what I'm talking about)
       




    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
×
×
  • Create New...