-
Posts
2,765 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
thanks - the latest version should have this already on line 93: $siblings = $this->editedPage->siblings("include=all"); are you sure you have the latest version?
-
this is presenting a major hassle for me, i have 2 places now where this markup appears in selects, one in admin and one on a formbuilder form, and i can't launch this site till i can fix it. any idea on how to hook and fix? been trying various things with no luck; tried hooking into FieldtypeMulti, FieldtypePage, Fieldtype, can't get the hook to fire or strip those tags EDIT: while it would still be good to have a fix for PW 2.7 branch for displaying these, i have found a solution described here: https://processwire.com/talk/topic/12045-page-select-subfield-display-issue/?p=115674
-
@justb3a - thanks, and i accepted the pull req and i'll up the version and add the table css tomorrow...
-
Module FieldtypeKeyValueMultiple need help while developing
Macrura replied to Can's topic in Module/Plugin Development
hey this is great and was something i was eventually going to work on also, because it would be good to have a dedicated fieldtype for key value where they are entered into fields like this. Currently i use tables for this, and here is a thread with some other info, possible use cases; one thing that might be cool would be to have another column as in Martijn's example, so there is a name (key) label and value, and in his example there is also a trick for hiding the name of the keys from non super users (so they wouldn't break the front end in case they changed an in-use variable) https://processwire.com/talk/topic/8373-use-delimited-texarea-table-or-yaml-for-settings/ -
cool, glad it's working out; i just added table css, from uikit to the scoped css; not sure how needed it is, but i just started using tables in my documentation and saw there was no styling; ** i'll be adding the table styles to the next update
-
the process admin help does not interact with the help tabs; the process module only gives you like a global page where all of the help docs are in 1 long accordion. the help tab on the page editor is rendered in the help tab module, so it does a selector to see if there are any matching help docs based on the template select and then I think it uses a hardcoded body field, so in terms of that, i would probably need to implement a setting to allow users to select which field will contain the markup... i will check it out and get back
-
Right, they are just body fields rendered in the accordion; you would setup the help root and then the help pages themselves, and then select which templates to show on; all markup for the help page itself would be done in the ckeditor
-
could you post a screenshot ? does the lightbox option work? i can test again, maybe i broke something on the last update...
-
do you mean the help tab, or the process page, that shows all of the help docs?
-
Dynamically create .ics file for existing pages
Macrura replied to gmclelland's topic in General Support
this may also be of use: https://gist.github.com/pamelafox-coursera/5359246 -
I didn't know it was possible. but RSS seems to support pagination; you'd need to hack the module i think though in order to support the pagination. In terms of filtered feed that sounds riskier, but you can always load the feed with a different page array, shouldn't be any issue, maybe you can explain more about why you need it - i guess you want different feeds with different titles, but want to generate them all off the same page?
-
update - if you need to be able to access your variables inside functions or the admin you can use $config.. in config.php, setup an empty array for siteSettings like this: $config->siteSettings = array(); then in ready.php file, array merge values from a settings table (profields table) or any other type of setting (MultiValue Textformatter, YAML settings ...), in the admin like this: // Get your settings from wherever $st = $pages->get('/settings/')->settings_table; // temporary array to merge with global $settings = array(); foreach($st as $row) { if(!$row->value) continue; if($row->disable == 1) continue; $settings[$row->setting] = $row->value; } // merge $config->siteSettings = array_merge($config->siteSettings, $settings); i'm curious if anyone sees any possible issues with this; it works now and i can access my siteSettings everywhere doing this; you can access the settings like this from templates: echo $config->siteSettings['yourKey']; or in function.. echo wire('config')>siteSettings['yourKey'];
-
modifying $config property (e.g. siteSettings) from ready.php
Macrura replied to Macrura's topic in General Support
so if i wanted to make an api variable called settings, how would i populate it with the object, say from the ready.php, or would i need to create a module? so would it then be possible to have a wire('settings')->siteTitle sort of thing?, instead of $config->siteSettings['siteTitle'] -
modifying $config property (e.g. siteSettings) from ready.php
Macrura replied to Macrura's topic in General Support
ok thanks - that's good to hear ! on some previous projects i was getting those values in the _init and just setting variables i could use in templates, but were not available in functions, modules or the admin (such as in runtime markup field). For this, I had initially tried to add items to the array directly but was running into an "indirect modification of overloaded property" error. After researching that, i solved it by using the array merge; though i am curious if there is a way to add items directly on the fly from a template file, maybe i need to use the _set ? __set( $key, $value ) Provides direct reference access to set values in the $data array -
in my config.php, i setup an empty array for siteSettings like this: $config->siteSettings = array(); then in my ready.php file i'm array merging some values from a settings table (profields table), in the admin like this: $st = $pages->get('/settings/')->settings_table; $settings = array(); foreach($st as $row) { if(!$row->value) continue; if($row->disable == 1) continue; $settings[$row->setting] = $row->value; } $config->siteSettings = array_merge($config->siteSettings, $settings); i'm curious if anyone sees any possible issues with this; it works now and i can access my siteSettings everywhere doing this;
-
sorry if this sounds nitpicky, but i've never seen all caps for php tag (<?PHP) (?)
-
you'd probably need to redo this logic; 1.) maybe consider an array for your body classes which you an unset keys for based on some conditions 2.) you should not be rendering the sidebar at all if there are no widgets, which means that you need to check your widget counts for each area before _main; that's why you probably need to do a pagearray or something; it's too late to check the selector once you are already looping, unless you can at that point you can unset/set the necessary array key for the body class; this can be resolved but the logic needs to be adjusted because as of now you are assuming there is always something in the sidebars; when i did my example, it was on a template that always had a sidebar no matter what, so i was able to safely foreach those addon widgets; but again, in your case you need to collate your widgets for each respective part of the page before you output any markup so that your body classes can be correct
-
you may need to make a pagearray, it's hard to tell because i can't see where/how you're excluding widgets by selector. my example runs a 'negative' $page->is($selector) over the found items - i would assume you actually want to find all items that don't have the selector set:
-
i don't have a file for my settings page, and it works because of the code you put into ready.php in terms of the icon, if you are on Reno you set the icon from the module settings to get your settings to the top menu, just move the admin page to the top of the list.
-
Dynamically create .ics file for existing pages
Macrura replied to gmclelland's topic in General Support
what i've been trying out today is just doing it in javascript, using this: https://github.com/nwcell/ics.js/ because then whatever events are viewable in the dom can all be put into a one-click add to calendar on the fly I'm showing events list in a datatable) what i'll probably do is put each piece of the info into data attributes, like data-title, data-description, data-dtstart, data-dtend as a test i have this working: ('#download-ics').click(function(e) { var cal = ics(); e.preventDefault(); $("#events tbody tr").each(function(){ var title = $(this).find('h3').text(); var desc = $(this).find('h3').text(); var loc = $(this).find("dd.location").text(); var dtstart = $(this).find("dd.dates ul>li").text(); cal.addEvent(title, desc, loc, dtstart, dtstart); }); javascript:cal.download(); }); you could also have a single click id for the button next to any individual event and then not do the each -
just curious if anyone uses any part of that library... http://phpjs.org/ there are some nice little functions here and there you can include in your project and then use the familiar php function; http://phpjs.org/functions/ucfirst/ http://phpjs.org/functions/ucwords/ http://phpjs.org/functions/strtotime/
-
Dynamically create .ics file for existing pages
Macrura replied to gmclelland's topic in General Support
hey thanks, yeah that was hastily written and untested/not debugged- i just changed the $page var to $event... wasn't sure about the $allowedSegs also; i usually do that in terms of when i'm expecting a small set of segments, like archive, tags, category, etc; in this case you have a larger pool of possible segments, but yeah the logic probably needs to be redone here so that you get the name first and then return the 404 later like you said... -
Dynamically create .ics file for existing pages
Macrura replied to gmclelland's topic in General Support
@gmclelland - it should be really simple to achieve an add to calendar, especially with processwire. 1.) check for url segment and if it is valid echo your ical, and exit... /* HANDLE SEGMENT AND ROUTING -------------------------------------*/ if($input->urlSegment2) throw new Wire404Exception(); if( strlen($input->urlSegment1) ) { $pageName = substr($input->urlSegment1,-4); $pageName = $sanitizer->pageName($pageName); $event = $pages->get("name=$pageName"); if($event->id) { header('Content-type: text/calendar; charset=utf-8'); header("Content-Disposition: inline; filename={$input->urlSegment1}"); $options = array( // associative array: // send vars to your vevent processor here... ); wireRenderFile('./inc/vevent.php', $options); exit(); } } } here is the alternate way if($input->urlSegment2) throw new Wire404Exception(); if($input->urlSegment1) { // if urlSegment1 render the single camp $pageName = substr($input->urlSegment1,-4); $pageName = $sanitizer->pageName($pageName); $event = $page->child("name=$pageName"); if($event != '') { header('Content-type: text/calendar; charset=utf-8'); header("Content-Disposition: inline; filename={$input->urlSegment1}"); $options = array( // associative array: // send vars to your vevent processor here... ); wireRenderFile('./inc/vevent.php', $options); exit(); } else { // if the event does not exist... throw new Wire404Exception(); } } you can generate the VEVENT using a class, function etc.. -
@Erik Richter, I believe your best chance of obtaining a fix for this would be to open an issue on Github: https://github.com/conclurer/PageBookmarks/issues
-
Selector problem with multiple keywords in multiple fields
Macrura replied to opalepatrick's topic in General Support
i would first try running the query once for each of the $parts, and then add the results to a final Pagearray()