-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
Regarding the PHP Version issue. How about a check everytime a superuser logs into the backend. Superusers are the ones who should get notified and you don't login nearly as often, as you load a page.
-
I think he's talking about the backend. The problem with the backend is, that ProcessWire does not autosave stuff, so your fields are only evaluated once you hit save. Your options would be either to implement some kind of autosave, than you can use PageFields which can show different pages (parcels or other stuff) depending on your other fields. The other option would be to implement your logic in a pure javascript/jquery fashion. If you want to try this, have a look at the AdminCustomFiles module.
-
If all your faq are under one parent the pagename would also be unique. I find this sometimes more descriptive than the id, if I use some kind of hash navigation.
-
A small AdminCustomFiles hack to have all dropdowns open: #main-nav > li > ul{ display: block !important; } #main-nav > li { background-color: #e2e9ef !important; }
-
That's what I'm thinking, too. It's great to gather some suggestions, but Ryan should choose whether to give nicknames and if so, which names processwire should rock.
-
Form Validation With Valitron Library
LostKobrakai replied to Marek's topic in Module/Plugin Development
I've rewritten all the forms in my current project from pw's internal form handling to manual. It's so easy to just write the markup yourself – a bit repetitive, but still easier – and valitron is a great library. The syntax is super readable and you can define own rules. I'll put some examples after this. The function duplication is, that I can use the functions without the library, too. use Valitron\Validator as V; //------------------------------------------------------------------------------ // hasContent //------------------------------------------------------------------------------ function textHasContent($text){ $content = str_replace(array("\n", "\r", "\t", " ", "\o", "\xOB"), '', strip_tags($text)); return strlen($content) ? true : false; } function ruleHasContent($field, $value){ return textHasContent($value); } V::addRule('hasContent', "ruleHasContent", 'No valid Content entered'); //------------------------------------------------------------------------------ // isUser //------------------------------------------------------------------------------ function isUser($id){ $id = (int)$id; $u = wire('users')->get("id=$id"); if($u->id) return true; else return false; } function ruleIsUser($field, $value){ return isUser($value); } V::addRule('isUser', "ruleIsUser", 'Invalid User given.'); -
How to provide admin interface for editors?
LostKobrakai replied to jordanlev's topic in Getting Started
I would second sforsmans advice to use a PageTable for variations. But I would add to just use the "description field" of each field in your templates extensively, if you think a user would need some help with the interface. -
I'll build a module which will remove the cart-pages of guest users. There are a few options. Update a timestamp each time the user visites a page. Remove the cart after "sessionExpireSeconds". Try to hook into session delete and remove the cart in the same run. I would like to use the second version, but I use the SessionDB Module and the gc() function does remove sessions without noticing pw about it. Is there a way I miss to do this?
-
I have no answer for you, but you can change the topic title by yourself is you edit the first post in the "full editor".
- 3 replies
-
- upgrading
- translating
-
(and 1 more)
Tagged with:
-
For me it's working. www.meanthemes.com/plugins/meanmenu/
-
possible: file based instead of sql-database?
LostKobrakai replied to vanderbreye's topic in General Support
There where already requests to support sqlite as second database option, but even this never really found consideration. Also I don't think files would be in any way as performant as a real database, especially if you're talking about a single file. ProcessWire can manage 100.000s of pages. I don't want to imagine a single file with all those information in it. -
Unable to change page template; limited list shown
LostKobrakai replied to Mike Rockett's topic in General Support
You're not the only one, did this twice last week. But maybe mark the thread as solved, if you found the answer. -
A bookmarklet is just a small javascript bit, executed as "url". Because of the max length of a url, this is mostly a small importer of a bigger js script file, which needs to identify/process in some way, what you want to post to your pw installation. On your site you need to have some point, which can accept, check and save the data send by the bookmarklet, which could be done with the previous mentioned service pages module. All together this shouldn't be to difficult if you used ajax before, as long as you don't want the bookmarklet to automatically determine, which content you want to transfer to your site. Maybe also looking at bookmarklets of other services could help.
-
If you want to see the tags assinged to a page in the pagelist you can use the pageLabelField for the template you need it. There you can add the pagefield you want to be shown in the list.
-
The short answer would be flexibility. Maybe you have multiple image fields with different usecases / single or multiple. Now you need to extend one of the image fields, so that it would feature a star rating for each image, how much people voted and the max votes in one day. With the single table mentality you can easily extend the one field with more columns to be used by the extended image-rating-field. Backwards it's the same. Maybe you have a multilanguage textfield and you want to switch it back to singlelanguage. Now you can easily delete the language specific columns without worrying about other fields. It also makes stuff more clear in the database. If your textfields would all share the same table, you would get lot's of empty fields for the singlelanguage ones, if only one is multilanguage. Also you see, even the simple textfields don't really share one schema, like you said.
-
MarkupSEO - The all-in-one SEO solution for ProcessWire.
LostKobrakai replied to Nico Knoll's topic in Modules/Plugins
Yeah. Don't have to do it by hand anymore -
Im currently working on a project which involves a small simple shop. Currently I'm storing the information about cart entries in the session as array or for logged in users in a repeater. But I wanted a single way to add/update the cart instead of handling both cases all the time. By now I've two functions which convert the session array to a PageArray and the back to a phparray again, so I can just add/update the repeateritems/sessionitems in a single way throughout the page. Now I wanted to know what others might think about this? Would using a class, instead of loose functions, be useful there? Another way could be to have a single page with just the repeaterfield for the cart for each session. These would be cleaned up after max. session lifetime.
-
Count selector, which only counts a subset of repeaters
LostKobrakai replied to LostKobrakai's topic in General Support
Yeah, I figured out, that I don't need a count value, as I only want to filter if there are children: …, family.family_select=child This gives me all the members which at least have one child.- 1 reply
-
- 1
-
One thing you could do is split all those tabs in different templates and use them in subpages. You could include them in a PageTable on this current page to allow easy access to all the subparts of the page. This would also allow you to reuse editor/image fields, when they are no more used in the same template. Off Topic: That's some piece of german engineering information
-
I use a repeater to store information about each users family, this includes the partner and children. Now I'm looking for a selector to get users with children. "family.count!=0" would of course also count the eventually present partner entry. Is there a way to filter the count value by some subfield selector, or would it be easier to just clone the repeater to represent children and partner seperatly?
-
In the PWImage-plugin for the editor is a option to choose images from other pages. But I would also go with the hanna code version, as it updates if the image gets changed, while the pwimage plugin only inserts the code for the image and doesn't care more about it.
-
Or use the shortform I posted previous: http://isup.me/
-
The only thing you can do right now is storing the id of the page, which is not very intuitive/practical in itself. To your speed concern: I'm not the big database guy, but the principle of having a table for each field is one of the core decisions for ProcessWire. If this would be slow, ProcessWire in itself wouldn't be very scalable at all. edited to avoid confusion
-
Another recommendation would be uberspace.de, nice responsive support, but you need to setup stuff mostly via ssh.