-
Posts
7,479 -
Joined
-
Last visited
-
Days Won
146
Everything posted by kongondo
-
Introducing Variations, an Input- and Fieldtype for product variations and their attributes. Product variations is a topic that has been coming up now and then, especially in the recent past. This module seeks to fill this gap. Though it's in its early stages of development, it is already functional and can be used as is. I decided to make an early announcement (modules development forum) in order to get early feedback from potential users. The module is an alternative take on how variations can be built for a product. Imagine the ubiquitous T-Shirt. The product could vary by ...Size, Colour, Material, etc...These variations could in turn have internal variations, i.e. attributes....so, Size [Small, Large], Colour [Red, Blue]...etc; you get the drift. The usual approaches to building variations have been either to use Multiple pages, Repeaters, Page Table, Table or Matrix (limited to 1x1 variations). In this module, we do it a bit differently. First, the variations occur not at the Field level (meaning all product pages would have the same variations and attributes for each template) but at the page level. Secondly, there are no multiple pages for each variation and/or attributes; a product is a single page. The variations and their attributes are defined by site editors at the page level. Once a variations configuration has been defined, it is applied to the page and all possible combinations are generated (i.e. the Red,Small,Cotton; Red,Large,Cotton, etc) in the Inputfield. There is no limit to the number of variations and attributes that can be defined, although you will be amazed at how quickly the combinations grow! Prices are entered for each combination when editing the page. Combinations without prices are not saved to the database. Please note that prices cannot themselves vary at the page-level. Meaning, you cannot have ONE variation configuration that has different price inputs per product in the same FieldtypeVariations field. The module ships with an API for outputting variation combinations in the frontend. Search, database and in-memory work as normal in the frontend. In the backend, DataTables provides a nice paginated, filterable table. Prices can be entered on any pages (of the table) without loss of data (meaning you can enter prices on page 1, scroll to page 10, enter more prices, filter or search the products table, enter more prices and finally save; no data will be lost). I still have a couple of ideas and plans pending but would love to hear from you, thanks. Below is a short video demo of the module in its current state. Things may/will change, both UI and features. Btw, the Fieldtype, although primarily targeted at commerce applications, is by no means limited to this. Other uses requiring combinations of whatever number of variables are very much within the remit of the module. Planned/Hoped for features Import/Export product variations and attributes (Excel, etc) Full integration with Padloper (I will have to discuss with @apeisa) SKU fields for each product variation Add/Remove extra subfields, e.g. multi-currency prices (currently there is only 1 input for each product variations' price) Product variation images? Etc... Please not this module is not related to this other planned module (but it may eventually). Sneak Peek Demo
- 11 replies
-
- 9
-
Welcome to PW and the forums @TorLan. Yes, that's how it works. It's for outputting a date in the frontend. So, there's is no timepicker in the frontend with this field.
-
What's the most up-to-date method of restyling the CMS?
kongondo replied to cjx2240's topic in General Support
This will soon be the 'most up-to-date' method . Admin themes in ProcessWire are modules. There is no way to directly edit the theme in some editor within the admin to get the results you want. To change stuff and to make sure they don't get overwritten, you can copy and rename (including class rename) an admin theme module and edit it to your liking and install that. I stand to be corrected but I think you can install a custom admin theme that way, i.e in /site/modules.- 1 reply
-
- 4
-
What @LostKobrakai said. Just to expound on it. Your aim is to find pages [in this case 'coaches'] that use a particular category [in this case the children of 'Provinces']. As a by the way, it is also possible to do the inverse, i.e. find the 'categories' that a page uses. In that case, what you would be doing is just looping through Coach 1, etc, and outputting the category pages in their coach_provincie [i.e. the page reference field]; but I digress. Back to the question at hand. You do not need (can be dangerous, not user friendly, etc) code in your editor You do not need multiple templates for your provinces, i.e. Limburg, Drenthe, etc. Suggestion for your templates: Coaches:// template 'coaches' -Coach 1// template 'coach' -Coach 2// -ditto- etc. This is how my references tree looks like: Provinces:// template 'provinces' -Limburg// template 'province' -Drenthe// -ditto- -Utrecht// -ditto- Which coaches travel to this province? When viewing a particular province page, e.g. /provinces/limburg/ and want to find all coaches that are available for this province, all you need is to add Lostkobrakai's code above to the template file 'province.php' <div class="row"> <?php $coaches = $pages->find("coach_provincie=$page->title"); foreach ($coaches as $coach) { echo '<div class="col-md-6"><a href="'. $coach->url .'">'. $coach->title .'</a></div><div class="col-md-6">'. $coach->coach_locatie .'</div>'; } ?> </div> That code will return coaches that have 'Limburg' [the $page->title] in their page reference field (the one with the checkboxes - 'coach_provincie'). Which provinces does this coach travel to? On the other hand, if you want to know which provinces a coach travels to, e.g., Coach 1, (i.e. this URL /coaches/coach-1/, all you need to do is something like the below in the template file 'coach.php' foreach($page->coach_provincie as $destination) { echo $destination->title . '<br>'; } That's it .
-
Glad you sorted it out. Question is, were those permissions changed between Friday and Tuesday? If yes, how and by whom? Hmm..
-
I am a bit confused here. Do you mean AND and not OR? I.e. do you want normal posts to open as /mysite/blog/blog1/ AND news posts to open as /mysite/news/news1? OR you are happy with either? If AND, then you will need URL rewriting as explained here (quite advanced code) or similar. If you mean OR, then just rename the page 'Posts' to whatever you need, i.e. either 'News' or 'Blog'. I am not sure I understand this either. I assume you mean clicking on the sub-navigation on the right-hand side (in the demo blog template files)? If yes, that navigation is built using the method renderNav() in MarkupBlog. You might have to create your own custom navigation in that case.
-
To be honest, am totally clueless. I don't still get the reason why you should have code in your editor. Maybe if we saw a page tree and a bit more clarification we'd be able to advise better.
-
No. I am looking at this: From your code, it seems the 'difference' is based on these pages' children? You can output the menus in the single template file based on the page that is being viewed...i.e. $page->children; Maybe I am missing something?
-
Do you really need to generate menus in the text area? Why not in the pages' template files?
-
As you can probably tell, I am pretty ignorant about multi-lingual features of ProcessWire . I don't have time to investigate right now so will appreciate any thoughts/pointers. My guess is that in a multi-lingual site, ProcessWire will automatically duplicate fields attached to templates for each language? If that's the case, then implementing your request becomes much easier.
-
Madness! Would you get into one of these?!! http://www.bbc.co.uk/news/technology-38967235 https://www.engadget.com/2017/02/13/ehang-184-passenger-drones-dubai/ Aah, just letting off steam..
-
Welcome to the forums @looper . You'll need to upgrade to at least ProcessWire 3.0.46 for that feature according to the docs here.
-
Matching a variable with a textarea's content?
kongondo replied to phil_s's topic in General Support
3b. Or PHP's DOM Parser . -
Yes...it is.
-
->url on image not giving full path, only folder with no filename
kongondo replied to joer80's topic in General Support
Aah, good to know . -
->url on image not giving full path, only folder with no filename
kongondo replied to joer80's topic in General Support
Actually, output formatting is always off in a module. If output formatting is off, Image fields will always return an array, no matter your settings. So...first(), last(), eq()....are your go to guys... -
No worries. Had just come to that conclusion just before your response. Actually, I am the idiot! I notice that 'acceptFileTypes' is not documented! Users shouldn't have to read the module code to know how to use it ! When I get the time.....(ahem..). Yes, so what was happening is that good ol' WireUpload was rejecting those file extensions at this point. Glad you got it sorted and now thanks for the reminder that I'll need to update the docs .
-
@Chris Whissen, Hmm. It means, then, that the reason they are not passing validation is because they are failing the PHP mime type tests. This is either because their mime types are unknown or the 'files are not what they seem' (aka faked files)': Can you confirm you are passing the allowedNonImageMimeTypes to processJFUAjax() If they don't contain any sensitive data, is it possible to PM a couple of those files getting rejected to help me debug this further?
-
@Chris Whissen, Welcome to the forums. Glad you are finding the module useful. Does any of these conditions (see the @note) apply in your case?
-
@bmacnaughton. That's not what I meant. What I meant is that ProcessWire offers you a number of tools to sanitise values. Depending on whether you are a frontend developer vs, say, a module developer, you will probably be using a subset of tools more than another subset. In other words, at the end of the day all input should be sanitised; the tools you use will vary depending on the job at hand.
-
@vanderbreye, Glad you like the module. Interesting thought. It would require a change in the database schema though, so would have to think about it carefully. Maybe add an option configurable when setting up the field indicating whether the extra descriptions input. The multi-language aspect of it is what I have no idea how to implement but it doesn't sound like a simple undertaking. Does it mean several inputs, one for each language? In that case it seems it is easier to just use pages (current setup) and have you multi-language descriptions there (text fields).
-
New blog post: Working towards a new admin theme
kongondo replied to ryan's topic in News & Announcements
Tom, why? Is there no room for 3rd-party Admin Themes in the future available via the modules' directory? You know how it is with subjective preferences; some people will prefer Reno others will prefer the new default theme (when it comes out) . Just wondering.... -
I am wondering if maybe it's a similar situation to this one? (i.e. it's not possible without some verbosity as ryan explains here in response to a filed issue).