-
Posts
7,529 -
Joined
-
Last visited
-
Days Won
160
Everything posted by kongondo
-
Configurable Process Module (Need walk through)
kongondo replied to renobird's topic in Modules/Plugins
As you wait for other responses, have a look at the following examples from AdminSaveActions module. It looks really straightforward. Thanks for asking this question...I'll be needing this soon . Seems, you set the defaults in one function, then build the form/fields in another function using the defaults previously set...or something along those lines AdminSaveActions module static public function getDefaultConfig() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L51 public function __construct() {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L105 public static function getModuleConfigInputfields(array $data) {} https://github.com/niklaka/AdminSaveActions/blob/master/AdminSaveActions.module#L390 MaintenanceMode module static public function getDefaultData() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L25 public function __construct() {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L38 static public function getModuleConfigInputfields(array $data) {} https://github.com/Notanotherdotcom/Maintenance-Mode/blob/master/MaintenanceMode.module#L52 ProcessTrashman - Last one, static public function getDefaultData() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L42 public function __construct() {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L54 static public function getModuleConfigInputfields(array $data) {} https://github.com/apeisa/Trashman/blob/master/ProcessTrashman.module#L255 MarkupRSS module - Sorry, the very last one (this one has more detailed defaults and some notes) protected static $defaultConfigData = array() https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L32 public function __construct() {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L67 static public function getModuleConfigInputfields(array $data) {} https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Markup/MarkupRSS.module#L219 Tutorial on forum - Create your first Module with configuration settings and a overview page: http://processwire.com/talk/topic/2318-create-your-first-module-with-configuration-settings-and-a-overview-page/ However, this Tut does not set defaults, which I think I have read somewhere is good practice to do? OK, sorry, am overdoing it but this will help me later too ;-) Edit: corrected wrong links + added a tutorial from the forums Edit 2: Something has been eating my links! Anyway, added methods/properties names... -
Writing this quickly, have to run...there could be errors... I don't know what you mean by an included image but here goes: If talking about RTE (e.g. TinyMCE), yes you can include images from other pages... If you are talking about images inserted in pages via image fields, yes, you can grab this and output them in other template files. Just remember: $page will give you access to everything about the current page. If you want to get this page's images, oh well, see link below...;-) $pages will give you access to everything about other pages.. So, if you want images inserted in other pages, you will use $pages to get to them. How you get to other pages using $pages vary - you can get there by path, ID, name, etc...choose the selector that suits you. In some cases, people prefer getting there by ID in case they need to be very sure (since ID does not change). In other cases, people prefer getting other pages by their title since it makes for better human-readable code. http://processwire.com/api/variables/pages/ Also to remember. Sometimes people grab images from a multiple image field and try to echo them out and nothing happens. Point is? multiple image fields will return an array so you would need to loop through them using foreach or similar. Otherwise, for a single image field, you can just echo the image out. Now this may be misleading, you can specifically grab only one image from a multiple image field. In that case, there is no array, so just echo out what you want. I am not sure about best practice. I can't recall anyone here grabbing an image by its id. Pages, yes, but images can be tricky remembering ids. It is more common to grab images (all), or by their index in the array, eq(0), etc. A good practice though is to check if there are images before trying to output them (i.e. using "if"). This saves outputting blank HTML tags, getting PHP errors and sometimes is a good cure for headaches - why isn't my image showing?!? OK, enough theory. For some code, have a read in the docs about images; no need for me to reinvent the wheel: http://processwire.com/api/fieldtypes/images/. It also include image properties e.g. $image->filename. One more thing, at times, something some people forget; as with other fields, grab the images on a page using the name of the image field! People have been known to copy paste code and wonder why $pages->get("selector")->images doesn't work. For the "images", you need to use the image field's name . See also the cheatsheet: http://cheatsheet.processwire.com/ For more complicated scenarios, Google this forum. Some wonderful examples come up
- 1 reply
-
- 5
-
-
Hint...check his signature ;-)
-
Hmmm, it's a she, we are getting somewhere... (twiddling thumbs)....
-
Yeah, I recall those discussion and all sorts of workarounds..
-
That I can vouch for. I spent a long while with MODX before I moved here...then again you may know that already ;-)
-
Is this for real?
-
Hi Pierre, Welcome to the forums. Actually, lots of us have been using 2.4 for a while now..But that is now history, 2.4 is now in RC status! A newsletter went out late last week to this effect. An official announcement is soon to follow. You are good to go! Edit I forgot to respond to the issue about upgrade. Nothing breaks upgrading 2.3 to 2.4, at least not in the core. And I haven't heard of any of the custom modules breaking either...
-
More links for you... http://processwire.com/talk/topic/3619-updating-repeaters-via-api-without-removeall/ http://processwire.com/talk/topic/3969-problem-repeaters-why-u-no-save/?p=38938 Seems you may have to save repeaters individually as well...and not just the page? Maybe that's just for editing? But if adding a second item to a repeater, maybe that is editing? Try and see Edit: Just to reiterate what's on the other thread and in above posts. Repeaters are themselves "hidden" pages. So, You have to iterate through the repeaters and treat them one by one as if they were normal pages.
-
I should have added, "ugly" is relative . You are right, I wouldn't lose sleep over the dotted lines
-
Felix, this is a very beautiful site! One of the best I've seen showcased here! Two issues: - Jumping to sections is a bit too fast for me. - There's an issue with the way menus hovering over each other (can't describe it well) but will edit this post and try again - OK, let me try again: The menus at the top allow the visitor to quickly jump through sections. Once one has jumped to a section, that section's menu is displayed at the bottom of the screen. One would expect that clicking on them the page would scroll down to view the content. That doesn't happen..one has to scroll manually. E.g., If I click on "in balance", I am taken to the right section. However, (and this comes naturally), when I click on Sport und Freizit, I would expect the page to scroll ... Hope I make sense. But very nice site, cheers! Edit: Third issue: - In Firefox, one sees the ugly dotted outlines around the section menu links.Maybe needs a -moz-focus-inner border:0, unless this is intentional, of course
-
Admin Page - "Recently Edited Articles" Link
kongondo replied to Peter Falkenberg Brown's topic in Wishlist & Roadmap
I'm glad you like it landitus. In a sense, PW already has those tables by default - they are just not set up yet . As you know, PW gives you the tools to build what you want (in this case MarkupAdminDataTable). If you look at the code in my example module, it is all PW API. Yes, it has some in built classes to interact with javascript, but it is all PW. Part of PW philosophy is to be clean, lean and mean and not make presumptions. I am liking your idea about generating such tables via the admin UI. Actually, similar things have been done. See the proof-of-concept module by Soma DataTable. Batcher also comes close. Ryan has also spoken of developing a site where pages appeared in a table (IIRC) when they reached a certain number in the tree or toggable or something. I can't really remember the details. But yes, it can be done. Back to the admin tables, if it is something you'd like to discuss, let's open a new thread. In a sense though, Batcher already fulfils some of the functions you are talking about, albeit it is not configurable in terms of what to display. -
@dragan...a clarification - if you have a chance, have a look at Wanze's code in his module Batcher. He creates a permission "batcher" which you can give a certain role. Although the batcher page appears under setup, it doesn't have to be moved manually from under setup in order for the non-supersuser (manager in your case) to see it. They will only see "batcher" or in your case "changelog" under the setup menu; nothing else. Try it and see! Speaking of batcher, I prefer the route batcher takes of creating a permission to give access to the module rather than applying it site-wide with a page-edit permission (Wanze was just giving an example above). Of course, there will be times you don't mind giving permissions site-wide....OK, enough rambling...Hope this makes sense! Edited for clarity
-
Whether we win or not today, guys, you've done an awesome job! Respect all round. Much appreciated... Either way, I see no way that PW will not be packaged by BN...they will do it....(just my take..)...signing off now...
- 191 replies
-
- 4
-
-
- bitnami
- installation
-
(and 2 more)
Tagged with:
-
Co-founder of Bitnami votes for PW. Huh?
- 191 replies
-
- bitnami
- installation
-
(and 2 more)
Tagged with:
-
Disappointing.. I'm not watching this anymore...
- 191 replies
-
- bitnami
- installation
-
(and 2 more)
Tagged with:
-
If interested in further developing your php skills, some handy tips I have received/learned from the pros in these forums include.. var_dump gettype - this will tell you the data type - object, array, etc. exit - this will allow you to go get some coffee ;-) - instead of smashing your head against the wall! (kidding!) Happy coding!
-
Someone more knowledgeable than I will give you a better answer but am wondering..why not just create pages outside admin for each user if that's what you are after? Behind the scenes, users (i.e. those under admin/users) are also pages! So, you can create a parent page "riders" with child pages "ridername". You will just have to access them with the $page or $pages variables rather than $user. You can then associate users (created in Admin) with their pages (those under "riders"). A search of the forums will reveal this has been done before (and it gives you more options quickly, although users under Admin can also be extended [via the user template]). You might also want to check out the various PW modules that help manager user access on a page or field level. Edited for clarity
-
Nice! Thanks. Aaah, a Windows issue.... Let me test.. Edit: Bazinga! Fixed! Am the proud owner of a brand new Core tab!
-
Attached, the whole list (local install, no worries...) fields.txt
-
No errors - it works as intended; outputs a list of all modules and the files they come from....
-
Yes, they are listed under Site tab (PW 2.3.15, W7, Chrome, FF, IE). This drove me nuts yesterday debugging! tried in xampp 1.77, 1.8x, Uwamp - no dice! But it works in two different remote servers! The mystery InputfieldWrapper4 just doesn't show up! A search for "autocomplete" reveals the same 4 hits in both cases, i.e. where the "Core" Tab does not show up in some installs and where it does. See code below <span role="status" aria-live="polite" class="ui-helper-hidden-accessible"></span><input type="text" id="ProcessPageSearchQuery" name="q" value="" class="ui-autocomplete-input" autocomplete="off"> <td><a href="edit?name=InputfieldPageAutocomplete">Page Auto Complete</a></td> <ul class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all" id="ui-id-1" tabindex="0" style="display: none;"></ul></body></html> Edit: @Ryan....RE your quote above, this is a typo "InputfieldAutocomplete", no? Should be InputfieldPageAutocomplete
-
Admin Page - "Recently Edited Articles" Link
kongondo replied to Peter Falkenberg Brown's topic in Wishlist & Roadmap
Thanks Adrian for the reminder. Yes, there's that as well. I forgot to mention that this could also be accomplished using a custom admin page....We're spoilt for choice with PW! -
Nik, thanks for the update! I'll test and see if I disagree (e.g. make the choices configurable? or maybe that's overcomplicating things...)