-
Posts
7,480 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
Hi biber, There's quite a number of ways to achieve this. Here's a couple for starters: https://processwire.com/talk/topic/2475-quick-tip-for-testing-on-live-website/
-
For some methods you might want to just return parent::nameOfMethod()
-
#1 Yes...that is what this would entail. This approach is for those who either have a temporary need (e.g. until a PR is accepted) OR for those who've bought a one-way ticket; no looking back . Going by what you are saying, this is not for you #2 Yes, what you are describing is called overriding in PHP (and many other OOP languages). You would have access to protected and public methods and properties but not private ones. Overriding occurs many times in Fieldtypes. Take for example the method ___getConfigInputfields() that's present in quite a number of Fieldtypes. FieldtypeComments has that method. But that's not its origin. FieldtypeComments extends the class FieldtypeMulti, so it inherits it through this class. But wait a minute. FieldtypeMulti is not the origin of that method. Instead, FieldtypeMulti also inherited the method from its parent class, Fieldtype. Look the table here 'Methods inherited from Fieldtype' (you can follow the links deep into the recesses of PW ;-)) Here's some links to helpful resources about this (and similar/related) OOP concepts http://stackoverflow.com/questions/2994758/what-is-function-overloading-and-overriding-in-php http://www.techflirt.com/tutorials/oop-in-php/overloading-and-overriding.html https://www.codecademy.com/forum_questions/516763621eb11e53a20018d5 http://www.phpro.org/tutorials/Class-Hierachies-And-Overriding.html http://www.phpzag.com/overloading-and-overriding-in-php/ http://php.net/manual/en/language.oop5.visibility.php http://stackoverflow.com/questions/4361553/php-public-private-protected http://www.techflirt.com/tutorials/oop-in-php/visibility-in-php-classes.html
-
One way to do it: Grab a coffee (optional) Copy over the core module to your /site/modules/FieldtypeCommentsCustom/ Rename the files, e.g. FieldtypeComments.module to FieldtypeCommentsCustom.module Rename all PHP classes in that folder to e.g. 'OriginalNameCustom'. For instance: FieldtypeComments could become FieldtypeCommentsCustom Make your changes to the files in FieldtypeCommentsCustom folder Install the module FieldtypeCommentsCustom (could have been done before #5 if no database schema changes made) Create a field of type FieldtypeCommentsCustom, add it to your template, edit a page...the usual drill Take your third sip of the coffee in #1 (optional)
-
@Loges #1: I now get it. When you click the link 'Add Media' the modal it opens is essentially the Media Library part of Media Manager, i.e. ProcessMediaManager, but styled slightly differently from what you see when you directly access the Media Library from the ProcessWire admin menu. I am working on a way to only show navigation/tab items that are relevant to the current field you are inserting to. So, in your case, if you only had images, the only tabs you should see are 'Images' and 'Upload'. If you had allowed, say documents and video, then, you would only see 'Documents Video Upload'. You need a media tab since you would need a way to navigate back to your Media Library if you went to 'Upload' tab. #2. Highlighting of the active media (i.e. the media being previewed) has been sorted in MM v003. Did you get my email notification? As for highlighting the crop, edit, icons, that should be sorted with some minimal training. They will always be on the right hand side. #3 Sort of covered in #1? #4 I'll look into insert and close
-
Yes, use a custom date field. We do this in the module Blog with an autoload module. Here's the code if you are interested.
-
A bit of history: PageTable is part of the ProFields. Thanks to Avoine (the sponsors) it has been made available as a free ProField. Here's a link to more info about the different ProFields, thanks to a question by @cstevensjr
-
Not currently, you can't. Maybe you could submit a (pull) request to Ryan? I like the idea of sorting by page
-
Module Comments Manager Enhanced (proof-of-concept)
kongondo replied to kongondo's topic in Modules/Plugins
Forgot to note here that the ideas here have now (have since Dec 2015!) been implemented in the core (ProcessCommentsManager). -
Pagination is not possible in the Inputfield (unless something has changed that I don't know about). For that number of comments, why not use the (new) Comments Manager? You can do your pagination there, filtering, bulk edit, etc.
-
I believe this is the one: https://processwire.com/talk/topic/2038-distinct-selector-in-processwire/?p=43720
-
@kazu, have a read here: https://processwire.com/docs/security/file-permissions/. It should help you decide. Rather than relax permissions that much, if you have the access, it is better to tweak file ownership or groups. Check who owns the files: PW, Apache, nobody, etc. and tweak those (as per the link above).
-
Not wanting to rain on your parade, but seeing that you are missing out on all the fun of playing with ProcessWire, I'd suggest that for starters you install ProcessWire the 'normal' way. Download a zip file and copy that to your server, unzip it, call that location in your browser and click through . Alternatively, get @Soma's online installer thingy (you can edit it to grab the version of PW you want) and it will do the downloading for you plus start the installation. Totally painless. Later on, if you are still up to it, you can play around with deploying via git ... Just my 2p Edit: Oops. welcome to the forums! (where's my manners, tsk, tsk)
-
Probably best to point out (to new users) that setAndSave() is a recent addition. Otherwise you might bet questions why is it not working for me?
-
The /src-min/snippets/ folder could also be slimmed down There's scripts in there for languages like ruby, python, etc.
-
Wishlist: Group field for grouping fields
kongondo replied to steveooo's topic in Wishlist & Roadmap
Couldn't Profields Table accomplish this? -
Why checking existence of a session variable always return false
kongondo replied to adrianmak's topic in General Support
PHP type comparison tables http://php.net/manual/en/types.comparisons.php -
Documentation Update (Work in Progress!) http://blog.kongondo.com/ Blog docs are back! Still work in progress though. Some latest methods and almost all methods' $options not yet covered in the docs. Will get there eventually. Site may not work properly on all devices (you know me and CSS, sigh... )
-
Documentation (Work in Progress!) http://mediamanager.kongondo.com/ Still working on this but at least the basics to get you up and running are covered Getting started Adding media to Media Manager fields in ProcessWire pages Currently, site might not work properly on all devices :
-
You subsequently found a brilliant solution for this, so thanks. Never used/tested the WP one. Maybe I should have a look. Do you mean in the Inputfield (what you see when editing a ProcessWire page with a Media Manager field) or in the Media Library itself? I ask because there are no tabs in the former. The settings for fields only affect individual fields and are not universally applied to the Media Library (the manager itself). But there was a bug in the former in the text being displayed in the Inputfield and I fixed that in MM version 002. I grappled with this (the first part of your statement) during development and settled for highlighting the title with a view to revisiting in the future. Will have a look again. As for the Edit and Crop buttons, I don't understand what you mean. Please clarify. Am not sure I follow. Are you talking about the Media Library or a Media Manager field - Inputfield? Media Manager displays a notice (success or failure notices) when you select media and click on 'Insert Media'. Are you not seeing this in your tests? As for closing the modal window, the idea is that one may want to insert more media from other Media Library pages not currently in view. Closing the window would mean they have to open the modal again in order to insert the other media. I have explained this in the (upcoming) documentation so as not to confuse users.
-
Brilliant find! Thanks. I will need to make a couple of changes e.g. so that upload settings can be displayed and saved. There might be other minor changes needed as well. Will include this in version 003.
-
That would require an in-memory sort. One way to do it (as we wait for @LostKobrakai's better answer ).... Create and populate a property 'distance' on the fly for each page in the PageArray then sort the array by that property. An example: // get a PageArray $res = $pages->find('template=basic-page, limit=15'); // assign distances to a property 'distance' created on the fly foreach ($res as $r) { $r->distance = rand(5, 100);// we assign some random distance just for testing } // testing output $out = ''; // sort #$res->sort('distance');// sort ascending $res->sort('-distance');// sort descending // confirm sorting worked $out .= '<ol>'; foreach ($res as $r) { $out .= '<li>' . $r->title . ': distance - ' . $r->distance . ' Miles</li>'; } $out .= '</ol>'; // it works! echo $out; You should get results similar to this: X-Small: distance - 84 Miles XX-Large: distance - 84 Miles Small: distance - 77 Miles US Open: distance - 75 Miles About Us: distance - 74 Miles Our Achievements: distance - 69 Miles Key Staff: distance - 65 Miles Who We Are: distance - 57 Miles X-Large: distance - 57 Miles Senior Management: distance - 51 Miles Medium: distance - 41 Miles Sizes: distance - 39 Miles Colours: distance - 25 Miles Large: distance - 10 Miles What We Do: distance - 9 Miles Useful reading: PageArray
-
The error says PHP run out of memory (some tasks may still be in memory and still trying to run). Have a look at this thread (see @Nik's and @Diogo's posts especially) on how to optimize such tasks. What PW version are you using? Only asking to confirm what line #111 in the PageTraversal Class does. Sorry, I don't have a direct answer on how to resolve this.
-
#1: Only Superusers can see the modules (listing) page #2: No (but I think you are referring to this? It (can auto-check but not auto-upgrade) - ProcessWire Upgrade