-
Posts
4,956 -
Joined
-
Last visited
-
Days Won
100
Everything posted by LostKobrakai
-
The only annoying thing about git branches is managing the database, especially in the early stages, where content may not be present from the beginning. But everything else is super easy. You could even use webhooks (github and gitlab) to call a php file on your server, which than pulls changes after each push from your local machine to the remote repo.
-
//offtopic I always wondered, why there aren't easy shortcuts for all those nice typographical chars on PC. For macs it's nearly faster to type alt + . instead of ". . ." .
-
$config->userTemplateIDs -- anyone implemented this so far?
LostKobrakai replied to hellomoto's topic in API & Templates
You can always revert updates of processwire by replacing wire/, index.php and .htaccess with the old ones. If you're using this https://processwire.com/talk/topic/7525-module-processwire-core-upgrade/ than these files should be there already as hidden files. The modules additionally does a optional database backup on updates. -
$config->userTemplateIDs -- anyone implemented this so far?
LostKobrakai replied to hellomoto's topic in API & Templates
Did you undo your changes before updating? Maybe there's something missing in your user template settings, which only the new version would set. -
$config->userTemplateIDs -- anyone implemented this so far?
LostKobrakai replied to hellomoto's topic in API & Templates
Had my confusions with version numbers before, but it's quite common in software developement. It's releaseversion 2, majorversion 5 and minorversion 14. Does have nothing to do with decimals. -
$config->userTemplateIDs -- anyone implemented this so far?
LostKobrakai replied to hellomoto's topic in API & Templates
Same as here: https://processwire.com/talk/topic/8786-users-visibility-need-public-hierarchy/ Please try to keep stuff together in one thread. If you want to have a new thread, you can still post only a link to the older one. -
The repeater field value should be a pageArray, with all the repeater pages. Problem with repeaters, you're only coping fields right now. But repeaters are own hidden pages, which have to be generated before you can copy over the fields. Have a look here how to handle repeaters from the api side: http://processwire.com/api/fieldtypes/repeaters/ } elseif($field->type instanceof FieldtypeRepeater) { foreach($value as $e){ … } } For the map marker: Did you take a look what's being returned by $value? I doubt it's a string so $value = trim($value); doesn't do a thing. Try this, as $value should carry address as part of it, after a quick look at the source of the module. $page->set($name, $value);
-
Users -- visibility (need public) & hierarchy?
LostKobrakai replied to hellomoto's topic in General Support
Just to be sure, you updated your processwire version to 2.5.14 dev? You're proplem with no other template showing kinda looks like that.- 6 replies
-
- users
- visibility
-
(and 1 more)
Tagged with:
-
Users -- visibility (need public) & hierarchy?
LostKobrakai replied to hellomoto's topic in General Support
Users are children of "Admin", that's why their pages are by default excluded from search results if you're not logged in as superuser. To change this add "include=all" to your selector. More on this here: http://processwire.com/api/selectors/#access_control- 6 replies
-
- users
- visibility
-
(and 1 more)
Tagged with:
-
Most advertising providers just use get variables to track where someone has clicked an ad. So as long as you can dictate the url you could also count all visits coming with specific variables.
-
As you're not using specific dates for your selector, you could also use "today" or "time()" to compare to your datefield. No need to use a string date format, if you use it only in the selector. And you save all the lines about the $selectorFormat. Also I would suggest to change the line in the foreach to this: printf($outString, $event->title, date($dateFormatOut, $event->getUnformatted("event_date"))); This way you'll always get the timestamp of the field, no matter how it's displayed in the backend by the settings.
-
You don't need to change the settings of your field. The date is stored as timestamp anyway. Only the date in the selector must be "readable" for php, so it can be compared to it.
-
I would suggest you to use a standartized dateformat, just to be sure the date is parsed correctly. From the comments here: http://processwire.com/api/selectors/#examples
-
Php has to load the image uncompressed to the memory, so you need to have lots of ram and this will be needed everytime you generate a thumbnail. So if you ever have a situation, where multiple thumbnails would be generated, this will slow down the server considerably.
-
It's from the lastest dev updates so it's new to all of us.
-
Best way to output multiple, HTML formatted pages from pagearray?
LostKobrakai replied to kathep's topic in Getting Started
You can either use $pages->count("selector") the same way as find, just you receive a number of pages. Or you could also use $pageArray->count(), but then all the pages of the array have to be loaded, while the first one counts on the database level, without loading the pages into php. The standart php count($pageArray) works the same way as $pageArray->count(). if($design_prin_rel instanceof PageArray){ $related = "<h3>On related design principles</h3>"; foreach($design_prin_rel as $category){ // Only do stuff, if it's not 0; 0 == false, so no real need to have ... > 0 if($readings_dpr->count("selector to get only pages for $category")){ $related .= "<h4>" . $category->title . "</h4>"; foreach($readings_dpr->find("selector to get only pages for $category") as $item){ $related .= "<p> '<a href=$item->url>" . $item->title . "</a>' " . "-" . $item->book_section_reading_time->title . "</p>"; } } } } To learn/discover the api I would suggest having a look at this: http://cheatsheet.processwire.com. Don't forget the advanced mode. For more "in context" examples have a look here: http://processwire.com/docs/ -
Now the url is the problem. You're calling only the template.php, while you need to call a url from your site, which uses this template. Something like "http://127.0.0.1:8888/map/". This way ProcessWire is called, which then includes your template file, but with all the necessary environmental variables. You're console.log() probably didn't log, because the function is the success handler of jQuery. It's only called if the request is a success. But it isn't, as your template.php is full of errors as long as the variables like $config, $page, $pages ... are not set.
-
To answer your question about restricting the visibility. The dependencies are managed in a "in this form" fashion, so the fields your settings depend on must be present in the form, as the form isn't deeply linked to a specific page. I currently don't know if adding the roles field with visibility set to not editable / not visible would solve this.
-
Enable $config->debug in you're site/config.php, then they're appended to every site in the admin backend.
- 20 replies
-
- cache
- markup cache
-
(and 2 more)
Tagged with:
-
If you'll put the ajax stuff in a template you can use this: http://cheatsheet.processwire.com/config/runtime-configuration/config-ajax/ Otherwise have a look at this: http://processwire.com/api/include/ The recommended way would be the first one.
-
How to iterate through repeater fields' subfields?
LostKobrakai replied to hellomoto's topic in General Support
foreach($page->engines as $e) { foreach($e->fields as $field) { echo $e->get($field); } } See here: http://cheatsheet.processwire.com/page/built-in-fields-reference/page-fields/ Edit: changed the echo line, too.- 2 replies
-
- 1
-
- FieldtypeRepeater
- iterate
-
(and 1 more)
Tagged with:
-
I've just tried it out and had no problem using a pagefield and edit it in the profile section of the admin. Did you try to use $config->debug = true to get all error messages?Also which version of processwire do you run?
-
Best way to output multiple, HTML formatted pages from pagearray?
LostKobrakai replied to kathep's topic in Getting Started
if($design_prin_rel instanceof PageArray){ $related = "<h3>On related design principles</h3>"; foreach($design_prin_rel as $category){ $related .= "<h4>" . $category->title . "</h4>"; foreach($readings_dpr->find("selector to get only pages for $category") as $item){ $related .= "<p> '<a href=$item->url>" . $item->title . "</a>' " . "-" . $item->book_section_reading_time->title . "</p>"; } } } -
Both versions work independent, you could even use multiple language alternative textfields aside of a different textfield, which is setup to be multi-language.