-
Posts
2,766 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
i have a theme engine module that i use which is part of a suite of modules that together, provide a frontend, or 'markup' api. The Theme Engine handles things like the body classes and is basically a wrapper module for a collection of functions/methods helpful for optimizing front end development. It includes helpers for webfonts and facilitates the handling of the site assets, enabling each template to add dependencies (js or css files, or inline scripts/styles), as well as acting as a wrapper for ProCache whereby it allows the developer to enable/disable ProCache minification as needed. For example, superusers may disable minification and the module will output the individual assets with a url paramter appended to prevent caching. It also provides a simple 'hook' system where the developer can add containers to the main template, into which templates can 'inject' markup, similar to Wordpress do_action. The Meta Engine reads settings from a settings module where the admins can enter the primary settings for the site, such as site title, copyright year and holder, publisher, social media links, contact information and more and provides an easy API to access those settings, as well as formatting for convenience. It also allows for individual templates to add and modify items to the header and footer, such as prefetch/prerender, next/prev, schema, open graph tags, custom favicon sets, and any custom markup. other members of the suite are a Blog Engine, and Events/Calendar Engine.
-
this has been discussed in the context of a repeater field with a limit of 1 item; afaik there is no way to do what you are describing
-
Can't you just make a regular fieldset tab and put them in there, i have sometimes 2-3 content tabs, and there is no reason to make a module. also on that example posted, the solution provided is only for outputting markup, like some instructions, or like a training video etc. AFAIK you cannot add a tab to page edit and expect those fields to automagically save to the database b/c the fields need to exist in the database to save to.
-
yes, to confirm, my code is designed specifically if you are not restricting within the template settings.
-
if you only want to process requests where both segments exits, then you would want to check for both. this is a simple example: if($input->urlSegment3) throw new Wire404Exception(); if($input->urlSegment1 == 'edit') { if (strlen($input->urlSegment2)) { // process the 2nd segment here } else { throw new Wire404Exception(); } } if($input->urlSegment1 == 'new') { // process request for new if (strlen($input->urlSegment2)) { throw new Wire404Exception(); } }
-
can you provide your template code for how you are dealing with the URL segments? Usually you would check each segment, and if the segment exists, you would sanitize it for further processing, and then take actions based on the validity of the segment.
-
renderPager showing 1st results on every page# and pagination
Macrura replied to hellomoto's topic in General Support
you'd need to take out the start=0, from your pages->find in order for the pagination to work, otherwise it will always show the items starting from page 1 -
renderPager showing 1st results on every page# and pagination
Macrura replied to hellomoto's topic in General Support
do you have pagination enabled on the template? -
usually for areas like news, blog, events, the best practice is to check for the URL segments as mentioned by abdus. You can look at the blog module or blog profile to possibly see some functions for how to intercept the segment, and display the filtered posts.
-
could be anything, permissions even. Can you revert to the old version? I've done some upgrades of really old site, but so far have been lucky; the worst thing sometimes is a module that is not compatible, so you may need to disable one by one the modules and see; check the logs from FTP; reset all permissions across the whole install, recursively.
-
How to capture page containing a pagetable?
Macrura replied to bmacnaughton's topic in API & Templates
usually what i do in these cases is add a page field to the template of the pagetable page, and set that field to the page that it is being edited from. I used a save hook on the main page to look at the items in the page table and for any where that page field is not set, it assigns that field to the page being edited (so setting the page field on the pagetable item to PageA). that field is also hidden using CSS. -
Just want to chime in and say thanks for this!
-
one thing i did for a complex table was - single row data is cached (wire cache) - entire table is cached (wirecache) from the row data - the json is used to create the table itself (data tables). if a single row changes, that row's cache is refreshed and the whole table, but this was fast because all of the other rows didn't need to be re-calculated. also in my case, each row had some pretty complex rendering functions that needed to run, so this was the best solution i came up with; and wirecache worked really well! in testing datatables, for my use case, inline json was the fastest to render, when compared with table markup and ajax.
-
yeah, it's basically standard; you can enable hmac validation, not that hard, but in this case might be more effort than worth it, because these guys know if a price has been changed... https://wiki.foxycart.com/v/1.1/hmac_validation
-
you can also set the icon in the AdminThemeReno settings, if you are using that Admin theme.
-
Need to move child page and descendants to root
Macrura replied to timothy.m.wilson's topic in General Support
you can rename your homepage to blog, but then you page tree on the backend will show all the posts at the root (sub home) level. Usually this sort of thing is done using url segments in combination with a page path rewrite hook to make the blog posts live off the root. Look for the CMS critic case study to see an example of that. -
CMS Critic Powered by ProcessWire (again) + Case Study
Macrura replied to ryan's topic in News & Announcements
they did cover PW 3 https://www.cmscritic.com/processwire-3.0-alpha-1-released/ -
I'm using this function in places, seems to work well: /** * Given an email address render the obfuscated version * * @param $strEmail - an email address * */ function createMailto($strEmail) { $strNewAddress = ''; for($intCounter = 0; $intCounter < strlen($strEmail); $intCounter++){ $strNewAddress .= "&#" . ord(substr($strEmail,$intCounter,1)) . ";"; } $arrEmail = explode("@", $strNewAddress); $strTag = "<script type='text/javascript'>\n"; $strTag .= "<!--\n"; $strTag .= "document.write('<a href=\"mai');\n"; $strTag .= "document.write('lto');\n"; $strTag .= "document.write(':" . $arrEmail[0] . "');\n"; $strTag .= "document.write('@');\n"; $strTag .= "document.write('" . $arrEmail[1] . "\">');\n"; $strTag .= "document.write('" . $arrEmail[0] . "');\n"; $strTag .= "document.write('@');\n"; $strTag .= "document.write('" . $arrEmail[1] . "<\/a>');\n"; $strTag .= "// -->\n"; $strTag .= "</script><noscript>" . $arrEmail[0] . " at \n"; $strTag .= str_replace("."," dot ",$arrEmail[1]) . "</noscript>"; return $strTag; } also works well in a hanna code, and doesn't require any additional js files
-
How can I move ckeditor styles.js to another site folder?
Macrura replied to John W.'s topic in General Support
you have to follow the format: mystyles: /site/modules/etc.. you only have the path; also make sure to change the name of the styleset to add, so it doesn't conflict with the core. -
@benbyf just a shot in the dark, but have you considered that with the 2.7.2 version, when you submitted it, Apple was not validating the byte-range request support?
-
for some reason the 'include theme based files' stopped working, so i added AdminCustomFiles/AdminThemeReno.css to the dependencies, and it works.. @Peejay that might solve your problem...
-
cool, yeah i'm trying to sort out using images on the ProcessGeneralSettings module, and will be hopefully working out how to do this soon...
-
the way to do it would be to have the module create template/field/page to hold the image(s), and then in the module, reference that page..
-
it depends on how you setup the logic to replace the anchor tags, but it should be doable for sure; would require more changes to the module though as you'd need to have config to select the files field, possibly a setting to enable looking for files; and then all of the logic to cycle through the anchor tags and check to see if they have a specific extension; seems that if you were going to allow file imports, you'd want to make it configurable for the file extension, in case you wanted to import some other filetypes..
-
reusable block across multiple pages of same template
Macrura replied to DarsVaeda's topic in API & Templates
seems like @Christophe's or @abdus would both work, unless you need to enable editing of that block within the editor of the other one.. in that case you would probably use some hook to include a link to edit that included block, and maybe a page reference on the block to select which templates to show it on..