-
Posts
691 -
Joined
-
Last visited
-
Days Won
6
Everything posted by thetuningspoon
-
Question about the PagesType class
thetuningspoon replied to thetuningspoon's topic in Module/Plugin Development
Thanks for the reply, SteveB. I am extending the Page class and that part is working well. I am creating several objects, one is a customer. So my Customer class extends the Page class. But now I would like to have a Customers object as well that stores all of the Customers and lets me access them from within my template and module using a $customers variable instead of using $pages. My first thought was that this would mean extending the Pages class, but the way that Ryan did it with the Users class was to extend PagesType. -
This is probably a Ryan question, but perhaps someone else has some experience with extending the PagesType class. Basically, I'm trying to figure out how to extend the PagesType class so that I can create a new API variable like Ryan did with $users. I started by extending the Page class so that I can easily create new objects which are stored like a regular page, but have some additional properties and methods. This is working fine. But now I want to be able to grab and manipulate all of those matching pages from within my module and templates without having to use the $pages variable. Ryan's Users class extends the PagesType class, but it's not clear to me from looking at it how the Users/PageType class creates the $users variable. I did a search on all of ProcessWire's codebase for where the $users fuel is being set, but I can't find it! I can't seem to wrap my head around how the PagesType class can be used to get this all working or where it is actually being instantiated. If anyone can point me in the right direction it would be much appreciated.
-
Totally missed that one! Looks like you beat me to it. Yes, I am using the built-in edit link feature (which Ryan already uses for context-editing of fields in the Template editor) and am passing in the link for editing the page. Then I just added in an option to the field's config settings to enable this on a per-field basis. But this isn't ideal because it's not a separate module and it only works for ASM, so your module is probably the better bet I'll have to give it a try.
-
This is a really great idea. Thanks Pete!
-
Ability to edit pages from a Page field
thetuningspoon replied to thetuningspoon's topic in Wishlist & Roadmap
Followed up on this elsewhere: https://processwire.com/talk/topic/8497-page-table-meets-page-field/?p=84983 -
Using "Page" fieldtype for select dropdown
thetuningspoon replied to Robin S's topic in Getting Started
Hi Cerulean, echo "<p>{$page->bibliography_type->title}</p>"; Should do the trick. The number you were getting it the page ID of the selected item. This should give you the title. Can you attach more of your code so we can have a closer look? Maybe there's a typo somewhere? -
So I spent some time fiddling around with this tonight and managed to get modal editing of page field pages working with the addition of just a few lines of code in InputfieldPage.module: InputfieldPage.module The modified file is attached. I commented the lines that I added with /* MJS 1/15/15 */ You'll want to put this file into /site/modules/ so you don't overwrite the core. Once it's up there, you should see an option in the field config settings for your page field that says 'Allow pages to be edited from field?' Check the box. This only works if you're using ASMSelect with your page field. The catch is that you have to save the page before the modal edit links become available (like when editing fields in the template editor). I think the only way around this would be to significantly re-engineer the ASMSelect inputfield with some AJAXy stuff. Not my strong suit. EDIT: There is a module for this now with more features. Use it instead! https://processwire.com/talk/topic/9857-module-page-field-edit-links/
-
Module Module: Matrix Fieldtype & Inputfield
thetuningspoon replied to kongondo's topic in Modules/Plugins
Yes, I did. The price example confuses me because I'm not sure how it's being used on the front end. Is this being output as a table on the front end for users to be able to determine the price of something they want to order on the site? Or are they using inputs on the front end to select the options they want and the matrix is just used on the back end to determine the price based on those inputs? I'm used to the idea of a product option increasing or decreasing the price based on some fixed value or percentage, so maybe that's part of my confusion. It looks very cool though -
Module Module: Matrix Fieldtype & Inputfield
thetuningspoon replied to kongondo's topic in Modules/Plugins
I feel kind of silly for having to ask this, but what are some ideal use case scenarios where this field would be ideal and superior to a repeater or table field? -
Is there a notes/description field module?
thetuningspoon replied to thetuningspoon's topic in Modules/Plugins
Thanks, this looks like just the thing! -
Has anyone put together a notes/description/help field type for ProcessWire that would allow the developer to enter instructions for the editor on how to use the current template? Similar to how you can add descriptions to fields, except this would let you enter a description, help, or other notes (and possibly even images) to anywhere on the editor page. This would probably be really easy to build if it doesn't already exist. I might take a crack at it if it hasn't been done already.
-
I'll add my backing to this request Modifying the page field so that it can support modal editing of a selected page would be another (perhaps simpler) approach to solving some of these scenarios.
-
Fantastic. Thanks guys!
-
I'm trying to create a page field which can select from any user on the site that is assigned the role "broker". I've setup the field as a basic select input and am using a custom selector (template=user, roles=broker) to display only the broker users. When I edit a page, the select drop down shows all of the correct users. However, if I try to select one and save the page I get the following error: Session: Error saving field "broker" - Page 1031 is not valid for broker
-
Hi Alessio, thank you for your work on this module. It looks like it's just what I need on an upcoming project, and accomplishes it in the same way I was contemplating doing it. One question: Will this index Excel files as well as PDFs and Word files?
-
Can't type into CKEditor when it's blank (Chrome only)
thetuningspoon replied to thetuningspoon's topic in General Support
Yeah, I've been trying to "figure it out" for 2 days... EDIT: Okay, I got it! The problem is that I was using display: flex; on the body element, which was also getting imported into my contents.css file. I changed this to display: block; and we're good to go. -
This a totally bizarre bug that I can't seem to pin down. In one of my 2.5.3 installations, CKEditor does not allow me to type into it if the field is blank. This only happens in Chrome. If I update the field in another browser and go back to Chrome, I can then continue to edit the field. Nothing shows up in the js console. Probably a long shot, but has anyone else had this same issue and found a solution for it? Or any ideas on how I could troubleshoot this better? Thanks.
-
Hi Apeisa, Can't remember if I mentioned this before... Adminbar has a bug now in PW 2.5. If you're editing a page in the admin in a modal window (i.e. a PageTable field or ListerPro set to use modal), when the page is saved the user is redirected to the front end of the page they just edited rather than back to the admin screen.
-
Is it possible to have a formatted date show in the drop down of a Page select field in the admin? I have formatting on for the date field, but it is showing a timestamp in the Page field. Not real user friendly
-
Targeting foreach statements with CSS?
thetuningspoon replied to PhotoWebMax's topic in General Support
Yeah, the nth-child(even) css selector is best if you just need to style alternating rows. -
Targeting foreach statements with CSS?
thetuningspoon replied to PhotoWebMax's topic in General Support
Just to add to Craig's post, if you needed to style each item differently for any reason, you could do something like this: <?php $newsItems = $pages->find("template=widgetNews"); $i = 1; foreach($newsItems as $newsItem) { ?> <article class="newsItem newsItem<?php echo $i ?>"> <h3><?php echo $newsItem->title; ?></h3> <h4><?php echo $newsItem->newsDate; ?></h4> <?php echo $newsItem->newsSummary; ?> </article> <?php $i++; } ?> That would give you the shared newsItem class as well as a unique newsItem# class with the number of the iteration (i.e. newsItem1, newsItem2, newsItem3). Similarly, you could use the page's name instead of a number by tacking that on to the end of the class. -
The real question is: why didn't it explode sooner?
-
Podcast Profile Github: https://github.com/thetuningspoon/PodcastProfile Direct Download: https://github.com/thetuningspoon/PodcastProfile/archive/master.zip Manage your podcasting with ProcessWire! The Podcast Profile is a fully featured iTunes podcast publishing platform built using nothing more than ProcessWire's basic fields/templates/pages system. Automatically generates an XML feed for submission to iTunes. Fully implements the iTunes podcasting specification (https://www.apple.com/itunes/podcasts/specs.html) and supports managing an unlimited number of podcasts and episodes from the same installation. Accommodates both on-site and off-site file hosting. Get it here: http://modules.processwire.com/modules/podcast-profile/ Instructions 1. Upload a fresh copy of ProcessWire to your server. 2. Extract the PodcastProfile-master folder from the zip file to the root directory of the new installation. 3. Rename the folder to site-PodcastProfile <- IMPORTANT! 4. Install ProcessWire as usual. When asked to select a site profile, choose "Podcast Profile". 5. Once installed, you can add a new Podcast via the "Add New" menu in the upper right portion of the admin panel. 6. Fill out the podcast details and then begin adding episodes under the podcast page, or via the "Add New" menu. 7. The XML file for each podcast is generated at http://www.yoursite.com/podcast-name/ (The url of the podcast page) 8. Use this URL to submit the podcast to iTunes at https://buy.itunes.apple.com/WebObjects/MZFinance.woa/wa/publishPodcast
-
Happy Birthday Ryan!! The words Matthew speaks are true. I'm not sure if I'd still want to be in this business if I had never found ProcessWire, and I don't think I could work anywhere now that didn't let me use it. You've spoiled us!
-
Wouldn't advanced devs also prefer the freedom of structuring the templates however they want? I don't see PW being about casual or advanced. It's about providing an elegant foundation for building a totally custom website.
- 206 replies
-
- standarisation
- templates
-
(and 1 more)
Tagged with: