Jump to content
MadeMyDay

Module: PageTableExtended

Recommended Posts

This looks like a fantastic piece of work, great job! But like Pete, I hadn't even noticed PageTable field yet :P, I got it from Reno's tweet!

Share this post


Link to post
Share on other sites

I'd noticed the field and used it, just not the bit where you can add multiple templates in order to be able to drop in different content editor "blocks" (I hate that term, but it fits here) in whatever order you like.

Share this post


Link to post
Share on other sites

It would be nice if the required `title step` can be avoided when using multiple templates. But maybe this is out of scope of this module as it is a thing ProcessWire could handle. 

  • Like 1

Share this post


Link to post
Share on other sites

Only works if there's one template allowed or do I miss something ?

Ahh, it's a setting in the PageTable field. 

Edited by Martijn Geerts

Share this post


Link to post
Share on other sites

Hey Martijn,

I managed this by using the automatic naming option and by setting the title field to hidden and not required in the template context settings (so it doesn't affect other templates) and that seems to be working ok.

The one thing I am really missing (and maybe this is just me) is for the PageTable sub pages to be stored in some sort of hierarchy when using an alternate parent page. I can see a complete mess of hundreds of pages ending up in there, with various -n name appendices. Maybe it would be unnecessary extra cruft, but what if sub parent pages (named to match the actual page that uses the PageTable field) were made to store the PageTable pages. e.g.:

Home
----About (has a PT field called Sections)
----Portfolio (has PT field called Jobs)

PageTableItems (hidden)
----About
-------Sections
-----------Section 1
-----------Section 2
-----------Section 3

----Portfolio
-------Jobs
-----------Job 1
-----------Job 2

instead of the current situation of:

PageTableItems (hidden)
Section 1
Section 2
Section 3
Job 1
Job 2

I know the latter looks simpler, but I can see it becoming a mess and confusing when page names were automatically changed to avoid conflicts.

Anyone agree, or am I on my own :)

  • Like 3

Share this post


Link to post
Share on other sites

@adrian,

I managed the title thing now with making the title not global. ( Gonna try your thing, think thats better :-) )

Yesterday, I played the first time with the pageTabeExtended and didn't even looked at the parent where the subpages are stored.

Building a small website for a friend so storing isn't an issue right now.

Your example looks way better IMHO, but I would go for page id instead of page name (uniqueness insured)

Just to throw one more option in:

PageTableItems (hidden) 
----1234		         // page id (where tablefield is used)
-------sections		         // fieldname
-----------template-timestamp    // name of the template used + timestamp date-created
-----------template-timestamp
-----------template-timestamp

----2345
-------jobs 
-----------template-timestamp
-----------template-timestamp
Edited by Martijn Geerts
When using ID it's not unique when using multiple pageTable field per page

Share this post


Link to post
Share on other sites

Adrian,

I have about 8,000 pageTable pages under a single parent (invasive plant species database). I just consider it a closet that I'm never going to look in. :)

So far I haven't had any issues.

  • Like 2

Share this post


Link to post
Share on other sites

Adrian,

I have about 8,000 pageTable pages under a single parent (invasive plant species database). I just consider it a closet that I'm never going to look in. :)

So far I haven't had any issues.

Maybe you're right - maybe I shouldn't worry about it - maybe it really doesn't matter how messy it gets in there :)

  • Like 1

Share this post


Link to post
Share on other sites

I think we need an option "don't ever display children here" as a template setting. At least for editors. Even I am a bit confused when I accidentally open a folder in the tree where all this data crap is in ;)

  • Like 5

Share this post


Link to post
Share on other sites

When I found out about ProcessWire I missed a configurable Repeater right from the start. The new PageTable module is nice but not quite there. Your module is a step in the right direction. If it wasn't required to enter a title for every added block it would be perfect!

Share this post


Link to post
Share on other sites

Does anyone know why I would be having trouble updating this module? I have tried to update it manually and through PW's interface, but I keep getting version 0.0.8. ModuleManager keeps telling me there is an update to 0.1.0 available, but when I go through the updating process, it still says I have 0.0.8. I am just working on a local wamp setup, so it isn't a matter of life and death; I'm just wondering if I am doing something wrong.

Share this post


Link to post
Share on other sites

Try "check for new modules" to clear things out. The update should show then.

Share this post


Link to post
Share on other sites

That didn't work. The weird thing is, when I open the module files, the version number is version=>010. Everything in the admin persists on listing it as 0.0.8.

Share this post


Link to post
Share on other sites

Hmm. If "check for new modules" didn't clear it up, you can try deleting the module cache files in /site/assets/cache/.

Someone else might have a better explanation as to why that's happening. I feel like I've run into it before, but can't remember exactly what I did to resolve it.

Share this post


Link to post
Share on other sites

Thanks for your help. I may put this on the back burner for a bit and see if I can't get some of the same functionality from Hanna codes.

Share this post


Link to post
Share on other sites

I guess it just depends on what you need. Hanna codes are great, but nearly as robust a solution as pageTable(Extended).

I'm sure someone else will chime in with more details, but good luck whatever route you take.

Share this post


Link to post
Share on other sites

I was seeing the same thing. I went in to the two .module files and changed the version numbers from "010" to "10" and refreshed the modules list and voila. Not sure if that really was the issue, but it worked for me. Ryan mentions this:

"The module version number shouldn't have preceding zeros, as this starts PHP thinking it's an octal number or something else (I don't recall). So version number should be 10 rather than 010."

PS The module files were actually already the correct version - just the reporting that was off.

  • Like 1

Share this post


Link to post
Share on other sites

Good to know! Thanks, guys. The correct version number is probably a trivial thing in this regard, but I appreciate your help and the clarification.

Share this post


Link to post
Share on other sites
"The module version number shouldn't have preceding zeros, as this starts PHP thinking it's an octal number or something else (I don't recall). So version number should be 10 rather than 010."

didn't know that. Updated the version number. Thx!

  • Like 1

Share this post


Link to post
Share on other sites

I have a couple more issues. I'll add, let's say, a block of text using the PageTableExtended field. When I hit the publish button in the modal window, it does not publish. I check the settings panel in the modal box, and it consistently has the box checked for "Unpublished." When I uncheck that box and go on about my business, everything works out wonderfully, but I cannot get it to publish the "regular" way. Am I doing something incorrectly?

Also, I have noticed that when I make changes to one of the PageTableExtended blocks on a page and save the page it is a part of, I get a warning about a "Missing required value" under the Title label. I assume it means I'm missing a title somewhere, but the page has a title and the PageTableExtended blocks have automatic titles. Anyone have any guesses?

Thanks!

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.  
       
      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) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) 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 If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • 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.
    • By adrian
      This module allows you to automatically rename file (including image) uploads according to a configurable format
      This module lets you define as many rules as you need to determine how uploaded files will be named and you can have different rules for different pages, templates, fields, and file extensions, or one rule for all uploads. Renaming works for files uploaded via the admin interface and also via the API, including images added from remote URLs.   Github: https://github.com/adrianbj/CustomUploadNames
      Modules Directory: http://modules.processwire.com/modules/process-custom-upload-names/
      Renaming Rules
      The module config allows you to set an unlimited number of Rename Rules. You can define rules to specific fields, templates, pages, and file extensions. If a rule option is left blank, the rule with be applied to all fields/templates/pages/extensions. Leave Filename Format blank to prevent renaming for a specific field/template/page combo, overriding a more general rule. Rules are processed in order, so put more specific rules before more general ones. You can drag to change the order of rules as needed. The following variables can be used in the filename format: $page, $template, $field, and $file. For some of these (eg. $field->description), if they haven't been filled out and saved prior to uploading the image, renaming won't occur on upload, but will happen on page save (could be an issue if image has already been inserted into RTE/HTML field before page save). Some examples: $page->title mysite-{$template->name}-images $field->label $file->description {$page->name}-{$file->filesize}-kb prefix-[Y-m-d_H-i-s]-suffix (anything inside square brackets is is considered to be a PHP date format for the current date/time) randstring[n] (where n is the number of characters you want in the string) ### (custom number mask, eg. 001 if more than one image with same name on a page. This is an enhanced version of the automatic addition of numbers if required) If 'Rename on Save' is checked files will be renamed again each time a page is saved (admin or front-end via API). WARNING: this setting will break any direct links to the old filename, which is particularly relevant for images inserted into RTE/HTML fields. The Filename Format can be defined using plain text and PW $page variable, for example: mysite-{$page->path} You can preserve the uploaded filename for certain rules. This will allow you to set a general renaming rule for your entire site, but then add a rule for a specific page/template/field that does not rename the uploaded file. Just simply build the rule, but leave the Filename Format field empty. You can specify an optional character limit (to nearest whole word) for the length of the filename - useful if you are using $page->path, $path->name etc and have very long page names - eg. news articles, publication titles etc. NOTE - if you are using ProcessWire's webp features, be sure to use the useSrcExt because if you have jpg and png files on the same page and your rename rules result in the same name, you need to maintain the src extension so they are kept as separate files.
      $config->webpOptions = array(     'useSrcExt' => false, // Use source file extension in webp filename? (file.jpg.webp rather than file.webp) ); Acknowledgments
      The module config settings make use of code from Pete's EmailToPage module and the renaming function is based on this code from Ryan: http://processwire.com/talk/topic/3299-ability-to-define-convention-for-image-and-file-upload-names/?p=32623 (also see this post for his thoughts on file renaming and why it is the lazy way out - worth a read before deciding to use this module). 
       
       
      NOTE:
      This should not be needed on most sites, but I work with lots of sites that host PDFs and photos/vectors that are available for download and I have always renamed the files on upload because clients will often upload files with horrible meaningless filenames like:
      Final ReportV6 web version for John Feb 23.PDF

×
×
  • Create New...