-
Posts
6,808 -
Joined
-
Last visited
-
Days Won
159
Everything posted by Soma
-
Bootstrapping Processwire to my Websocket server problem
Soma replied to Harmster's topic in API & Templates
Yes Just to clarify, do you mean a FAQ on the website because in the forums there's already a FAQ board? -
Bootstrapping Processwire to my Websocket server problem
Soma replied to Harmster's topic in API & Templates
I'm talking about the function scope issue and other tricky stuff that requires general coding knowledge. -
Bootstrapping Processwire to my Websocket server problem
Soma replied to Harmster's topic in API & Templates
As I recognize it, those people running into this, don't even know about it, how they gonna look on something they don't know about? -
Bootstrapping Processwire to my Websocket server problem
Soma replied to Harmster's topic in API & Templates
This particular subject has come up so often in the forum, because there's so many non-coders attracted by ProcessWire. Every coder knows about scopes and variables and it's the same in all programming languages. I'm sure even if there's a FAQ or documentation on this subject people will run into this when they get their hands dirty. It's much like jQuery doesn't have any documentation for the Javascript language as it's not in its scope. -
It should be $pages->get (1001)
-
Yeah, Ryan is the source https://github.com/ryancramerdesign/ProcessWire/blob/f82594bf64111091f66a99778433417b372cc664/wire/templates-admin/default.php#L68
-
Ah, ok must have missed that, and since it works anyway I haven't noticed. I corrected this in master and dev, thanks for finding it.
-
Autoincrement a certain field of a certain template
Soma replied to owzim's topic in API & Templates
Oh, another owzim question $val = $pages->find("template=mytempl, sort=-counter, limit=1")->first->counter + 1; -
See http://php.net to see what all you can do in ProcessWire For conditionals: http://www.php.net/manual/en/control-structures.if.php In PW short way is for example echo $pages->get("title|headline"); saying if title has value output title, otherwise get headline
-
Ok now it gets more clear. Couldn't those sockets be page fields? Well anyway, you don't have to use sanitizer selectorValue(). Just wrap them in 'value'. $pages->find("field*='E27'|'E27 + PowerLED'|'GU10'|'2G11'"); I'm not sure why + is in the sanitizer filter, but if you have to sanitize it coming from forms you could use $sanitizer->text(). Edit: Corrected example
-
I'm still not seeing through what exactly you're building. What text field / What values... I'm sure you could build this different with using id's, names or some clean values used for options in the form. But maybe I'm wrong because I don't see the whole context.
-
Just some random things I noticed. Code: You may want to indent your code, use spaces. Settings: Apart from the config.php for common basic things, there's a lot of settings in modules. When I started I scanned through all modules that have settings (gear icon) and it's good to know they exists. Also for custom settings needed for your site, you can add to the config.php your own, or even use Pages to store and use them. Example: $pages->find("selectors")->name_of_your_field; This is wrong and will not work as the find returns PageArray, so the getting the field won't work like this. MarkupSimpleNavigation - I think I need a more sexy name for it...
-
It's not clear from your description what you're doing here. Couldn't you just use id's or some values that have no "special" chars? As I understand it's not something the user enters to search, but used to filter behind the scenes? So I don't see a need to have values with comma and + chars.
-
Glad you got it working. But what? Sorry, but there's no way, that if you remove the ModulesManager.cache that the website stops working. It's not possible ModulesManager is only active if you open it in Admin, and when I remove write permission from cache folder and open ModulesManager in Admin I get this error from the module: TemplateFile: cannot create cache file /.../site/assets/cache/ModuleManager.cache
-
OMG he did it again!
-
That's what I was trying to say in my 3 posts above...
-
ModulesManager creates the cache file and it's no problem to delete that file, as it will create a new one anyway. The cache file has nothing to do with the rest of ProcessWire and certainly nothing with PW's DB connection... it's just there's so it doesn't need to load the json feed everytime you open ModulesManager.
-
@michael, yes it works but I found a problem with certain PHP version... https://github.com/ryancramerdesign/ProcessWire/issues/190 Might experience the same issue?
-
I don't know shortcodes and WP anyway and don't know if it's a good idea. Shortcode module is something different. I've chosen PW selectors because it works well and is easy to use. Yeah I noticed this too and couldn't made up my mind to how it should behave with multilanguage. I will have a try soon, thanks.
-
Early stage InputfieldMailChimpCampaign
Soma replied to Martijn Geerts's topic in Module/Plugin Development
Ipa, it's fine, just not as complete integration as I'd like to. Also I've done some reading (after creating the module) for MailChimp integration using API and it seems that my currenty integration it could create problems if requests are made too frequent, and it would need to do caching. Which throws me back a little. Also the creation of Lists isn't possible through API and you have to create them manually on MailChimp. It's a intended limitation as they encourage to use segments and groups within fewer list rather than create a List for each. And there's where it gets more complex or a lot of work. I'll hope to have time soon to get into a state where I can share it. Or if somebody wants to have a go and help out I'm always glad to collaborate. -
The file name is the key. $gal_page->images->get("myjpg.jpg")->description = "34512";
- 2 replies
-
- 3
-
-
- image
- description
-
(and 1 more)
Tagged with:
-
a. Looks ok except you get the page with the argument given to saveReady $page = $event->arguments(0); I often use a little trick to debug to find why it doesn't work. Enter $page = $event->arguments(0); echo $page->title; exit(); In the hook function, if the hook works you should see a white screen and the page title. b. Remove the trailing ?> at the end, not needed and could give header already sent errors. c. Other than that I can't produce the session error (what was it exactly?) Module works, install uninstall ... Why do you wanted to uninstall the module? To change something in modules you usually don't have to uninstall it, except if you change stuff that would need to have it installed from scratch. If you run into problems with a module, you should remove files AND the entry in the DB table "modules" for the module. Then start again.
-
I tested and get the same error as Roope, when it tries to render the 404 page. But when I access the 404 directly /de/http404/ it works.
-
Using methods/props on non existent fields in a template
Soma replied to owzim's topic in API & Templates
Sorry, was a trick answer... No there's no way. What do you expect to happen? This is possible if you can make sure the template code is only for pages that have the field. The important thing here is you have code in a place that you don't know what page you're on so you have to ask. -
Using methods/props on non existent fields in a template
Soma replied to owzim's topic in API & Templates
Hard to give an answer before knowing the question.