-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
Different selector operators
LostKobrakai replied to LostKobrakai's topic in Module/Plugin Development
Nobody any insights? I need this to work by thursday evening. Push -
Somehow selector doesn't work in template
LostKobrakai replied to LostKobrakai's topic in API & Templates
Yeah, that's why I wanted to make your statement a little bit more clear for potential other readers of this thread. -
I've build an address fieldtype based on the eventfieldtype module. Now I wanted to use "*=" or "%=" in a selector and got an error, that these aren't supported by the fieldtype. But I need them to work for a search. What do I have to do to get these operators zu work? The subfields I need are only plain text.
-
Have you tried markup cache for the search? The cache files are chosen by name, so you can just put your selector values in the name, so it really caches markup depending on the searched values.
-
Generally speaking you need some variable to determine which image fills one grid and which one two. foreach($page->images as $image){ if($image->getTag('dual')){ // some markup for the dual grid view / maybe only a class }else{ // default case } } If you really need to include things from another place have a look at the WireArray functions in the cheatsheet. Then the foreach/if statement would most likely be little bit different.
-
Somehow selector doesn't work in template
LostKobrakai replied to LostKobrakai's topic in API & Templates
I just wanted to highlight that subpages aren't affected by your statement "get will get it, regardless of state". For the selector I tried both simply because it had not worked the way I was expecting it to work. But I never had an issue like this before, so in the beginning I wasn't really aware that the cart-item template could tamper with the result. -
Selector for finding pages that have children (or relations)?
LostKobrakai replied to jordanlev's topic in API & Templates
I've done something like this a few days ago. I use a pagetable in the order template which lists all the order-items. The order-items do have a pagefield for the product and a field for the quantity. The selector to find the order with a given product would be: template=order, pagetablename.product=$product This finds all orders which do have a order-item in the pagetable, which holds the given product. -
Limit page children to specific template (as page option)
LostKobrakai replied to MarcinP's topic in API & Templates
Currently there's no way to this with the core, but one could maybe write a module to implement this constraint-management. I would love to see something like this, because I do like to limit down all templates, so it's easier for the client to not break stuff. -
Somehow selector doesn't work in template
LostKobrakai replied to LostKobrakai's topic in API & Templates
But it only found something as superuser, but not as guest. Not until i changed the settings of the cart-item template (child of cart) to be findable by unallowed roles it worked. So the state is only ignored for the page itself, but not for subfields aka all the pagefields. Even with the check_access selctor. -
Somehow selector doesn't work in template
LostKobrakai replied to LostKobrakai's topic in API & Templates
I found that allowing people to get search results for the cart-item template solved the issue, but I thought check_access=0 would takes care about those restrictions. -
I run 2.5 stable version, so yeah it's the same issue.
-
I have a cart template, with a pagetable "cart" which holds all the products in the cart. But somehow my selector won't find the cart to a anonymous user, while Lister finds it and my second line of code clearly states, that there is a page with a product of the id 1035. Does somebody see what I miss? $pages->get("template=shop-cart, user=40, session=6b53ec96ea298445183c269bf0d51d54, cart.product=1035, include=all, check_access=0")->id // returns int(0) $pages->get("template=shop-cart, user=40, session=6b53ec96ea298445183c269bf0d51d54")->cart->first()->product->id // returns int(1035)
-
When using the trash shortcut of the admin theme the page scrolls back to top, probably because of the # link. I don't think this is a intended behavior.
-
I think the big difference between the points of you both is in the definition of docs. Lisandi sees them as documentation for the CMS as a whole. So there are docs about the UI, modules, for admins, for designer and so on. Because each of them has to somehow work with the cms, while each need to learn different stuff. I would consider most of this information as bloat for the actual cms. Designers and Developers do have enough resources here on the site and clients should have no hassle with the basic UI functionality of processwire after a bit of initial introduction. Joss on the other hand is talking about a documentation the developer/designer is setting up only for the user/client. This is very much sitespecific as even most modules can be used differently on each page, not talking about different sitetemplates. One could see them as site maintainance guidelines / helpers.
-
How to figure Multilanguage Images with one image var ?
LostKobrakai replied to iNoize's topic in General Support
Keep in mind: What Soma suggested will only work as long as images are in the same position if you use a multi image field. If for example if you want the fourth image to be language specific, each of these fields need to have all four images. Regarding text in images: It would be good to consider twice, if you want to do this. It's a best practise to not do it. -
By now Facebook doesn't even claim to do otherwise. It's clearly stated that the account only gets deactivated. But somewhere hidden in the settings there's a way to queue your account for an actual deletion.
-
Within the single template file you can include different files in multiple fashions, these don't need different templates in the admin, as they use the same data. One example would be like this. if( $view == "something"){ include "view_1.php"; // Include titles view }else{ include "view_2.php"; // Include images view }
-
Will Brackets and Atom give Sublime serious competition?
LostKobrakai replied to Joss's topic in Dev Talk
I generally work locally, but if I need to, cyberduck lets me edit single files with every editor. It just downloads the file to a temporary folder and uploads the changes back again. -
foreach($pages->find("template=colour,sort=sort") as $item) { if($pages->get("template=thing, colour=$item")->id){ //There are actually pages with this colour } } Regarding your performance question: Loading one page per color should be nicer than loading all $thing pages. Even without all your sorting stuff.
-
Will Brackets and Atom give Sublime serious competition?
LostKobrakai replied to Joss's topic in Dev Talk
Though I tried brackets and atom I stayed with sublime text. With atom (one of the first puplic versions) I had the problem, that one would clearly see, that it's programmed in a browser. Not really snappy, small rendering issues all over the place. It just wasn't polished enough to bother. Brackets on the other side looks very clean and sofisticated, but does so only for html/css/js. But mostly I would miss the multiselect / multicursor thing from sublime text. It's such a great feature for programming. Wanna change some variable naming. Highlight it – Strg / CMD + D a few times – write new variablename. The only thing I really miss with sublime text would be some UI improvements. -
The old system just got this great feature implemented and around comes a new system
-
Best way to let users translate selectbox values
LostKobrakai replied to LostKobrakai's topic in Module/Plugin Development
Note to myself: Stop reinvent the wheel. I ended up just using standart code translation. If someone wants to translate it, he / she should know how to do it, without these extra module settings. class AddressGerman extends WireData { protected $titleOutput; … public function __construct(Page $page) { $this->titleOutput = array( 0 => $this->_('No title provided'), 1 => $this->_('Sir'), 2 => $this->_('Madam') ); …- 1 reply
-
- 2
-
If you use the console, it's even less learning, because mac os as well as all those linux servers use the same unix commands. @gebeer Any insight in virtual machines? Isn't this as shitty to setup as those hackintosh machines?
-
Simple way around it: Add this to the InputfieldEvents class. public function ___renderValue(){ return $this->attr('value'); } This gets rid of the standart entity encoding, so you need to encode the eventdata by yourself in the renderEvent() of the Event class. public function renderEvent() { // remember page's output formatting state $of = $this->page->of(); // turn on output formatting for our rendering (if it's not already on) if(!$of) $this->page->of(true); $date = $this->sanitizer->entities($this->date); $location = $this->sanitizer->entities($this->location); $notes = $this->sanitizer->entities($this->notes); $out = "<p><strong>$date</strong><br /><em>$this->location</em><br />$notes</p>"; if(!$of) $this->page->of(false); return $out; }
-
Hi, I'm just refactoring the FieldtypeEvent module into an address fieldtype. Now I wanted to use the mysql enum type for the title field, which should only consist of 0, 1 and 2 for "not provided", "sir" and "madam". By now I just use a INT field, because I didn't have to bother about mysql for a long time and wasn't really into it the time ago. So I would appreciate if someone could help me out with this. Edit: After reading the mysql docs more closely it seems I imagined this to work a little different. Secondly: What would be a favourable approach to internally translate those three numbers to labels the user can provide in the module settings. I would do this with three textfields, which dynamicly would change to languagetext, it they are available. By now I use a constant in the Address class, but I would also need these values to build the select field in the InputfieldAddress class. class AddressGerman extends WireData { const title = array( 0 => 'No title provided', 1 => 'Sir', 2 => 'Madam' ); …