-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
Is it possible to use template tags in selector?
LostKobrakai replied to tpr's topic in API & Templates
This does work: $tmpls = $templates->find("tags=myTag"); $result = $pages->find(template=$tmpls"); -
How about that? $pages->get($mySettingsPageId)->body;
-
I'm not sure, but this might actually be an issue with or-groups if it's not working. Did you try other fields to sort by?
-
Yeah, great job mailchimp/mandrill. I've an event running on mandrill up until end of the week. Now I thought it would be easy, just connect the account to mailchimp and pay those 20€ once. But it's not quite that. The mailchimp account does need to be monthly payed to be linked to a mandrill acc and I'm now hoping I can switch it back before the big 400€ monthly cost come in (lots of subscribers, but very few newsletter per month). I'm really curious why one would even think of using mandrill further.
-
Repeating and grouping fields for team page
LostKobrakai replied to electricarts's topic in Getting Started
$image on it's own won't work. You need to retieve it like any other field form the $member object: $member->myImageFieldName->url -
Repeating and grouping fields for team page
LostKobrakai replied to electricarts's topic in Getting Started
No need to duplicate any code here. The foreach is there to run multiple times on it's own. <div class="uk-grid uk-text-center team-thumbnails"> <?php foreach($page->Teammitglieder as $member): ?> <div class="uk-width-1-5 uk-container-center"> <img class="uk-thumbnail uk-border-circle" data-uk-modal="{target:'#<?php echo $member->id; ?>'}" src="<?php echo $config->urls->templates?>layout_images/g.wertich.jpg" width="130" height="130" alt="$image->description" alt=""> <div class="uk-thumbnail-caption"><?php echo $member->Team_Name; ?></div> <a class="more-infos" href="#<?php echo $member->id; ?>" data-uk-modal>Mehr Infos ...</a> </div> <?php endforeach; ?> </div> <!-- And later --> <?php foreach($page->Teammitglieder as $member): ?> <div id="<?php echo $member->id; ?>" class="uk-modal"> <div class="uk-modal-dialog"> <a class="uk-modal-close uk-close"></a> <div class="uk-modal-header"> <h2><?php echo $member->Team_Name; ?></h2> <img class="uk-thumbnail uk-border-circle team-detail" src="<?php echo $config->urls->templates?>layout_images/g.wertich.jpg" width="100" height="100" alt="$image->description" alt=""> </div> </div> </div> <?php endforeach; ?> -
Repeating and grouping fields for team page
LostKobrakai replied to electricarts's topic in Getting Started
If your repeater items do have different names than this code should reflect that and output these different names. But I'm seeing you're using modals. It might be, that you're triggering the same modal over and over, because the id 'g-suhr' is used for all different instances, which is invalid markup. The id does need to be unique. <?php foreach($page->Teammitglieder as $key => $member) : ?> <div id="<?php echo 'g-suhr-' . $key; ?>">[…] <?php endforeach; ?> -
Repeating and grouping fields for team page
LostKobrakai replied to electricarts's topic in Getting Started
The field name is still Team_Name, not name. name does only "work", because repeater items are behind the scenes just hidden pages and like all pages, these do have a name field. -
Just use the same csv to create all the countries with the importer (disallow duplicates) before using it another time to import the pages linking to the countries.
-
Only the UI to run the actions directly inside the lister is part of the ListerPro module. You can still use PageActions by triggering them manually (code / custom UI).
-
Add a custom button or link to backend template
LostKobrakai replied to SebastianP's topic in General Support
Here you can see the basics to implement additional buttons: https://processwire.com/talk/topic/12174-module-to-add-2-additional-save-buttons-and-unpublish-button-to-page-edit/ -
Repeating and grouping fields for team page
LostKobrakai replied to electricarts's topic in Getting Started
Everything inside the foreach loop will be repeatedly parsed for the number of elements $page->Teammitglieder does have. The $member variable will for each cycle be populated with the corresponsing item from $page->Teammitglieder. E.g. first cycle - first member, second cycle - second member, … Therefore will $member->Team_Name will be different for each of those cycles. -
1. and 2. PageActions are simple modules with often only a single "action" or "executeMultiple" function, where you're receiving the page object / or a list of them. What you're creating from those data is totally up to yourself (you can even test this without lister pro, as page actions are part of the core). 3. Lister Pro does depend on lot's of internal functionality, so currently there are no plans and probably this won't become a feature in the nearer future. 4. - 6. Don't worry, it's a great module.
-
afterjohn is just a label for all the or-groups, so it's less likely to clash with other or-groups in your selector.
-
Files are compiled twice / Translatable strings are not translated
LostKobrakai replied to Zeka's topic in Getting Started
I can see the issue with using include, but shouldn't wireRenderFile (what I'm using) resolve relative paths automatically to absolute ones? I'm using wireRenderFile partly for not having to deal with absolute or relative paths, but simply relying on the automatic resolving of paths (e.g. relative to site/templates no matter from where I call wireRenderFile). The strange thing was, that parts of my files where correctly compiled (also in the correct place in the folder structure) whereas some files where not. I've not found the determining factor, but it seemed to only happen if there where multiple nested wireRenderFile calls and adding $config->paths->templates in front of the relative paths did resolve the issue. It might be, that my folder naming did play into this as I've the following structure: site/templates/templates/… and most of my wireRenderFile calls therefore look like this: wireRenderFile("templates/someFile.php", array()); I had exactly the same outcome as Zeka, where the folder structure was partly correct and some files where instead falsely compiled "relative to the root dir". -
Repeating and grouping fields for team page
LostKobrakai replied to electricarts's topic in Getting Started
These are doing the same just with different syntax: <?php foreach($array as $item){ echo "<h1>test</h1>"; } ?> <?php foreach($array as $item) : ?> <h1>test</h1> <?php endforeach; ?> The ?> does only convey that the following code is not php code anymore. It does not end anything else. -
Maybe this is related to your issue with repeaters: https://github.com/ryancramerdesign/ProcessWire/issues/1790#issuecomment-214017864
-
You can make it work with pagination, but it's a bit different to execute. // This part cannot use pagination, because we need all of john's comments, // but the whole selector construction is cacheable to minimize load // invalidate the cache whenever john does post a comment // optionally you can then also recreate the selector, so the waiting time // does hit John and not other users $johns = $pages->find("template=comment, comment_username=John"); $parents = $johns->explode(function($c){ return $c->parent->id; }); $parents = array_unique($parents); $commentsSelector = array(); foreach($parents as $parent){ $johnsFirstComment = $johns->find("parent=$parent, sort=created"); $commentsSelector[] = "afterjohn=(template=comment, parent=$parent, created>$johnsFirstComment->created, comment_username!=John)"; } $commentsSelector = implode(', ', $commentsSelector); // End cacheable $pages->find($commentsSelector . ', sort=created, limit=10');
-
$johns = $pages->find("template=comment, comment_username=John"); $parents = $johns->explode(function($c){ return $c->parent->id; }); $parents = array_unique($parents); $repliesToJohn = new PageArray(); foreach($parents as $parent){ $johnsFirstComment = $johns->find("parent=$parent, sort=created"); $afterJohnsFirstComment = $pages->find("template=comment, parent=$parent, created>$johnsFirstComment->created, comment_username!=John"); $repliesToJohn->import($afterJohnsFirstComment); }
-
You probably had the same problem as described here: https://processwire.com/talk/topic/13101-files-are-compiled-twice-translatable-strings-are-not-translated/
- 10 replies
-
- 1
-
- processwire 3
- namespace
-
(and 2 more)
Tagged with:
-
If you just need the url for a redirect this does work: $session->redirect('.');
-
Could I kill all users logged in sessions ?
LostKobrakai replied to adrianmak's topic in General Support
Changing the salt won't do anything because the salt is only needed to compare passwords with their db value, which does only happen on login and not for active sessions. -
Could I kill all users logged in sessions ?
LostKobrakai replied to adrianmak's topic in General Support
session->getAll() does return all session variables, but not sessions. Forcefully logging users out can be done by removing their session files / db entries or by implementing a bit of code into the processwire bootstrap, which checks if a user should be logged out forcefully and redirect right afterwards. -
Repeater field limits and server timeouts
LostKobrakai replied to John W.'s topic in General Support
For that number of data nodes I'd suggest using neither repeaters nor ProFields Table but a PageTable. Even for a small repeated fieldset of 3 fields this would result in 180 to 240 Inputfields just for the repeater. This can really draw browser rendering performance even if the server does respond correctly. If the number of repeater fields would be near 12-15 you're also close to hitting max_input_vars limits. With PageTables both issues do not apply. -
A module is by default only visible to superusers. If you've specified a permission in the module's info data you can give this permission to users to grant them access to the module.