-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
It would be a nice addition if one could directly use mpdf's functions on the wirepdf module instead of retrieving and setting the mpdf instance every time one does need a native functionality.
-
Permission to translate PHP template files
LostKobrakai replied to Francesco Bortolussi's topic in Multi-Language Support
I've notices the lack of an permission for that as well last week. Since the split from core and site translations I think there really should be a way for non superusers to translate the frontend. -
is Key-binding for STRG-S in Admin-Editpage possible?
LostKobrakai replied to Pauline's topic in Getting Started
STRG is the german CTRL. -
ProcessWire doesn't hardcode any folders or any location information. It's all working relatively to the root folder. Did you use any $session->redirects before copying the folder? When used without a second argument, it would create a permanent redirect, which your browser would memorize and not even try to access the url before redirecting.
-
Best way of organising imported data
LostKobrakai replied to Tony Carnell's topic in Getting Started
You've two options to create relationships in processwire. Either using the parent/child one or using pagefields. As you've rightly pointed out the Simple Multiple Categories way kongondo described will most likely be the right one, kinda like this. Dams - Dam 1 - Dam 2 - … Country - China - Japan - … Owner - Some One - Another One Type - Type 1 - Type 2 Purpose - 1 - 2 The dam pages will have pagefields, where you can categorize each dam to their country, owner type and purpose. All the other pages will most likely only hold raw information, e.g. first and lastname of the owner as separate fields. How to create those pages will depend on how you want to import them, but the best strategy will most likely be, that you create all the category pages at first and in the end import the dams, so you can already fill all the pagefields with the corresponding links to the categories. -
Certainly sounds like a good extension to my current vagrant + ansible workflow. Always found vagrant to be to hard to provision until I found ansible, but otto seems to go one step further by giving "opinionated" defaults for the server setup.
-
To partly contradict Pete's suggestion. Following to this post are arguments on why one shouldn't necessarily use the csrf field to prevent multiple submissions: https://processwire.com/talk/topic/3779-use-csrf-in-your-own-forms/?p=103334 But you should still use the field to prevent csrf attacks.
-
View multiple tags at any one time, rather than just one...
LostKobrakai replied to a-ok's topic in General Support
I'm still not sure why I had these commas in my examples. Most likely you need to explode the value you get from the url by the devider (comma or whatever) and loop over all options separately to sanitize them. -
View multiple tags at any one time, rather than just one...
LostKobrakai replied to a-ok's topic in General Support
Not for selectors per se, but you can use this: <?php // Get url data $sectors = $sanitizer->selectorValue($input->get->project_sectors); $tags = $sanitizer->selectorValue($input->get->project_tags); // Build Selector $selector = "parent=/project-library/, sort=sort"; if($sectors != "all") $selector .= ", project_sectors=$sectors"; if($tags != "all") $selector .= ", project_tags=$tags"; // Find pages $results = $pages->find($selector); ?> <?php foreach ($results as $result) : ?> <h1><?php echo $result->title; ?></h1> <?php endforeach; ?> -
View multiple tags at any one time, rather than just one...
LostKobrakai replied to a-ok's topic in General Support
You need to use double quotes to be able to use inlined variables. -
View multiple tags at any one time, rather than just one...
LostKobrakai replied to a-ok's topic in General Support
It makes sure, that harmful parts that users may put as get variables are sanitized. E.g. '…?project_tags="; echo $superuser->pass;' -
Module folders with dots in the beginning
LostKobrakai replied to Ivan Gretsky's topic in General Support
You're totally right in all your assumptions and you can delete those if the updated module does work.- 1 reply
-
- 1
-
If I understand you right, that you want to change the displayed page by hitting the up and down arrow key, then you need to use javascript. Either change the url and reload the whole page or even use ajax to just load the relevant data and replace them on the website. PHP cannot detect any keystrokes.
-
Login/Logout redirection in a Module
LostKobrakai replied to Andudi's topic in Module/Plugin Development
You're extending the existing class, but processwire does probably still just call the parent instead of your new child class. To make it call your module instead of the core one you need to edit the process field of the /admin/login page. -
View multiple tags at any one time, rather than just one...
LostKobrakai replied to a-ok's topic in General Support
I think the easier way would be using Javascript, but as elabx pointed out you could also use e.g. checkboxes behind those links, that get send to the server. -
The standard behavior to display multi-select fields as markup is a list, even if it just has a single value. If you want to change it you can hook into Inputfield::markupValue and change this behavior on a per field basis, but keep in mind, that this will also change the markup for example when using a lister.
-
View multiple tags at any one time, rather than just one...
LostKobrakai replied to a-ok's topic in General Support
<?php // URL: www.domain.com/tags/?showme=events,films,outdoor&for=education // // Alt. URL with different template than tags overview: // www.domain.com/tags/multiple/?tags=events,films,outdoor $showme = $sanitizer->selectorValue($input->get->showme); $for = $sanitizer->selectorValue($input->get->for); $taggedPages = $pages->find("…, showme=$showme, for=$for"); -
RT @apeisa: Padloper is on the spotlight at the @processwire blog this week: http://t.co/nFcS9ADyRO
-
@Jason I'm still not sure how you would keep the routing, but not have files. Either you've multiple files that get only called by their template's pages or you have a single file, that does get called for each of those request, where you'd need to differentiate the calls by yourself.
-
Looks great. I like the colors and the overall design. Just a minor thing I noticed: The "wall runner" tab on the homepage doesn't seem to have a active state color, while the other tabs do have one.
-
What do you mean by build in routing? PW is routing traffic to the corresponding template files, which you could change to the same one for each template in the settings. I'm just not sure what exactly you want to preserve.
-
I'm not sure, but try this: category=page.category
-
repeater if/else – output parts of a repeate
LostKobrakai replied to ngrmm's topic in API & Templates
I like the pure php style to output more, because it's not filled by all those open and close tags. The essential thing is that $page->images is always equal to true, as it's an pageimages object. You need to check for the action number of images: <?php foreach($page->repeater as $box) { //if there are images uploaded output images if($box->images->count()) { echo '<div class="box images">'; echo $box->images->implode("<img src='{url}'/>"); echo '</div>'; }else{ // maybe }else if($page->text){ //if not only output text echo '<div class="box text">'; echo $box->text; echo '</div>'; } } -
I've gone back to a normal file field by now, as the site needs to work fully on monday, but it was 2.6.17/19 and Chrome.
-
$prev = $page->prev->id ? $page->prev : $page->siblings->last(); $next = $page->next->id ? $page->next : $page->siblings->first();
- 3 replies
-
- 1
-
- page array
- previous page
-
(and 1 more)
Tagged with: