-
Posts
6,798 -
Joined
-
Last visited
-
Days Won
158
Everything posted by Soma
-
Or you can save a temp value zo the page when saving like $page->skip = 1 and check for that before in the beginning of the hook.
-
OMG my name is in there!
-
Responsive images is what makes them behave inside the layout once the html, css and images are loaded, so all this max-width etc. Adaptive images is serving a resolution before it's loaded to fit screen size or bandwidth or whatever to not load unnecessary big images that wouldn't be needed for mobile for example. Oliver's solution is about adaptive images as far as I understand. Though yes it's arguably that the term can mean the same thing, but I thought it's how we make the difference in case of image delivery. Wilcox's solution doesn't require that much as you say, it's .htaccess with a cache folder, a script in head and you're done, no data-attributes required. I've used it and am quite happy with it. But will take a look at yet another solution if I got time. Thanks for sharing Oliver.
-
1. More complex validation can be done without fixing PHP code? (something like only alphabetical text allowed before the dot and only numbers are allowed after the dot) There's html5 input field patterns validation coming in 2.3 or it's already there if you use current dev. Field setup under "input" tab "Pattern". 2. Make the field set as unique so that no duplication values are not allowed? There's a double no in that sentence. So I guess you didn't mean it. There's no support for this by now. But you can easily hook the page save and add your own validation and checks. 3. two or more fields are related to each other and make them as one field? Not sure what that means. But maybe this is what you're looking for. http://modules.processwire.com/modules/fieldtype-concat/ 4. A field can be filled automatically such as 'last logged in time', 'user index number', 'posting numbers', and so on. Again not sure what you mean by automaticly filled. It's all possible through hooks. It also depends a lot what you're trying to do. If you build frontend users, or just for backend. For frontend you would build the user profile and all it's handling yourself anyway so it's all possible and only your imagination and skills is the limit. It's like giving someone a toolbox and ask can you build a wooden box?
-
Yes they aren't listed. I don't know if that's normal, would have to wait for Ryan.
-
You all seem to mix up responsive layout with adaptive images. This is about adaptive images, which is something different.
-
function inside a widget inside another page issue [solved]
Soma replied to Joss's topic in General Support
It's simple but you have to take care of it, and best is when you render them out, mostly in a foreach loop. This is perfectly fine and requires only 1 line at the end. Nerd alert... What I meant was going further and do it literally add a new template var that is always the current page viewed. In a autoload module, take HelloWorld.module as example you do the init() like this. public function init() { // no need to hook in admin area, we only need it on frontend if(strpos( "/" . $this->input->get("it"), $this->config->urls->admin) !== FALSE) return; // hook view process when ready to get current page $this->addHookAfter('ProcessPageView::ready', $this, 'getMother'); } /** * get current page and create a new template variable */ public function getMother($event) { $page = $this->getFuel('page'); $this->setFuel("motherpage", $page); } Now anywhere in your template code you could use $motherpage or wire("motherpage") Nerd alert end. (cool now the forum editor has proper code indentation but instead we get lots of extra lines and mess-ups more than before and takes more works posting code blocks :/ ...) -
TinyMCE not loaded automatically in front end form.
Soma replied to adrian's topic in API & Templates
How do you load the TinyMCE? And Do you use $config->scripts and $config->styles loop to ouput scripts and css of loaded modules? -
function inside a widget inside another page issue [solved]
Soma replied to Joss's topic in General Support
No there isnt with this approach. But maybe its possible with a hook to page view or render. Too busy atm though. -
Theres pregnant repeaters?
-
populate global field with content from other fields
Soma replied to dreerr's topic in Getting Started
Welcome. Well I can't sleep since two years because of PW There's a concencate module by Ryan that would allow to combine fields to a runtime value. You can open title field and make in unglobal and remove it from the template you don't need. PW requires only a "name" which is like an id. Have fun and sleep well! -
No I haven't . Give them all a separate login, problem solved. You don't want to have various people with same login in a CMS generally and working simultaneously from same place. Anyway I don't see a simple way to implement this. I'm also not sure if it would work for frontend as you would have to take care of it anyway, but maybe my module helps you getting started.
-
function inside a widget inside another page issue [solved]
Soma replied to Joss's topic in General Support
Ok I think I know what you mean. Current $page isn't available in your function when called from a page you render with $object->render() right? Since it's hard coded into function with wire("page") you could also pass it with an argument. My last 4 function examples showed this. Without reading the whole book here... This has come up once or twice in the forums. Ryan showed an easy solution but can't remember exactly as there's some different cases and ways. Ok here it goes. From the you load the widget pages you di something like this to save the current page temporarely: $item = $pages->get("/item/"); // some widget page $item->calledfrom = $page; // save current page from where widget is rendered echo $item->render(); Now in the template of the item you simply can use calledfrom and give it to the function echo "called from page: ". $page->calledfrom->title; // show the title of the page where this is rendered. echo $page->title; echo $page->body; // call function with current page argument myFunction($page->calledfrom); Guys I'm getting slow... but three times holds longer. -
Do you mean in the source of the js or html? Does it appear when inspecting code with console webdeveloper but not when viewing static html source?
-
I also would hinted at some module that hooks some function. What you mean with Simple Tree Menu Module? Do you mean MarkupSimpleNavigation? Well it's not doing anything like that anyway. Well no module.... you got 11 jquery modules in there I wouldn't be surprized if maybe any of that would produce it? Anyway, start removing things until it's gone.
-
Early stage InputfieldMailChimpCampaign
Soma replied to Martijn Geerts's topic in Module/Plugin Development
Great to hear it's working. Sorry I haven't been working on it much lately. But it's working roughly so far. I'm not sure thinking about this two modules working together, I think it doesn't go that well as I thought. I don't see what the benefit of it would be to be honest. My module let's you manage campaigns and choose a page to submit. These pages are normal pages you build under some parent and set the page parent in the module config. I'll have to take a look again at it but currently are busy with other stuff. -
Module - Shop for Processwire - Selectable options and the cart
Soma replied to NooseLadder's topic in Modules/Plugins
As Ryan stated this code is wrong. if("$page->children->product_size") { It doesn't make sense to put such code in quotes, no matter what. I think you mix this up with variables in echo "<p>$somevar</p>"; Or in a selector $pages->find("template=$tpl"); Putting those in single quotes wouldn't work because they won't get parsed by php. However looking at your code, as Digo mentioned the if statement will alway be true, as it's just a string and not 0, null or false. So if you write this: if($page->children->product_size) { Better now but still wrong, as Ryan said there's no product_size property or method in a PageArray. $page->children is a PageArray! children is getting all children and not a single page to say it differently. Ok, now we got that out of the way and if you want to check if there's children with a product_size field not empty? $sizes = $page->children->find("product_size!="); if(count($sizes)) { // there's children with size found echo "<p class='size_select'>Select required size: <select name='size'>"; foreach($sizes as $size) { echo "<option value='{$size->id}'>{$size->product_size}</option>"; } echo "</select></p>"; } This should get you there. -
How about using chechboxes (page field) to publish certain languages instead of checking for empty lang field? Super exciting
-
Thanks for the beer because it works. Took me only 5 minutes . I knew exactly in what behaviour it failed and I even painted in my head why this could be and it was exactly that and just a really minor change. Prosit!
-
Shouldn't this be? $page = $this->process->getPage();
-
Yeah sure, you have to get the js from here and replace it. https://github.com/somatonic/ProcessWire/tree/53e02a6bdc07eaf42eb425f84cb5ce6f90706c99/wire/modules/Process/ProcessPageList
-
It would be nice. No I didn't, but also thought it should add that anyway for all, or maybe a checkbox to include all? I can't sort the columns. I think there's an option to enable it in the DataTable.
-
I pulled a request which fixes this behavior. https://github.com/ryancramerdesign/ProcessWire/pull/163/files#L0L533
-
Did quick test. I don't see any Status in the results. It doesn't see unpublished pages. It doesn't see hidden pages.
-
Glad you figured it out! 'inner_tpl' => '<ul class="dropdown-menu">||</ul>', This is something added to all inner child <ul>'s then, which is what you need. 'has_children_class' => 'has_children', also is something that can be used to add a class to <li>'s which have children to style it different to indicate there's children for example