-
Posts
2,768 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
this may be a question i'd need to submit as a support ticket to mailgun, as their documentations is pretty sparse, but is it even possible to switch out the sending domain when you send a message, because my CRM app has a selectable "From" address when sending an email and that can be from one of 8 different domains. Since the mailgun api has you put in the api key for a particular domain, will it reject the email if it has a different from domain, or will it auto-detect the domain and switch to that; the difference here between this and Mandrill for example is that Mandrill doesn't require different smtp credentials for each domain... EDIT: so i reviewed the Mailgun documentation and it does seem that you need to authenticate for the domain you are sending from; so now i wonder if i could just change my script to read the domain from the sender and then set the domain and api key for that message; $WireMailMailgun->setApiKey( string $apiKey ) $WireMailMailgun->setDomainName( string $domainName )
-
Add a custom button or link to backend template
Macrura replied to SebastianP's topic in General Support
Not sure if this helps, but for custom buttons i have recently made large usage of Kongondo's Runtime Markup field to create custom buttons and many other custom things (special information, tables of other pages, etc) to use on the page edit screen. -
any auto page title generator module existed ?
Macrura replied to adrianmak's topic in General Support
Perhaps you don't need a title field on your page table items (?) -
building navigation menu beyond the page tree list structure
Macrura replied to adrianmak's topic in General Support
Building menus for any usage has been discussed a lot over the years. Here's one post: https://processwire.com/talk/topic/2787-custom-menu-not-related-to-page-tree/#entry27275 In the end, i have found that having a branch on the page tree for the menu is the most flexible and easiest to: - code custom navs from (mega menus, boostrap etc) - publish/unpublish menu items - use permissions for menu items (e.g. show some menu items to logged in users) - insert stuff like forms, videos etc into a menu and it works very well with MSN (markup simple navigation) because it allows you to set the parent... -
i think the best option is to remove the ACE completely and then have the module simply check to see if the Ace Extended module is installed, if it is, then use that and init for PHP; otherwise show a normal text area; the module could show a link to install Ace extended for those who want to edit their codes in the admin. I have a module that does this, and it so far works fine...
-
Custom functions per page (single template)
Macrura replied to _NameLess_'s topic in API & Templates
you could just have each function be in a named file inside a directory which matches the name of the manufacturer, for your output. then you can use your code editor more easily than having code stored in the DB. e.g. include('/manufacturers/' . $car->CarManufacturer->name . '.inc'; or you can make a textarea field and use AceExtended in PHP mode, then eval() your code on the front end.- 4 replies
-
- API
- Custom FieldType
-
(and 2 more)
Tagged with:
-
Whoah, this is going to be really useful, especially that wirecache cleaner(!)
-
I think currently this module is one option: https://processwire.com/talk/topic/7857-module-fieldtypetime-inputfieldtime/ or you just use a plain text field but init the field for the timepicker as described above by renobird; you can init the field using ACF and also specify to load the assets in the ACF settings...
-
@thetuningspoon - thanks for reply... holy smokes, figured it out, and soma's post was staring at me the whole time... you need to add hook properties for this type of inputfield... so adding the below to the init() $this->addHookProperty("InputfieldText::selectizeThis", $this, "addProperty"); $this->addHookProperty("InputfieldText::userStringsList", $this, "addProperty"); and adding this method to the module: public function addProperty(HookEvent $event) { $event->return = 0; } makes it work... so for future reference...this is how to add custom attributes/settings to a text field... https://processwire.com/talk/topic/9462-adding-a-configuration-setting-to-an-existing-module-with-a-hook/?p=91149
-
I'm having trouble adding config fields to an inputfieldText, actually the config fields are added an function, and they even save to the database, but the $event->object does not read the data back into the object at this init() for some reason – this is based on the AdminPageFieldEditLinks module, which i tried to copy virtually exactly, but my data array never contains the extra values from the data column in the database... $this->addHookAfter("InputfieldText::getConfigInputfields", function($event) { $that = $event->object; if($that->hasFieldtype !== false) { $field = $this->modules->get('InputfieldCheckbox'); $field->attr('name', 'selectizeThis'); $field->attr('value', 1); $field->label = $this->_('Enable Selectized input for this field?'); $field->description = $this->_('If checked, you may setup selectable options for this field. (Options may be selected and then edited).'); if($that->selectizeThis) $field->attr('checked', 'checked'); else $field->collapsed = Inputfield::collapsedYes; $event->return->append($field); // list of selectable text strings $field = $this->modules->get('InputfieldTextarea'); $field->attr('name', 'userStringsList'); $field->label = $this->_('List of text strings to show as options.'); $description = $this->_('List each string, 1 per line.'); $field->description = $description; $notes = 'Example: Default News Title Format'; $field->notes = $notes; $field->value = trim($that->userStringsList); $field->showIf = 'selectizeThis>0'; $event->return->append($field); } });
-
Intermediate template structure without string concatenation
Macrura replied to Pete Jones's topic in API & Templates
I used a form of this extensively on the last project: https://medium.com/@clsource/the-wire-render-pattern-806bf6d6097a#.zhn62bk3h to use a static html file / string replacement you would first load the html into a var: $tpl = file_get_contents($config->paths->templates . 'html/my-file.html'); $search = array('{{token1}}','{{token2}}','{{token3}}'); $replace = array( $replacement_for_token1, $replacement_for_token2, $replacement_for_token3, ); $content = str_replace($search, $replace, $tpl); there may be a better way to do this, or use a template engine, but this would at least allow you to use native syntax highlighting within your editor when looking at the html... for repeating structures you'd still end up with markup in your php code for each replacement- 13 replies
-
- 1
-
-
- template
- intermediate
-
(and 1 more)
Tagged with:
-
Intermediate template structure without string concatenation
Macrura replied to Pete Jones's topic in API & Templates
imho wireRenderFile is still the best way if you want syntax highlighting in your editor; you can then set the $var = wireRenderFile('file', $vars); you could also use static html files with simple {{tokens}}, load one into a variable and str replace the tokens..- 13 replies
-
- 1
-
-
- template
- intermediate
-
(and 1 more)
Tagged with:
-
probably the best way is to make a Wirearray() and then add all of the images to that, then iterate of the Wirearray(); (you would iterate over the child pages and import the images to the wirearray;) also be careful because if you have the same named image in the wirearray it will de-duplicate it. http://processwire.com/api/arrays/
-
you just put the css in a stylesheet that is loaded on the page. That file needs to hold the CSS rules that apply to the menu.
-
not sure about a selector, but you'd need to create some array of pathologies for each category which are assigned at the diagnostics level: $categories = $pages->find("template=diagnostic_category"); foreach($categories as $cat) { $cat_paths = new Pagearray(); $cat_diags = $pages->find("template=diagnostic, diagnostic_category=$cat"); foreach($cat_diags as $cd) { $cat_paths->import($cd->pathologies); } echo $cat_paths->implode(', ', 'title'); }
- 1 reply
-
- 3
-
-
correct, so you just need to make sure that MSN is generating the needed markup for the framework you are using. Does this make sense?
-
the menu css would be in the frontend code you are writing, or using; the module is there to generate the markup you require for the menu. What framework are you using for your site? Many frameworks have navigation css built in (such as bootstrap)
-
are you caching a plain array or a Pagearray Have you checked the database to see what is cached there in the caches table and what the expiration date is? have you tried clearing the cache using $cache->delete(...)..
-
as an update to this topic, after discovering the awesome power of Selectize.js, i have been able to implement really good tagging on the image fields which works much better than the technique discussed earlier in this topic. 1) place the selectize files somewhere in your templates folder http://selectize.github.io/selectize.js/ (i have placed them in a 'plugins' folder) 2) make the files load on page edit, from your AdminCustomFiles settings: ProcessPageEdit plugins/selectize/dist/css/selectize.legacy.css ProcessPageEdit plugins/selectize/dist/js/standalone/selectize.min.js 3) in your ProcessPageEdit.js file, init the plugin: /** * Selectize * ============================================ * init selectize tagging on field called images * */ $(function(){ $(".Inputfield_images input[name^='tags_images_']").each(function() { $(this).selectize({ delimiter: ' ', persist: false, plugins: ['remove_button','drag_drop'], options: [ {value: 'tag1', text: 'tag1 - use this for blah'}, {value: 'tag2', text: 'tag2 - this will do blah'}, {value: 'tag3', text: 'tag3 - a super special tag!!'}, ], create: function(input) { return { value: input, text: input } } }); }); }); Now you have a really good tagging interface: Notice how you can also add explanatory info right into the tag, but keep the tag value whatever you want; there are a lot of other options you can implement, check out the selectize docs. this is really now one feature that i believe should be included in the core or at least made into a module... first an inputfield/fieldtype single/multi select based on selectize which can improve selections when you have a lot of additional data to show about the individual select options; second would be to enable selectize.js on any image tag field and be able to define the option value/labels based globally or based on current template...
-
sure enough, it works like you said! no more 'sent by'...! good point though about wiremail - i currently use horst's wiremail module and am extensively using the functions for attachments and probably more; i wonder if when i get to the stage of switching that site over to mailgun, if i'll need to use the SMTP connection option, instead of API..
-
Display "Related Data" From Page Field In An Admin Page
Macrura replied to Gazley's topic in General Support
replying to the OP - use a data- attribute on the select using jQuery you read that data attribute for the selected item and then show it... see more here: https://processwire.com/talk/topic/419-extending-inputfields/?p=76861 -
right i just checked and i do have all of the spf and dkim records correctly done but i think you are saying that i should not use the mg subdomain and change that to the normal domain so i don't get those sent by things.. i wonder if you can have both mailgun and mandrill txt records
-
ok thanks - i followed their recommendation of the mg subdomain but i guess i need to now add all of the sending domains and dkim records for those domains, at least that's how it is with Mandrill...
-
@Pierre-Luc thanks for this module, everything seems to be working well and i greatly appreciate all the time you put into it; Mailgun is great, and i can see myself using it a lot in the future for transactional emails in processwire. My only issues are probably more about adjusting from Mandrill to Mailgun, i do like the Mandrill interface in terms of seeing the outbound activity list, sender, status, subject, view content etc; it's a bit more user friendly; also, this may be how i have it configured but the from address on mailgun shows a "sent by " and then a long email address like person@mg.domain.com ; i know i'm going to get some complaints from clients if that is something that can't be changed, and they may just prefer paying the $10/month mailchimp minimum plan to carry on with Mandrill..